From 8a881a2c54673d4223425f17bc5cae8eef4e5649 Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Fri, 22 Mar 2024 17:26:43 +0800
Subject: [PATCH] 反诈宣传和反诈预警查询调整
---
src/main/java/org/springblade/modules/backblast/mapper/BackblastPubRecordMapper.xml | 150 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 148 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/springblade/modules/backblast/mapper/BackblastPubRecordMapper.xml b/src/main/java/org/springblade/modules/backblast/mapper/BackblastPubRecordMapper.xml
index 7ce55f1..b3af5dd 100644
--- a/src/main/java/org/springblade/modules/backblast/mapper/BackblastPubRecordMapper.xml
+++ b/src/main/java/org/springblade/modules/backblast/mapper/BackblastPubRecordMapper.xml
@@ -6,9 +6,155 @@
<resultMap id="backblastPubRecordResultMap" type="org.springblade.modules.backblast.vo.BackblastPubRecordVO">
</resultMap>
-
+ <!--自定义分页列表查询-->
<select id="selectBackblastPubRecordPage" resultMap="backblastPubRecordResultMap">
- select * from jczz_backblast_pub_record where is_deleted = 0
+ select
+ jbpr.*,
+ br.town_name as townName,
+ br.name as communityName,
+ jpag.pcs_name pcsName
+ from jczz_backblast_pub_record jbpr
+ LEFT JOIN jczz_grid jg on jg.grid_code = jbpr.grid_code and jg.is_deleted = 0
+ LEFT JOIN jczz_police_affairs_grid jpag on jbpr.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0
+ LEFT JOIN blade_region br on br.code = jpag.community_code
+ where jbpr.is_deleted = 0
+ <if test="backblastPubRecord.townName != null and backblastPubRecord.townName != ''">
+ and br.town_name like concat('%',#{backblastPubRecord.townName},'%')
+ </if>
+ <if test="backblastPubRecord.communityName != null and backblastPubRecord.communityName != ''">
+ and jbr.name like concat('%',#{backblastPubRecord.communityName},'%')
+ </if>
+ <if test="backblastPubRecord.pcsName != null and backblastPubRecord.pcsName != ''">
+ and jpag.pcs_name like concat('%',#{backblastPubRecord.pcsName},'%')
+ </if>
+ <if test="backblastPubRecord.houseCode != null and backblastPubRecord.houseCode != ''">
+ and jbpr.house_code = #{backblastPubRecord.houseCode}
+ </if>
+ <if test="backblastPubRecord.address != null and backblastPubRecord.address != ''">
+ and jbpr.address like concat('%',#{backblastPubRecord.address},'%')
+ </if>
+ <if test="backblastPubRecord.pubContent != null and backblastPubRecord.pubContent != ''">
+ and jbpr.pub_content like concat('%',#{backblastPubRecord.pubContent},'%')
+ </if>
+ <if test="backblastPubRecord.policeman != null and backblastPubRecord.policeman != ''">
+ and jbpr.policeman like concat('%',#{backblastPubRecord.policeman},'%')
+ </if>
+ <if test="backblastPubRecord.policemanPhone != null and backblastPubRecord.policemanPhone != ''">
+ and jbpr.policeman_phone like concat('%',#{backblastPubRecord.policemanPhone},'%')
+ </if>
+ <if test="backblastPubRecord.startTime != null and backblastPubRecord.startTime != ''">
+ and date_format(jbpr.create_time,'%Y-%m-%d') >= #{backblastPubRecord.startTime}
+ </if>
+ <if test="backblastPubRecord.endTime != null and backblastPubRecord.endTime != ''">
+ and date_format(jbpr.create_time,'%Y-%m-%d') <= #{backblastPubRecord.endTime}
+ </if>
+ <if test="backblastPubRecord.searchKey!=null and backblastPubRecord.searchKey!=''">
+ and CONCAT(
+ ifnull(jbpr.policeman_phone,''),
+ ifnull(jbpr.address,''),
+ ifnull(jbpr.pub_content,''),
+ ifnull(jbpr.policeman,'')
+ ) like CONCAT ('%', #{backblastPubRecord.searchKey},'%')
+ </if>
+ <if test="isAdministrator==2">
+ <choose>
+ <when test="backblastPubRecord.roleName != null and backblastPubRecord.roleName != ''">
+ <if test="backblastPubRecord.roleName=='wgy'">
+ <choose>
+ <when test="gridCodeList !=null and gridCodeList.size()>0">
+ and jg.grid_code in
+ <foreach collection="gridCodeList" item="code" open="(" close=")" separator=",">
+ #{code}
+ </foreach>
+ </when>
+ <otherwise>
+ and jg.grid_code in ('')
+ </otherwise>
+ </choose>
+ </if>
+ <if test="backblastPubRecord.roleName=='mj'">
+ <choose>
+ <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
+ and jpag.community_code in
+ <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+ #{code}
+ </foreach>
+ </when>
+ <otherwise>
+ and jpag.community_code in ('')
+ </otherwise>
+ </choose>
+ </if>
+ </when>
+ <otherwise>
+ <choose>
+ <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
+ and
+ (
+ jg.grid_code in
+ <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+ #{code}
+ </foreach>
+ or
+ jpag.community_code in
+ <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+ #{code}
+ </foreach>
+ )
+ </when>
+ <otherwise>
+ and
+ (
+ jg.grid_code in ('') or jpag.community_code in ('')
+ )
+ </otherwise>
+ </choose>
+ </otherwise>
+ </choose>
+ </if>
+ order by jbpr.id desc,jbpr.create_time desc
+ </select>
+
+ <!--反炸宣传记录表 自定义详情-->
+ <select id="getDetail" resultType="org.springblade.modules.backblast.vo.BackblastPubRecordVO">
+ select
+ jbpr.*,
+ br.town_name as townName,
+ br.name as communityName,
+ jpag.pcs_name pcsName
+ from jczz_backblast_pub_record jbpr
+ LEFT JOIN jczz_grid jg on jg.grid_code = jbpr.grid_code and jg.is_deleted = 0
+ LEFT JOIN jczz_police_affairs_grid jpag on jbpr.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0
+ LEFT JOIN blade_region br on br.code = jpag.community_code
+ where jbpr.is_deleted = 0
+ <if test="backblastPubRecord.id != null">
+ and jbpr.id = #{backblastPubRecord.id}
+ </if>
+ <if test="backblastPubRecord.townName != null and backblastPubRecord.townName != ''">
+ and br.town_name like concat('%',#{backblastPubRecord.townName},'%')
+ </if>
+ <if test="backblastPubRecord.communityName != null and backblastPubRecord.communityName != ''">
+ and jbr.name like concat('%',#{backblastPubRecord.communityName},'%')
+ </if>
+ <if test="backblastPubRecord.pcsName != null and backblastPubRecord.pcsName != ''">
+ and jpag.pcs_name like concat('%',#{backblastPubRecord.pcsName},'%')
+ </if>
+ <if test="backblastPubRecord.houseCode != null and backblastPubRecord.houseCode != ''">
+ and jbpr.house_code = #{backblastPubRecord.houseCode}
+ </if>
+ <if test="backblastPubRecord.address != null and backblastPubRecord.address != ''">
+ and jbpr.address like concat('%',#{backblastPubRecord.address},'%')
+ </if>
+ <if test="backblastPubRecord.pubContent != null and backblastPubRecord.pubContent != ''">
+ and jbpr.pub_content like concat('%',#{backblastPubRecord.pubContent},'%')
+ </if>
+ <if test="backblastPubRecord.policeman != null and backblastPubRecord.policeman != ''">
+ and jbpr.policeman like concat('%',#{backblastPubRecord.policeman},'%')
+ </if>
+ <if test="backblastPubRecord.policemanPhone != null and backblastPubRecord.policemanPhone != ''">
+ and jbpr.policeman_phone like concat('%',#{backblastPubRecord.policemanPhone},'%')
+ </if>
+ order by jbpr.id desc,jbpr.create_time desc
</select>
--
Gitblit v1.9.3