From c9520071522dbd2929f4f8e28ce8b70712a2e5e8 Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Wed, 03 Jan 2024 18:13:44 +0800
Subject: [PATCH] bug修复

---
 src/main/java/org/springblade/modules/task/mapper/TaskMapper.xml |   32 ++++++++++++++++++++------------
 1 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/src/main/java/org/springblade/modules/task/mapper/TaskMapper.xml b/src/main/java/org/springblade/modules/task/mapper/TaskMapper.xml
index 4e1af03..8c46635 100644
--- a/src/main/java/org/springblade/modules/task/mapper/TaskMapper.xml
+++ b/src/main/java/org/springblade/modules/task/mapper/TaskMapper.xml
@@ -22,9 +22,9 @@
 
     <select id="selectTaskPage" resultMap="taskResultMap">
         SELECT
-        IFNULL(jda.address_name,jp.location)address_name ,
+        IFNULL( jda.address_name, jp.location ) address_name,
         jt.id,
-        jt.name,
+        jt.NAME,
         jt.type,
         jt.frequency,
         jt.remark,
@@ -32,26 +32,33 @@
         jt.create_user,
         jt.update_time,
         jt.update_user,
-        jt.status,
+        jt.STATUS,
         jt.tenant_id,
         jt.create_dept,
         jt.is_deleted,
         jt.house_code,
         jt.report_type
         FROM
-        jczz_gridman jgm
-        LEFT JOIN jczz_grid jg ON jgm.grid_id = jg.id
-        LEFT JOIN jczz_grid_range jgr ON jg.id = jgr.grid_id
-        LEFT JOIN jczz_task jt ON jgr.house_code = jt.house_code
+        jczz_task jt
         LEFT JOIN jczz_doorplate_address jda ON jda.address_code = jt.house_code
-        LEFT JOIN jczz_place jp on jp.house_code=jgr.house_code
+        LEFT JOIN jczz_place jp ON jp.house_code = jt.house_code
         <where>
             <if test="task.userId != null and task.userId != ''">
-                and jgm.user_id = #{task.userId}
+                AND jt.house_code IN (
+                SELECT
+                jgr.house_code
+                FROM
+                jczz_grid_range jgr
+                LEFT JOIN jczz_grid jg ON jg.id = jgr.grid_id
+                LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id
+                WHERE
+                jg.is_deleted = 0
+                <if test="task.communityCode != null and task.communityCode != ''">
+                    and jg.community_code = #{task.communityCode}
+                </if>
+                AND jgm.user_id = #{task.userId} )
             </if>
-            <if test="task.communityCode != null and task.communityCode != ''">
-                and jg.community_code = #{task.communityCode}
-            </if>
+
             <if test="task.status != null and task.status != null">
                 and jt.status = #{task.status}
             </if>
@@ -86,6 +93,7 @@
             <if test="task.reportType == null">
                 and jt.report_type in (2,3,4,5,6)
             </if>
+            and jt.is_deleted = 0
             order by jt.create_time desc
         </where>
     </select>

--
Gitblit v1.9.3