【SysUserMapper】增加组织机构子查询

pull/3/head
chenjinlong 2021-01-12 20:55:45 +08:00
parent dcf4a0bf36
commit ffc37d9259
1 changed files with 4 additions and 4 deletions

View File

@ -22,16 +22,16 @@
left join sys_user_org suorg on suser.user_id = suorg.user_id left join sys_user_org suorg on suser.user_id = suorg.user_id
<where> <where>
<if test="sysUserRequest.realName != null and sysUserRequest.realName != ''"> <if test="sysUserRequest.realName != null and sysUserRequest.realName != ''">
and sys_user.real_name like concat('%',#{sysUserRequest.realName},'%') and suser.real_name like concat('%',#{sysUserRequest.realName},'%')
</if> </if>
<if test="sysUserRequest.account != null and sysUserRequest.account != ''"> <if test="sysUserRequest.account != null and sysUserRequest.account != ''">
and sys_user.account like concat('%',#{sysUserRequest.account},'%') and suser.account like concat('%',#{sysUserRequest.account},'%')
</if> </if>
<if test="sysUserRequest.statusFlag != null and sysUserRequest.statusFlag != ''"> <if test="sysUserRequest.statusFlag != null and sysUserRequest.statusFlag != ''">
and sys_user.status_flag like concat('%',#{sysUserRequest.statusFlag},'%') and suser.status_flag like concat('%',#{sysUserRequest.statusFlag},'%')
</if> </if>
<if test="sysUserRequest.orgId != null and sysUserRequest.orgId != ''"> <if test="sysUserRequest.orgId != null and sysUserRequest.orgId != ''">
and suorg.org_id = #{sysUserRequest.orgId} and suorg.org_id in(select org_id from hr_organization where org_pids like CONCAT('%[',#{sysUserRequest.orgId},']%') or org_id=#{sysUserRequest.orgId})
</if> </if>
and suser.del_flag = 'N' and suser.del_flag = 'N'
order by suser.create_time desc order by suser.create_time desc