update:优化查询角色未分配的用户列表中的条件筛选

not in已经排除了此角色所分配的所有用户,所以应移除多余的条件筛选

Signed-off-by: 沫离 <974751082@qq.com>
This commit is contained in:
沫离 2023-06-13 03:18:27 +00:00 committed by Gitee
parent 1207052749
commit 925cfe5e08
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 1 additions and 1 deletions

View File

@ -111,7 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join sys_dept d on u.dept_id = d.dept_id
left join sys_user_role ur on u.user_id = ur.user_id
left join sys_role r on r.role_id = ur.role_id
where u.del_flag = '0' and (r.role_id != #{roleId} or r.role_id IS NULL)
where u.del_flag = '0'
and u.user_id not in (select u.user_id from sys_user u inner join sys_user_role ur on u.user_id = ur.user_id and ur.role_id = #{roleId})
<if test="loginName != null and loginName != ''">
AND u.login_name like concat('%', #{loginName}, '%')