From 4ffbdb32186834f49f7a47b242381be4e7d894ed Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Thu, 22 Feb 2024 17:39:28 +0800
Subject: [PATCH] 投票人员查询优化

---
 src/main/java/org/springblade/modules/article/mapper/ArticleMapper.xml |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/springblade/modules/article/mapper/ArticleMapper.xml b/src/main/java/org/springblade/modules/article/mapper/ArticleMapper.xml
index 3428813..a1e9ed4 100644
--- a/src/main/java/org/springblade/modules/article/mapper/ArticleMapper.xml
+++ b/src/main/java/org/springblade/modules/article/mapper/ArticleMapper.xml
@@ -115,6 +115,12 @@
                 and (ja.article_range like concat('%',#{article.districtId},'%')
                 or ja.article_range is null)
             </if>
+
+            <if test="article.userId != null">
+                and (jpd.appoint_user like concat('%',#{article.userId},'%')
+                or ja.appoint_user is null)
+            </if>
+
             <if test="article.building != null and article.building != ''">
                 and (ja.building = #{article.building}
                 or ja.building is null)
@@ -193,7 +199,6 @@
         where 1=1
         and ja.is_deleted = 0
         <if test="article.propertyFlag!=null ">
-            and ja.district_id IS NOT NULL
             <if test="article.communityName!=null and article.communityName!=''">
                 and br.`village_name` like concat('%',#{article.communityName},'%')
             </if>
@@ -233,10 +238,10 @@
             <foreach collection="article.districtIdList" separator=" or article_range like" item="id">'%${id}%'
             </foreach>
             )
-            and ja.district_id in
-            <foreach collection="article.districtIdList" index="index" item="item" open="(" separator="," close=")">
-                #{item}
-            </foreach>
+<!--            and ja.district_id in-->
+<!--            <foreach collection="article.districtIdList" index="index" item="item" open="(" separator="," close=")">-->
+<!--                #{item}-->
+<!--            </foreach>-->
         </if>
         order by ja.create_time desc
     </select>

--
Gitblit v1.9.3