From f81bec39232ae994e04c47ba44c963c1c8c8c9c8 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期五, 28 二月 2025 11:06:14 +0800
Subject: [PATCH] Merge branch 'dev'
---
system/src/main/resources/mapper/system/SysDeptMapper.xml | 22 +++++++++++++++++++---
1 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/system/src/main/resources/mapper/system/SysDeptMapper.xml b/system/src/main/resources/mapper/system/SysDeptMapper.xml
index e0faa04..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,10 +106,14 @@
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}
+ </select>
+
+ <select id="selectByName" parameterType="string" resultType="long">
+ SELECT dept_id FROM sys_dept WHERE dept_name = #{name} and del_flag = '0' limit 1
</select>
<insert id="insertDept" parameterType="SysDept">
@@ -131,9 +147,9 @@
<update id="updateDept" parameterType="SysDept">
update sys_dept
<set>
- <if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
+ <if test="parentId != null">parent_id = #{parentId},</if>
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
- <if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
+ <if test="ancestors != null">ancestors = #{ancestors},</if>
<if test="orderNum != null">order_num = #{orderNum},</if>
<if test="leader != null">leader = #{leader},</if>
<if test="phone != null">phone = #{phone},</if>
--
Gitblit v1.8.0