From abe51c2213ed96f3c09e69333538f0d7b9a92ec0 Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Sun, 04 Feb 2024 10:26:53 +0800
Subject: [PATCH] 行政区查询修改,整改情况关联查询调整

---
 src/main/java/org/springblade/modules/taskPlaceRectification/mapper/TaskPlaceRectificationMapper.xml |   42 ++++++++++++++++++++++++++++++++++++++----
 1 files changed, 38 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/springblade/modules/taskPlaceRectification/mapper/TaskPlaceRectificationMapper.xml b/src/main/java/org/springblade/modules/taskPlaceRectification/mapper/TaskPlaceRectificationMapper.xml
index 633b081..1cdcf2e 100644
--- a/src/main/java/org/springblade/modules/taskPlaceRectification/mapper/TaskPlaceRectificationMapper.xml
+++ b/src/main/java/org/springblade/modules/taskPlaceRectification/mapper/TaskPlaceRectificationMapper.xml
@@ -118,7 +118,25 @@
 
     <select id="selectTaskPlaceRectificationById" parameterType="long" resultMap="TaskPlaceRectificationDTOResult">
         SELECT
-        jtpr.*,
+        jtpr.id,
+        jtpr.place_check_id,
+        jtpr.task_id,
+        jtpr.STATUS,
+        jtpr.task_name,
+        jtpr.remark,
+        jtpr.update_time,
+        jtpr.create_time,
+        jtpr.house_code,
+        jtpr.rectification_notice_flag,
+        jtpr.rectification_end_time,
+        jtpr.rectification_complete_time,
+        jtpr.rectification_flag,
+        jtpr.punish_flag,
+        jtpr.police_station,
+        jtpr.rectification_notice_img_url,
+        jtpr.signature_path,
+        jtpr.create_user,
+        jtpr.image_urls,
         jp.id jpid,
         jp.place_name,
         jp.location,
@@ -130,7 +148,8 @@
         bu.`name`,
         jpe.legal_tel,
         jpe.legal_person,
-        jt.remark reasonFailure
+        jt.remark reasonFailure,
+        jda.address_name
     FROM
         jczz_task_place_rectification jtpr
         LEFT JOIN jczz_task jt on jt.id = jtpr.task_id
@@ -139,6 +158,7 @@
         LEFT JOIN blade_region br ON br.`code` = jg.community_code
         LEFT JOIN jczz_place_ext jpe ON jpe.place_id = jp.id
         LEFT JOIN blade_user bu ON bu.id = jtpr.create_user
+        LEFT JOIN jczz_doorplate_address jda on jda.address_code=jtpr.house_code
     WHERE jtpr.task_id = #{taskId}
     </select>
 
@@ -187,7 +207,7 @@
         LEFT JOIN jczz_place_ext jpe ON jpe.place_id = jp.id
         LEFT JOIN blade_user bu ON bu.id = jtpr.create_user
         LEFT JOIN jczz_doorplate_address jda on jda.address_code=jtpr.house_code
-        LEFT JOIN jczz_police_affairs_grid jpag on jpag.community_code= jg.community_code
+        LEFT JOIN jczz_police_affairs_grid jpag on jp.jw_grid_code= jpag.jw_grid_code
         <where>
             <if test="taskPalce.id != null ">and id = #{taskPalce.id}</if>
             <if test="taskPalce.placeCheckId != null ">and place_check_id = #{taskPalce.placeCheckId}</if>
@@ -256,11 +276,25 @@
             <if test="isAdministrator==2">
                 <choose>
                     <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
-                        and jg.grid_code in
+                        and
+                        (
+                        jg.grid_code in
                         <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
                             #{code}
                         </foreach>
+                        or
+                        jpag.community_code in
+                        <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+                            #{code}
+                        </foreach>
+                        )
                     </when>
+                    <otherwise>
+                        and
+                        (
+                        jg.grid_code in ('') or jpag.community_code in ('')
+                        )
+                    </otherwise>
                 </choose>
             </if>
         </where>

--
Gitblit v1.9.3