From c565ed505c1762e0eaf3d5eaeb618b90478920b5 Mon Sep 17 00:00:00 2001
From: lin <sbla5888@163.com>
Date: Sat, 13 Apr 2024 15:37:21 +0800
Subject: [PATCH] 小区过滤

---
 src/main/java/org/springblade/modules/district/mapper/DistrictMapper.xml |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/src/main/java/org/springblade/modules/district/mapper/DistrictMapper.xml b/src/main/java/org/springblade/modules/district/mapper/DistrictMapper.xml
index 2fdf6b2..48790f9 100644
--- a/src/main/java/org/springblade/modules/district/mapper/DistrictMapper.xml
+++ b/src/main/java/org/springblade/modules/district/mapper/DistrictMapper.xml
@@ -62,6 +62,19 @@
         name,
         remark aoiCode
         FROM blade_region where district_code like concat('361102','%')
+        <if test="isAdministrator==2">
+            <choose>
+                <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
+                    and code in
+                    <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+                        #{code}
+                    </foreach>
+                </when>
+                <otherwise>
+                    and code in ('')
+                </otherwise>
+            </choose>
+        </if>
         union all
         (
         select
@@ -77,6 +90,19 @@
                 #{item}
             </foreach>
         </if>
+        <if test="isAdministrator==2">
+            <choose>
+                <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
+                    and community_code in
+                    <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+                        #{code}
+                    </foreach>
+                </when>
+                <otherwise>
+                    and community_code in ('')
+                </otherwise>
+            </choose>
+        </if>
         )
     </select>
 

--
Gitblit v1.9.3