From 3328aec7bc4cc2c090f015cba905a82d6d52870c Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期日, 19 十月 2025 10:34:29 +0800
Subject: [PATCH] fix:更新
---
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml | 41 +++++++++++++++++++++++++++++++++++++++--
1 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
index 8c40c86..b2b0c02 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
@@ -65,7 +65,7 @@
AND u.user_id = #{userId}
</if>
<if test="userName != null and userName != ''">
- AND u.user_name like concat('%', #{userName}, '%')
+ AND u.nick_name like concat('%', #{userName}, '%')
</if>
<if test="status != null and status != ''">
AND u.status = #{status}
@@ -80,7 +80,44 @@
AND date_format(u.create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d')
</if>
<if test="deptId != null and deptId != 0">
- AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
+ <![CDATA[
+ AND u.dept_id IN (
+ -- 鏌ヨ鐢ㄦ埛鎵�灞炲垎鍏徃鍙婂叾鎵�鏈夊瓙閮ㄩ棬
+ SELECT t.dept_id FROM sys_dept t
+ WHERE t.del_flag = '0' AND (
+ -- 鎯呭喌1锛氫紶鍏ョ殑閮ㄩ棬灏辨槸鍒嗗叕鍙�(parent_id=100)
+ (t.dept_id = ]]>#{deptId}<![CDATA[ AND EXISTS (
+ SELECT 1 FROM sys_dept d WHERE d.dept_id = ]]>#{deptId}<![CDATA[ AND d.parent_id = 100
+ ))
+ OR
+ -- 鏌ヨ璇ュ垎鍏徃鐨勬墍鏈夊瓙閮ㄩ棬
+ (find_in_set(
+ (SELECT d.dept_id FROM sys_dept d WHERE d.dept_id = ]]>#{deptId}<![CDATA[ AND d.parent_id = 100),
+ t.ancestors
+ ) > 0)
+ OR
+ -- 鎯呭喌2锛氫紶鍏ョ殑鏄瓙閮ㄩ棬锛屾壘鍒板叾鎵�灞炲垎鍏徃
+ (t.dept_id IN (
+ SELECT branch.dept_id FROM sys_dept branch
+ WHERE branch.parent_id = 100
+ AND find_in_set(branch.dept_id, (
+ SELECT sub.ancestors FROM sys_dept sub WHERE sub.dept_id = ]]>#{deptId}<![CDATA[
+ )) > 0
+ ))
+ OR
+ -- 鏌ヨ璇ュ垎鍏徃鐨勬墍鏈夊瓙閮ㄩ棬
+ (find_in_set(
+ (SELECT branch.dept_id FROM sys_dept branch
+ WHERE branch.parent_id = 100
+ AND find_in_set(branch.dept_id, (
+ SELECT sub.ancestors FROM sys_dept sub WHERE sub.dept_id = ]]>#{deptId}<![CDATA[
+ )) > 0
+ ),
+ t.ancestors
+ ) > 0)
+ )
+ )
+ ]]>
</if>
<!-- 鏁版嵁鑼冨洿杩囨护 -->
${params.dataScope}
--
Gitblit v1.9.1