From a95a045a631993c7f89ee87f0a8f4a57b4a21efc Mon Sep 17 00:00:00 2001
From: lin <sbla5888@163.com>
Date: Mon, 13 May 2024 14:08:41 +0800
Subject: [PATCH] bug修复

---
 src/main/java/org/springblade/modules/place/mapper/PlacePractitionerMapper.xml |   35 ++++++++++++++++++++++++++++++++++-
 1 files changed, 34 insertions(+), 1 deletions(-)

diff --git a/src/main/java/org/springblade/modules/place/mapper/PlacePractitionerMapper.xml b/src/main/java/org/springblade/modules/place/mapper/PlacePractitionerMapper.xml
index db7a0ef..17d99c3 100644
--- a/src/main/java/org/springblade/modules/place/mapper/PlacePractitionerMapper.xml
+++ b/src/main/java/org/springblade/modules/place/mapper/PlacePractitionerMapper.xml
@@ -33,6 +33,7 @@
         LEFT JOIN jczz_place jp ON jp.id = jpp.place_id
         LEFT JOIN jczz_place_poi_label jppl on jppl.place_id = jp.id and type = 3
         LEFT JOIN jczz_category jc on jc.category_no = jppl.poi_code
+        LEFT JOIN jczz_police_affairs_grid jpag on jp.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0
         <where>
             <if test="placePractitioner.id != null ">and jpp.id = #{placePractitioner.id}</if>
             <if test="placePractitioner.placeId != null ">and jpp.place_id = #{placePractitioner.placeId}</if>
@@ -42,7 +43,6 @@
             </if>
             <if test="placePractitioner.telephone != null  and placePractitioner.telephone != ''">and jpp.telephone like
                 concat('%', #{placePractitioner.telephone},'%')
-
             </if>
             <if test="placePractitioner.tempAddress != null  and placePractitioner.tempAddress != ''">and
                 jpp.temp_address =
@@ -82,6 +82,39 @@
                 and (TIMESTAMPDIFF(year, substring(jpp.id_card, 7, 8), now()) &lt; 18  or jpp.ethnicity != 1)
                 and jc.category_no in (180202,180201,180200)
             </if>
+
+            <if test="isAdministrator==2">
+                <choose>
+                    <when test="placePractitioner.roleName != null and placePractitioner.roleName != ''">
+                        <if test="placePractitioner.roleName=='wgy'">
+                            <choose>
+                                <when test="gridCodeList !=null and gridCodeList.size()>0">
+                                    and jp.grid_code in
+                                    <foreach collection="gridCodeList" item="code" open="(" close=")" separator=",">
+                                        #{code}
+                                    </foreach>
+                                </when>
+                                <otherwise>
+                                    and jp.grid_code in ('')
+                                </otherwise>
+                            </choose>
+                        </if>
+                        <if test="placePractitioner.roleName=='mj'">
+                            <choose>
+                                <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
+                                    and jpag.community_code in
+                                    <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+                                        #{code}
+                                    </foreach>
+                                </when>
+                                <otherwise>
+                                    and jpag.community_code in ('')
+                                </otherwise>
+                            </choose>
+                        </if>
+                    </when>
+                </choose>
+            </if>
             and jpp.is_deleted = 0
             order by jpp.id desc
         </where>

--
Gitblit v1.9.3