From 8245a52ca30b397e5ec6fcefe391e3b57475fb64 Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期五, 17 五月 2024 20:27:18 +0800
Subject: [PATCH] fix:部门管理员权限

---
 src/main/resources/mapper/DepartmentExamineMapper.xml |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mapper/DepartmentExamineMapper.xml b/src/main/resources/mapper/DepartmentExamineMapper.xml
index c74b34e..387fc8a 100644
--- a/src/main/resources/mapper/DepartmentExamineMapper.xml
+++ b/src/main/resources/mapper/DepartmentExamineMapper.xml
@@ -14,9 +14,21 @@
                  left join t_user c on a.create_user = c.id and c.deleted = 0
                  left join t_user c2 on a.user_id = c2.id and c2.deleted = 0
         where a.deleted = 0
+        <if test="deptIds != null and deptIds.size() > 0">
+            and (
+                b.id in <foreach collection="deptIds" item="item" index="index" open="(" separator="," close=")"> #{item} </foreach>
+             or b2.id in <foreach collection="deptIds" item="item" index="index" open="(" separator="," close=")"> #{item} </foreach>
+            )
+        </if>
         <if test="userName != null">
             and c2.real_name like concat('%', #{userName}, '%')
         </if>
+        <if test="departmentIds != null">
+            and FIND_IN_SET(#{departmentIds}, a.now_department_ids)
+        </if>
+        <if test="nowDepartmentIds != null">
+            and FIND_IN_SET(#{nowDepartmentIds}, a.now_department_ids)
+        </if>
         GROUP BY a.id, a.create_time
         order by a.create_time desc
     </select>

--
Gitblit v1.8.0