From 17a7a0c0df3dbc3e6225dddb55f6332deccdb201 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期三, 03 六月 2026 11:38:30 +0800
Subject: [PATCH] 浪潮部署

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

diff --git a/src/main/resources/mapper/system/SysDeptMapper.xml b/src/main/resources/mapper/system/SysDeptMapper.xml
index afc1130..ec42e7f 100644
--- a/src/main/resources/mapper/system/SysDeptMapper.xml
+++ b/src/main/resources/mapper/system/SysDeptMapper.xml
@@ -22,9 +22,9 @@
 		<result property="updateTime" column="update_time" />
 		<result property="staffCount" column="staff_count" />
 	</resultMap>
-	
+
 	<sql id="selectDeptVo">
-        select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time 
+        select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
         from sys_dept d
     </sql>
 
@@ -47,12 +47,12 @@
 			AND d.status = #{status}
 		</if>
 		<!-- 鏁版嵁鑼冨洿杩囨护 -->
-		${params.dataScope}
+-- 		${params.dataScope}
 		group by d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
 		order by d.parent_id, d.order_num
 	</select>
-    
-    <select id="selectDeptListByRoleId" resultType="Long">
+
+    <select id="selectDeptListByRoleId" resultType="java.lang.Long">
 		select d.dept_id
 		from sys_dept d
             left join sys_role_dept rd on d.dept_id = rd.dept_id
@@ -62,7 +62,7 @@
             </if>
 		order by d.parent_id, d.order_num
 	</select>
-    
+
     <select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
 		select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status,
 			(select dept_name from sys_dept where dept_id = d.parent_id) parent_name,
@@ -70,29 +70,29 @@
 		from sys_dept d
 		where d.dept_id = #{deptId}
 	</select>
-    
+
     <select id="checkDeptExistUser" parameterType="Long" resultType="int">
 		select count(1) from sys_user_dept where dept_id = #{deptId}
 	</select>
-	
+
 	<select id="hasChildByDeptId" parameterType="Long" resultType="int">
 		select count(1) from sys_dept
 		where del_flag = '0' and parent_id = #{deptId} limit 1
 	</select>
-	
+
 	<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
 		select * from sys_dept where find_in_set(#{deptId}, ancestors)
 	</select>
-	
+
 	<select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
 		select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
 	</select>
-	
+
 	<select id="checkDeptNameUnique" resultMap="SysDeptResult">
 	    <include refid="selectDeptVo"/>
 		where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
 	</select>
-    
+
     <insert id="insertDept" parameterType="com.ruoyi.project.system.domain.SysDept">
  		insert into sys_dept(
  			<if test="deptId != null and deptId != 0">dept_id,</if>
@@ -122,7 +122,7 @@
  			sysdate()
  		)
 	</insert>
-	
+
 	<update id="updateDept" parameterType="com.ruoyi.project.system.domain.SysDept">
  		update sys_dept
  		<set>
@@ -140,7 +140,7 @@
  		</set>
  		where dept_id = #{deptId}
 	</update>
-	
+
 	<update id="updateDeptChildren" parameterType="java.util.List">
 	    update sys_dept set ancestors =
 	    <foreach collection="depts" item="item" index="index"
@@ -153,19 +153,19 @@
 	        #{item.deptId}
 	    </foreach>
 	</update>
-	 
+
 	<update id="updateDeptStatusNormal" parameterType="Long">
- 	    update sys_dept set status = '0' where dept_id in 
+ 	    update sys_dept set status = '0' where dept_id in
  	    <foreach collection="array" item="deptId" open="(" separator="," close=")">
         	#{deptId}
         </foreach>
 	</update>
-	
+
 	<delete id="deleteDeptById" parameterType="Long">
 		update sys_dept set del_flag = '2' where dept_id = #{deptId}
 	</delete>
 
-	<select id="maxLevelDeptId">
+	<select id="maxLevelDeptId" resultType="java.lang.Long">
 		WITH RECURSIVE DepartmentHierarchy AS (
 			SELECT dept_id, parent_id
 			FROM sys_dept
@@ -184,4 +184,9 @@
 		WHERE parent_id = 100;
 	</select>
 
-</mapper> 
\ No newline at end of file
+    <select id="selectDeptByDeptName" resultType="com.ruoyi.project.system.domain.SysDept">
+        <include refid="selectDeptVo"/>
+        WHERE d.dept_name = #{deptName}
+        LIMIT 1
+    </select>
+</mapper>

--
Gitblit v1.9.3