From 9caa82674793eb3ce6b9cfc0dd20d931bcd25e0c Mon Sep 17 00:00:00 2001
From: zhangnaisong <2434969829@qq.com>
Date: 星期二, 28 五月 2024 16:18:54 +0800
Subject: [PATCH] 兴趣点查询加入自定义权限修改提交

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

diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
index 5049c2e..13e09aa 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
@@ -158,4 +158,27 @@
 		update sys_dept set del_flag = '2' where dept_id = #{deptId}
 	</delete>
 
+	<select id="getChildrenDeptIdList" resultType="java.lang.Long">
+		select distinct sd.dept_id from sys_dept sd
+		where sd.parent_id in
+		<foreach collection="deptIdList" item="deptId" separator="," open="(" close=")">
+			#{deptId}
+		</foreach>
+	</select>
+
+	<select id="selectDeptIdBySub" resultType="java.lang.Long" parameterType="java.lang.Long">
+		with recursive rsd as (
+			select sd.dept_id from sys_dept sd where sd.dept_id = #{deptId}
+			union
+			select csd.dept_id from sys_dept csd inner join rsd on rsd.dept_id = csd.parent_id
+		)
+		select dept_id from rsd
+	</select>
+
+	<select id="selectRoleDeptIdByUsersId" resultType="java.lang.Long" parameterType="java.lang.String">
+		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}
+	</select>
 </mapper> 
\ No newline at end of file

--
Gitblit v1.9.3