From 97ad7e7702c7dbcef19d8fc05b23b7357670c6d7 Mon Sep 17 00:00:00 2001
From: lin <sbla5888@163.com>
Date: Thu, 29 Feb 2024 13:26:57 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/main/java/org/springblade/modules/task/mapper/TaskReportForRepairsMapper.xml |   75 ++++++++++++++++++++++---------------
 1 files changed, 45 insertions(+), 30 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 7e42e37..3537c8e 100644
--- a/src/main/java/org/springblade/modules/task/mapper/TaskReportForRepairsMapper.xml
+++ b/src/main/java/org/springblade/modules/task/mapper/TaskReportForRepairsMapper.xml
@@ -41,6 +41,7 @@
         <result property="lat" column="lat"/>
         <result property="address" column="address"/>
         <result property="viewType" column="view_type"/>
+        <result property="houseFlag" column="house_flag"/>
 
 
         <collection property="taskRepairStepList" column="id" select="selectTaskRepairStepList"
@@ -122,7 +123,8 @@
                lng,
                lat,
                address,
-               view_type
+               view_type,
+               house_flag
         from jczz_task_report_for_repairs
     </sql>
 
@@ -152,6 +154,7 @@
         jtrfr.lat,
         jtrfr.address,
         jtrfr.view_type,
+        jtrfr.house_flag,
         br.town_name streetName,
         jg.grid_name,
         jda.aoi_name,
@@ -208,24 +211,48 @@
             AND jtrfr.create_time BETWEEN #{vo.startTime} and #{vo.endTime}
         </if>
         <if test="isAdministrator==2">
-            <choose>
-                <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
-                    and jg.grid_code in
-                    <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
-                        #{code}
+            <!-- 物业和居民 -->
+            <if test="vo.roleType !=null and (vo.roleType == 'wy' or vo.roleType == 'inhabitant')">
+                <if test="aoiCodeList!=null and aoiCodeList.size()>0">
+                    and jda.aoi_code in
+                    <foreach collection="aoiCodeList" item="item" separator="," open="(" close=")">
+                        #{item}
                     </foreach>
-                </when>
-            </choose>
+                </if>
+
+                <if test="vo.roleType == 'wy' and vo.confirmUserId != null ">
+                    and jtrfr.confirm_user_id = #{vo.confirmUserId}
+                </if>
+            </if>
+            <!-- 网格员及其他 -->
+            <if test="vo.roleType ==null">
+                <choose>
+                    <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
+                        and jg.grid_code in
+                        <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+                            #{code}
+                        </foreach>
+                    </when>
+                </choose>
+
+                <choose>
+                    <when test="gridCodeList !=null and gridCodeList.size()>0">
+                        and jg.grid_code in
+                        <foreach collection="gridCodeList" item="code" open="(" close=")" separator=",">
+                            #{code}
+                        </foreach>
+                    </when>
+                    <otherwise>
+                        and jg.grid_code in ('')
+                    </otherwise>
+                </choose>
+
+                <if test="vo.confirmUserId != null ">
+                    and jtrfr.confirm_user_id = #{vo.confirmUserId}
+                </if>
+
+            </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>
 
@@ -287,19 +314,7 @@
         <if test="houseCode != null and houseCode != ''">
             and jtrfr.address_code = #{houseCode}
         </if>
-        <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