From 42a7552b9c8603aeab7f0785eb05270dfbeb0bd3 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期日, 02 三月 2025 10:16:20 +0800
Subject: [PATCH] Merge branch 'master' into dev

---
 system/src/main/resources/mapper/system/SysDeptMapper.xml |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/system/src/main/resources/mapper/system/SysDeptMapper.xml b/system/src/main/resources/mapper/system/SysDeptMapper.xml
index 8de6205..f4faa92 100644
--- a/system/src/main/resources/mapper/system/SysDeptMapper.xml
+++ b/system/src/main/resources/mapper/system/SysDeptMapper.xml
@@ -47,6 +47,18 @@
 		order by d.parent_id, d.order_num
     </select>
 
+	<select id="selectDeptListNoAuth" parameterType="SysDept" resultMap="SysDeptResult">
+		<include refid="selectDeptVo"/>
+		where d.del_flag = '0'
+		<if test="parentId != null">
+			AND FIND_IN_SET(#{parentId}, ancestors) > 0
+		</if>
+		<if test="deptName != null and deptName != ''">
+			AND dept_name like concat('%', #{deptName}, '%')
+		</if>
+		order by d.parent_id, d.order_num
+	</select>
+
     <select id="selectDeptListByRoleId" resultType="Long">
 		select d.dept_id
 		from sys_dept d
@@ -94,7 +106,7 @@
 		where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
 	</select>
     <select id="selectAncestors" resultType="java.lang.String">
-		select ancestors
+		select SD.ancestors
 		from sys_user SU
 		INNER JOIN sys_dept SD ON SU.dept_id = SD.dept_id
 		where SU.user_id = #{userId}

--
Gitblit v1.8.0