| | |
| | | <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> |
| | | |
| | | |