From d89e0182ad825d0926f4bc98e87d3b966056aac7 Mon Sep 17 00:00:00 2001
From: liusuyi <1951119284@qq.com>
Date: 星期五, 12 七月 2024 22:00:28 +0800
Subject: [PATCH] 优化:流媒体
---
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
index 13e09aa..94aa515 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
@@ -179,6 +179,23 @@
select srd.dept_id from sys_user su
inner join sys_user_role sur on su.user_id = sur.user_id
inner join sys_role_dept srd on sur.role_id = srd.role_id
- where su.user_id = #{usersId}
+ where su.user_id = #{usersId} order by srd.dept_id
+ </select>
+
+ <select id="getParentsDeptListByDeptId" resultMap="SysDeptResult" parameterType="java.lang.Long">
+ with recursive rsd as (
+ select * from sys_dept sd where sd.dept_id = #{deptId}
+ union
+ select psd.* from sys_dept psd inner join rsd on rsd.parent_id = psd.dept_id
+ )
+ select * from rsd
+ </select>
+
+ <select id="selectNextChildrenDeptByIdAndInList" resultMap="SysDeptResult">
+ select * from sys_dept where parent_id=#{deptId} and del_flag='0'
+ and dept_id in
+ <foreach collection="deptIdList" item="deptId" separator="," index="index" open="(" close=")">
+ #{deptId}
+ </foreach>
</select>
</mapper>
\ No newline at end of file
--
Gitblit v1.9.3