|
|
|
@ -819,4 +819,87 @@ |
|
|
|
where u.del_flag = '0' |
|
|
|
AND u.law_certificate_num = #{lawCertificateNum} |
|
|
|
</select> |
|
|
|
<select id="queryUsersByPage" resultType="User" parameterType="User"> |
|
|
|
select u.user_id, u.dept_id, u.login_name, u.user_name, u.phonenumber, u.password, d.dept_name,u.law_certificate_num |
|
|
|
from sys_user u |
|
|
|
left join sys_dept d on u.dept_id = d.dept_id |
|
|
|
where u.del_flag = '0' |
|
|
|
<if test="userId != null and userId != ''"> |
|
|
|
AND u.user_id = #{userId} |
|
|
|
</if> |
|
|
|
<if test="loginName != null and loginName != ''"> |
|
|
|
AND u.login_name like concat('%', #{loginName}, '%') |
|
|
|
</if> |
|
|
|
<if test="userName != null and userName != ''"> |
|
|
|
AND ( |
|
|
|
u.user_name like concat('%', #{userName}, '%') |
|
|
|
or |
|
|
|
u.law_certificate_num like concat('%', #{userName}, '%') |
|
|
|
) |
|
|
|
</if> |
|
|
|
<if test="deptId != null and deptId != ''"> |
|
|
|
and u.dept_id = #{deptId} |
|
|
|
</if> |
|
|
|
<if test="notUserId != null and notUserId != ''"> |
|
|
|
and u.user_id not in |
|
|
|
<foreach item="uid" collection="params.notUserIds" open="(" separator="," close=")"> |
|
|
|
#{uid} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test="params.showCardId != null and params.showCardId == 0"> |
|
|
|
AND ( |
|
|
|
(u.law_certificate_num is not null AND u.law_certificate_num !="") |
|
|
|
or (d.`zone` = 5 or d.`zone` = 15) |
|
|
|
or (d.parent_id in (select dept_id from sys_dept where `zone` = 5 or `zone` = 15)) |
|
|
|
) |
|
|
|
</if> |
|
|
|
and u.dept_id != 405 |
|
|
|
<if test="params.dataScope != null and params.dataScope != ''"> |
|
|
|
<!-- 数据范围过滤 --> |
|
|
|
${params.dataScope} |
|
|
|
</if> |
|
|
|
<if test="params.pageNum != null and params.pageSize != null"> |
|
|
|
LIMIT #{params.pageNum}, #{params.pageSize} |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
<select id="queryUsersByPageCount" resultType="java.lang.Integer"> |
|
|
|
select count(*) |
|
|
|
from sys_user u |
|
|
|
left join sys_dept d on u.dept_id = d.dept_id |
|
|
|
where u.del_flag = '0' |
|
|
|
<if test="userId != null and userId != ''"> |
|
|
|
AND u.user_id = #{userId} |
|
|
|
</if> |
|
|
|
<if test="loginName != null and loginName != ''"> |
|
|
|
AND u.login_name like concat('%', #{loginName}, '%') |
|
|
|
</if> |
|
|
|
<if test="userName != null and userName != ''"> |
|
|
|
AND ( |
|
|
|
u.user_name like concat('%', #{userName}, '%') |
|
|
|
or |
|
|
|
u.law_certificate_num like concat('%', #{userName}, '%') |
|
|
|
) |
|
|
|
</if> |
|
|
|
<if test="deptId != null and deptId != ''"> |
|
|
|
and u.dept_id = #{deptId} |
|
|
|
</if> |
|
|
|
<if test="notUserId != null and notUserId != ''"> |
|
|
|
and u.user_id not in |
|
|
|
<foreach item="uid" collection="params.notUserIds" open="(" separator="," close=")"> |
|
|
|
#{uid} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test="params.showCardId != null and params.showCardId == 0"> |
|
|
|
AND ( |
|
|
|
(u.law_certificate_num is not null AND u.law_certificate_num !="") |
|
|
|
or (d.`zone` = 5 or d.`zone` = 15) |
|
|
|
or (d.parent_id in (select dept_id from sys_dept where `zone` = 5 or `zone` = 15)) |
|
|
|
) |
|
|
|
</if> |
|
|
|
and u.dept_id != 405 |
|
|
|
<if test="params.dataScope != null and params.dataScope != ''"> |
|
|
|
<!-- 数据范围过滤 --> |
|
|
|
${params.dataScope} |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
</mapper> |