fix: 用户查询中排除超级管理员并优化重复条件

This commit is contained in:
Ray.Hao
2025-03-06 16:51:42 +08:00
parent 129e2153d9
commit 1919395967

View File

@@ -26,7 +26,7 @@
<where>
u.is_deleted = 0
<!-- 超级管理员不显示在列表 -->
AND r.name != '${@com.youlai.boot.common.constant.SystemConstants@ROOT_ROLE_CODE}'
AND r.code != '${@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},'%')
@@ -40,12 +40,6 @@
<if test='queryParams.deptId!=null'>
AND concat(',',concat(d.tree_path,',',d.id),',') like concat('%,',#{queryParams.deptId},',%')
</if>
<if test='queryParams.roleIds!=null and queryParams.roleIds.size > 0'>
AND sur.role_id in
<foreach collection="queryParams.roleIds" item="roleId" open="(" close=")" separator=",">
#{roleId}
</foreach>
</if>
<if test="queryParams.createTime != null and queryParams.createTime.size > 0">
<if test="queryParams.createTime[0] != null and queryParams.createTime[0] != ''">
<bind name="startDate" value="queryParams.createTime[0].length() == 10 ? queryParams.createTime[0] + ' 00:00:00' : queryParams.createTime[0]"/>