refactor: 超级管理员不显示在列表优化

This commit is contained in:
Ray.Hao
2025-02-25 23:08:16 +08:00
parent 7c7eaf21ea
commit 300c35a2ba

View File

@@ -24,7 +24,9 @@
LEFT JOIN sys_user_role sur ON u.id = sur.user_id
LEFT JOIN sys_role r ON sur.role_id = r.id
<where>
u.is_deleted = 0 AND u.username != 'root'
u.is_deleted = 0
<!-- 超级管理员不显示在列表 -->
AND r.name != '${@com.youlai.boot.common.constant.SystemConstants@ROOT_ROLE_CODE}'
<if test='queryParams.keywords!=null and queryParams.keywords.trim() neq ""'>
AND (
u.username LIKE CONCAT('%',#{queryParams.keywords},'%')
@@ -118,9 +120,9 @@
<result property="username" column="username" jdbcType="VARCHAR"/>
<result property="password" column="password" jdbcType="VARCHAR"/>
<result property="status" column="status" jdbcType="BOOLEAN"/>
<result property="deptId" column="dept_id" jdbcType="BIGINT"></result>
<result property="deptId" column="dept_id" jdbcType="BIGINT"/>
<collection property="roles" ofType="string" javaType="java.util.Set">
<result column="code"></result>
<result column="code" />
</collection>
</resultMap>
@@ -191,7 +193,7 @@
sys_user u
LEFT JOIN sys_dept d ON u.dept_id = d.id
<where>
u.is_deleted = 0 AND u.username != 'root'
u.is_deleted = 0
<if test='keywords!=null and keywords.trim() neq ""'>
AND (u.username LIKE CONCAT('%',#{keywords},'%')
OR u.nickname LIKE CONCAT('%',#{keywords},'%')