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/police/mapper/PoliceAffairsGridMapper.xml | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 57 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/springblade/modules/police/mapper/PoliceAffairsGridMapper.xml b/src/main/java/org/springblade/modules/police/mapper/PoliceAffairsGridMapper.xml
index 114b11e..06ceeed 100644
--- a/src/main/java/org/springblade/modules/police/mapper/PoliceAffairsGridMapper.xml
+++ b/src/main/java/org/springblade/modules/police/mapper/PoliceAffairsGridMapper.xml
@@ -3,7 +3,7 @@
<mapper namespace="org.springblade.modules.police.mapper.PoliceAffairsGridMapper">
<!-- 通用查询映射结果 -->
- <resultMap id="policeAffairsGridResultMap" type="org.springblade.modules.police.entity.PoliceAffairsGridEntity">
+ <resultMap id="policeAffairsGridResultMap" type="org.springblade.modules.police.vo.PoliceAffairsGridVO">
<result column="id" property="id"/>
<result column="object_id" property="objectId"/>
<result column="jws_code" property="jwsCode"/>
@@ -24,14 +24,68 @@
<result column="is_deleted" property="isDeleted"/>
</resultMap>
-
+ <!--自定义分页查询-->
<select id="selectPoliceAffairsGridPage" resultMap="policeAffairsGridResultMap">
select * from jczz_police_affairs_grid where is_deleted = 0
+ <if test="policeAffairsGrid.communityName!=null and policeAffairsGrid.communityName!=''">
+ and community_name like concat('%',#{policeAffairsGrid.communityName},'%')
+ </if>
+ <if test="policeAffairsGrid.jwGridCode!=null and policeAffairsGrid.jwGridCode!=''">
+ and jw_grid_code like concat('%',#{policeAffairsGrid.jwGridCode},'%')
+ </if>
+ <if test="policeAffairsGrid.pcsCode!=null and policeAffairsGrid.pcsCode!=''">
+ and pcs_code like concat('%',#{policeAffairsGrid.pcsCode},'%')
+ </if>
+ <if test="policeAffairsGrid.pcsName!=null and policeAffairsGrid.pcsName!=''">
+ and pcs_name like concat('%',#{policeAffairsGrid.pcsName},'%')
+ </if>
+ <if test="isAdministrator==2">
+ <choose>
+ <when test="policeAffairsGrid.roleName != null and policeAffairsGrid.roleName != ''">
+ <if test="policeAffairsGrid.roleName=='mj'">
+ <choose>
+ <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
+ and community_code in
+ <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+ #{code}
+ </foreach>
+ </when>
+ <otherwise>
+ and community_code in ('')
+ </otherwise>
+ </choose>
+ </if>
+ </when>
+ <otherwise>
+ <choose>
+ <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
+ and community_code in
+ <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+ #{code}
+ </foreach>
+ </when>
+ <otherwise>
+ and community_code in ('')
+ </otherwise>
+ </choose>
+ </otherwise>
+ </choose>
+ </if>
+ order by id desc,pcs_code desc
</select>
<!--判断该点在哪个警务网格-->
<select id="spatialAnalysis" resultType="org.springblade.modules.police.entity.PoliceAffairsGridEntity">
- SELECT * FROM jczz_police_affairs_grid WHERE ST_Intersects(geom, ST_GeomFromText(${point},0))
+ SELECT * FROM jczz_police_affairs_grid
+ WHERE is_deleted = 0
+ and ST_Intersects(geom, ST_GeomFromText(${point},0))
+ </select>
+
+ <!--查询对应的社区编号-->
+ <select id="getCommunityCodeListByUserId" resultType="java.lang.String">
+ SELECT community_code FROM jczz_police_affairs_grid
+ WHERE is_deleted = 0
+ and police_user_id like concat('%',#{userId},'%')
</select>
</mapper>
--
Gitblit v1.9.3