From a144dec759ca53e72a6421596fda2e92b468084f Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Mon, 02 Aug 2021 11:57:51 +0800
Subject: [PATCH] 数据操作同步监管后台

---
 src/main/java/org/springblade/modules/system/mapper/DeptMapper.xml |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/src/main/java/org/springblade/modules/system/mapper/DeptMapper.xml b/src/main/java/org/springblade/modules/system/mapper/DeptMapper.xml
index 68defdc..e007344 100644
--- a/src/main/java/org/springblade/modules/system/mapper/DeptMapper.xml
+++ b/src/main/java/org/springblade/modules/system/mapper/DeptMapper.xml
@@ -172,10 +172,14 @@
         FROM
         blade_dept
         WHERE
-        parent_id = dept.id and is_deleted = 0
+        parent_id = dept.id and dept.is_deleted = 0
         ) AS "has_children"
         FROM
         blade_dept dept
+        left join
+        blade_user bu
+        on
+        bu.dept_id = dept.id
         WHERE
         dept.is_deleted = 0
         <if test="type==1">
@@ -185,6 +189,11 @@
         <if test="type==2 or type==3">
             and dept_category=2
             AND dept.parent_id = "1123598813738675201"
+        </if>
+        <if test="type==4 and jurisdiction!=null and jurisdiction!=''">
+            and dept_category=1
+            AND dept.parent_id = "1413470343230877697"
+            and bu.jurisdiction = #{jurisdiction}
         </if>
         )
 
@@ -209,6 +218,10 @@
         <if test="type==2 or type==3">
             and dept_category=2
         </if>
+        <if test="type==4 and jurisdiction!=null and jurisdiction!=''">
+            and dept_category=1
+            and bu.jurisdiction = #{jurisdiction}
+        </if>
         )
         )c
     </select>

--
Gitblit v1.9.3