guoyujie
6 小时以前 9ccc8bd3a53160a40cf60f14e5867f6ce9f6c58f
north-glass-erp/src/main/resources/mapper/userInfo/User.xml
@@ -29,6 +29,20 @@
        on b.role_id = c.id
        where state =1 and a.id != 1
    </select>
    <select id="findByAddress" resultMap="findAllMap">
        SELECT a.*,
               b.role_id,
               c.role
        FROM erp_user_info.user as a
                 left join user_role as b
                           on a.id = b.user_id
                 left join role as c
                           on b.role_id = c.id
        where state =1 and a.id != 1 and address is not null and address !=''
        <if test="userName != null and userName != '' and userName != 'null'">
            and user_name like concat('%',#{userName},'%')
        </if>
    </select>
    <select id="findOne" >
        SELECT *
@@ -90,4 +104,16 @@
        set address=#{process},update_time=now()
        where id=#{id}
    </update>
        <select id="selectOptimizeParmsById" resultType="String">
            SELECT optimize_parms FROM erp_user_info.user WHERE user_name = #{username}
        </select>
    <select id="getUserLog" >
        SELECT operator_id,operator,DATE_FORMAT(create_time, '%Y-%m-%d %H:%i:%s') AS format_create_time
        FROM erp_log.log
        WHERE create_time >= DATE_SUB(NOW(), INTERVAL 1 MONTH) and `function`='用户登录' order by create_time desc limit 0,100
    </select>
</mapper>