Jelajahi Sumber

修改用户选择时,不允许选择超级管理员

wukai 2 tahun lalu
induk
melakukan
013a369701

+ 1 - 0
doc-system/src/main/java/com/doc/system/service/impl/SysUserServiceImpl.java

@@ -546,6 +546,7 @@ public class SysUserServiceImpl implements ISysUserService {
         queryWrapper.eq("dept_id", deptId);
         queryWrapper.eq("del_flag", "0");
         queryWrapper.ne("user_id", "-1");
+        queryWrapper.ne("user_id", "1");
         return userMapper.selectList(queryWrapper);
     }
 }

+ 2 - 2
doc-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -130,7 +130,7 @@
         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 u.user_id>0 and r.role_id = #{roleId}
+        where u.del_flag = '0' and u.user_id>1 and r.role_id = #{roleId}
         <if test="userName != null and userName != ''">
             AND u.user_name like concat('%', #{userName}, '%')
         </if>
@@ -147,7 +147,7 @@
         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 u.user_id>0 and (r.role_id != #{roleId} or r.role_id IS NULL)
+        where u.del_flag = '0' and u.user_id>1 and (r.role_id != #{roleId} or r.role_id IS NULL)
         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="userName != null and userName != ''">