From 19c0886badef2cb971b8bfd3d5eadea3cbe74bc4 Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Fri, 26 Jan 2024 18:00:23 +0800
Subject: [PATCH] 区域过滤去除上饶市

---
 src/main/java/org/springblade/modules/task/mapper/TaskReportForRepairsMapper.xml |   42 +++++++++++++++++++++++++++++++++---------
 1 files changed, 33 insertions(+), 9 deletions(-)

diff --git a/src/main/java/org/springblade/modules/task/mapper/TaskReportForRepairsMapper.xml b/src/main/java/org/springblade/modules/task/mapper/TaskReportForRepairsMapper.xml
index 87b7aff..32bbdde 100644
--- a/src/main/java/org/springblade/modules/task/mapper/TaskReportForRepairsMapper.xml
+++ b/src/main/java/org/springblade/modules/task/mapper/TaskReportForRepairsMapper.xml
@@ -187,8 +187,15 @@
         <if test="vo.startTime != null and vo.startTime != '' and vo.endTime != null and vo.endTime != '' ">
             AND jtrfr.create_time BETWEEN #{vo.startTime} and #{vo.endTime}
         </if>
-        <if test="vo.regionCode != null and vo.regionCode !='' ">
-            and jg.community_code like concat(#{vo.regionCode},'%')
+        <if test="isAdministrator==2">
+            <choose>
+                <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
+                    and jg.community_code in
+                    <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+                        #{code}
+                    </foreach>
+                </when>
+            </choose>
         </if>
         <if test="vo.roleName!=null and vo.roleName!=''">
             <if test="vo.roleName=='网格员'">
@@ -207,6 +214,14 @@
                 </choose>
             </if>
         </if>
+
+        <if test="aoiCodeList!=null and aoiCodeList.size()>0">
+            and jda.aoi_code in
+            <foreach collection="aoiCodeList" item="item" separator="," open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+
         ORDER BY jtrfr.create_time DESC
     </select>
 
@@ -248,14 +263,14 @@
             jczz_doorplate_address jda
             LEFT JOIN jczz_community jc ON jc.CODE = jda.nei_code
             WHERE
-            jc.res_police_user_id = #{userId})
+            jc.res_police_user_id like concat('%',#{userId},'%'))
             )
         </if>
     </select>
 
 
     <select id="getStatisticsCount" resultType="org.springblade.modules.task.vo.TaskReportStatistics">
-        ELECT
+        SELECT
         count( 1 ) AS total,
         ifnull( sum( CASE WHEN STATUS = 10 THEN 1 ELSE 0 END ), 0 ) AS handle
         FROM
@@ -263,14 +278,23 @@
         LEFT JOIN jczz_doorplate_address jda ON jda.address_code = jtrfr.address_code
         WHERE is_deleted = 0
         <if test="userId != null">
-            and create_user = #{userId}
-
+            and jtrfr.create_user = #{userId}
         </if>
         <if test="houseCode != null and houseCode != ''">
-            and address_code = #{houseCode}
+            and jtrfr.address_code = #{houseCode}
         </if>
-        <if test="neiCode != null and neiCode != ''">
-            AND jda.nei_code LIKE concat( #{neiCode}, '%' )
+        <if test="isAdministrator==2">
+            <choose>
+                <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
+                    and jda.nei_code in
+                    <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+                        #{code}
+                    </foreach>
+                </when>
+                <otherwise>
+                    and jda.nei_code in ('')
+                </otherwise>
+            </choose>
         </if>
     </select>
 

--
Gitblit v1.9.3