|
|
|
@ -6,7 +6,8 @@
|
|
|
|
|
resultType="com.glxp.api.entity.auth.AuthAdmin">
|
|
|
|
|
SELECT auth_user.*, auth_dept.name deptName,aw.name invName
|
|
|
|
|
FROM auth_user
|
|
|
|
|
left join auth_dept on auth_user.locDeptCode = auth_dept.code
|
|
|
|
|
left join auth_dept_user adu on adu.userId = auth_user.id
|
|
|
|
|
left join auth_dept on adu.deptId = auth_dept.id
|
|
|
|
|
left join auth_warehouse aw on aw.code = auth_user.locInvCode
|
|
|
|
|
<where>
|
|
|
|
|
<if test="ids != null and ids.size > 0">
|
|
|
|
@ -43,9 +44,11 @@
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="deptCode != null and deptCode != ''">
|
|
|
|
|
AND auth_user.locDeptCode = #{deptCode}
|
|
|
|
|
AND auth_dept.code = #{deptCode}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
GROUP BY
|
|
|
|
|
auth_user.userName
|
|
|
|
|
ORDER BY id DESC
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
@ -295,5 +298,50 @@
|
|
|
|
|
</where>
|
|
|
|
|
order by u.createTime desc
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getDepts" resultType="com.glxp.api.entity.auth.AuthAdmin">
|
|
|
|
|
SELECT auth_user.*, auth_dept.name deptName
|
|
|
|
|
FROM auth_dept_user adu
|
|
|
|
|
left join auth_user on adu.userId = auth_user.id
|
|
|
|
|
left join auth_dept on adu.deptId = auth_dept.id
|
|
|
|
|
<where>
|
|
|
|
|
<if test="ids != null and ids.size > 0">
|
|
|
|
|
AND auth_user.id IN
|
|
|
|
|
<foreach collection="ids" item="id" index="index" open="(" close=")" separator=",">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="userFlag != null">
|
|
|
|
|
AND auth_user.userFlag = #{userFlag}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="userName != null and '' != userName">
|
|
|
|
|
AND auth_user.userName LIKE CONCAT('%', #{userName}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="neUserName != null and '' != neUserName">
|
|
|
|
|
AND auth_user.userName != #{neUserName}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="invCode != null and '' != invCode">
|
|
|
|
|
AND auth_user.locInvCode = #{invCode}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="deptName != null and '' != deptName">
|
|
|
|
|
AND auth_dept.name LIKE CONCAT('%', #{deptName}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="lastUpdateTime != null and lastUpdateTime != ''">
|
|
|
|
|
<![CDATA[
|
|
|
|
|
and DATE_FORMAT(auth_user.lastModifyTime
|
|
|
|
|
, '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(#{lastUpdateTime}
|
|
|
|
|
, '%Y-%m-%d %H:%i:%S')
|
|
|
|
|
]]>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="userKey != null and userKey != ''">
|
|
|
|
|
AND (auth_user.userName like concat('%', #{userKey}, '%')
|
|
|
|
|
or auth_user.employeeName like concat('%', #{userKey}, '%')
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="deptCode != null and deptCode != ''">
|
|
|
|
|
AND auth_user.locDeptCode = #{deptCode}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
ORDER BY auth_user.id DESC
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|
|
|
|
|