From 8b7258c9427882bb1798f1502eaa35184c6e374e Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Fri, 09 Aug 2024 14:29:18 +0800
Subject: [PATCH] 短信指定楼栋发送

---
 src/main/java/org/springblade/modules/community/mapper/CommunityMapper.xml |   61 +++++++++++++++++++++++++++---
 1 files changed, 55 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/springblade/modules/community/mapper/CommunityMapper.xml b/src/main/java/org/springblade/modules/community/mapper/CommunityMapper.xml
index 0b885da..4c67739 100644
--- a/src/main/java/org/springblade/modules/community/mapper/CommunityMapper.xml
+++ b/src/main/java/org/springblade/modules/community/mapper/CommunityMapper.xml
@@ -23,23 +23,72 @@
 
     <!--自定义分页列表查询-->
     <select id="selectCommunityPage" resultType="org.springblade.modules.community.vo.CommunityVO">
-        select * from jczz_community
-        where is_deleted = 0
+        select
+        jc.id,
+        jc.street_code,
+        jc.code,
+        jc.name,
+        jc.pic_url,
+        jc.address,
+        jc.res_police_user_id,
+        jc.lng,
+        jc.lat,
+        jc.remark,
+        br.town_name townName
+        from jczz_community jc
+        left join blade_region br on br.code = jc.code
+        where jc.is_deleted = 0
         <if test="community.name !=null and community.name!=''">
-            and name like concat('%',#{community.name},'%')
+            and jc.name like concat('%',#{community.name},'%')
         </if>
         <if test="community.code !=null and community.code!=''">
-            and code like concat('%',#{community.code},'%')
+            and jc.code like concat('%',#{community.code},'%')
         </if>
         <if test="community.streetCode !=null and community.streetCode!=''">
-            and street_code like concat('%',#{community.streetCode},'%')
+            and jc.street_code like concat('%',#{community.streetCode},'%')
+        </if>
+        <if test="community.townName !=null and community.townName !=''">
+            and br.town_name like concat('%',#{community.townName},'%')
+        </if>
+        <if test="isAdministrator==2">
+            <choose>
+                <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
+                    and jc.code in
+                    <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+                        #{code}
+                    </foreach>
+                </when>
+                <otherwise>
+                    and jc.code in ('')
+                </otherwise>
+            </choose>
         </if>
     </select>
 
     <!--自定义分页列表查询-->
     <select id="getCommunityCodeListByUserId" resultType="java.lang.String">
         select code from jczz_community
-        where is_deleted = 0 and res_police_user_id = #{userId}
+        where is_deleted = 0 and res_police_user_id like concat('%',#{userId},'%')
+    </select>
+
+    <!--自定义分页列表查询-->
+    <select id="getDetail" resultType="org.springblade.modules.community.vo.CommunityVO">
+        select
+        jc.id,
+        jc.street_code,
+        jc.code,
+        jc.name,
+        jc.pic_url,
+        jc.address,
+        jc.res_police_user_id,
+        jc.lng,
+        jc.lat,
+        jc.remark,
+        br.town_name townName
+        from jczz_community jc
+        left join blade_region br on br.code = jc.code
+        where jc.is_deleted = 0
+        and jc.id = #{community.id}
     </select>
 
 

--
Gitblit v1.9.3