From 4ec472d8828e34fbcfb3990451d059e486b7d5ea Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Wed, 17 Jan 2024 19:32:46 +0800
Subject: [PATCH] 议事管理bug

---
 src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml |   30 ++++++++++++++++++------------
 1 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml b/src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml
index 00a1ac9..f3a918f 100644
--- a/src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml
+++ b/src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml
@@ -828,17 +828,20 @@
             <if test="household.aoiCode!=null and household.aoiCode!=''">
                 and jhs.district_code = #{household.aoiCode}
             </if>
-            AND EXISTS (
-            SELECT
-            *
+            and jh.id in (
+            SELECT DISTINCT
+            juhl.household_id
             FROM
             jczz_user_house_label juhl
             LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
             WHERE
             juhl.lable_type = 1
-            AND jl.id = #{household.labelId}
-            AND jl.parent_id = #{household.parentId}
-            AND juhl.household_id = jh.id
+            <if test="household.labelId != null ">
+                AND jl.id = #{household.labelId}
+            </if>
+            <if test="household.parentId != null ">
+                AND jl.parent_id = #{household.parentId}
+            </if>
             AND juhl.label_id IS NOT NULL
             )
             and jh.is_deleted = 0
@@ -852,9 +855,10 @@
         left join jczz_user_house_label juhl on juhl.household_id = jh.id
         where jh.is_deleted = 0
         and juhl.lable_type = 1
-        and juhl.color = '#30D17C'
+        and juhl.color = 'green'
         and jh.id in (
-        select household_id from jczz_grid_work_log where is_deleted = 0 and source = 2 and TIMESTAMPDIFF( day, now(), create_time )=30
+        select household_id from jczz_grid_work_log where is_deleted = 0 and source = 2 and TIMESTAMPDIFF( day, now(),
+        create_time )=30
         )
         <choose>
             <when test="list!=null and list.size()>0">
@@ -873,9 +877,10 @@
         left join jczz_user_house_label juhl on juhl.household_id = jh.id
         where jh.is_deleted = 0
         and juhl.lable_type = 1
-        and juhl.color = '#FFB42B'
+        and juhl.color = 'yellow'
         and jh.id in (
-        select household_id from jczz_grid_work_log where is_deleted = 0 and source = 2 and TIMESTAMPDIFF( day, now(), create_time )=14
+        select household_id from jczz_grid_work_log where is_deleted = 0 and source = 2 and TIMESTAMPDIFF( day, now(),
+        create_time )=14
         )
         <choose>
             <when test="list!=null and list.size()>0">
@@ -895,9 +900,10 @@
         left join jczz_user_house_label juhl on juhl.household_id = jh.id
         where jh.is_deleted = 0
         and juhl.lable_type = 1
-        and juhl.color = '#EA1F1F'
+        and juhl.color = 'red'
         and jh.id in (
-        select household_id from jczz_grid_work_log where is_deleted = 0 and source = 2 and TIMESTAMPDIFF( day, now(), create_time )=7
+        select household_id from jczz_grid_work_log where is_deleted = 0 and source = 2 and TIMESTAMPDIFF( day, now(),
+        create_time )=7
         )
         <choose>
             <when test="list!=null and list.size()>0">

--
Gitblit v1.9.3