| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.springblade.modules.disputeRecord.mapper.DisputeRecordMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="disputeRecordResultMap" type="org.springblade.modules.disputeRecord.vo.DisputeRecordVO"> |
| | | <result column="id" property="id"/> |
| | | <result column="address" property="address"/> |
| | | <result column="lng" property="lng"/> |
| | | <result column="lat" property="lat"/> |
| | | <result column="name_one" property="nameOne"/> |
| | | <result column="phone_one" property="phoneOne"/> |
| | | <result column="id_card_one" property="idCardOne"/> |
| | | <result column="name_two" property="nameTwo"/> |
| | | <result column="phone_two" property="phoneTwo"/> |
| | | <result column="id_card_two" property="idCardTwo"/> |
| | | <result column="dispute_type" property="disputeType"/> |
| | | <result column="dispute_content" property="disputeContent"/> |
| | | <result column="injury_flag" property="injuryFlag"/> |
| | | <result column="injury_desc" property="injuryDesc"/> |
| | | <result column="alarm_num" property="alarmNum"/> |
| | | <result column="source" property="source"/> |
| | | <result column="handle_result" property="handleResult"/> |
| | | <result column="grid_code" property="gridCode"/> |
| | | <result column="jw_grid_code" property="jwGridCode"/> |
| | | <result column="create_user" property="createUser"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_user" property="updateUser"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | </resultMap> |
| | | |
| | | <!--自定列表分页查询--> |
| | | <select id="selectDisputeRecordPage" resultMap="disputeRecordResultMap"> |
| | | select |
| | | jdr.*, |
| | | br.town_name as townName, |
| | | br.name as communityName, |
| | | jpag.pcs_name pcsName |
| | | from jczz_dispute_record jdr |
| | | LEFT JOIN jczz_grid jg on jg.grid_code = jdr.grid_code and jg.is_deleted = 0 |
| | | LEFT JOIN jczz_police_affairs_grid jpag on jdr.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0 |
| | | LEFT JOIN blade_region br on br.code = jpag.community_code |
| | | where jdr.is_deleted = 0 |
| | | <if test="disputeRecord.disputeType != null"> |
| | | and jdr.dispute_type = #{disputeRecord.disputeType} |
| | | </if> |
| | | <if test="disputeRecord.injuryFlag != null"> |
| | | and jdr.injury_flag = #{disputeRecord.injuryFlag} |
| | | </if> |
| | | <if test="disputeRecord.source != null"> |
| | | and jdr.source = #{disputeRecord.source} |
| | | </if> |
| | | <if test="disputeRecord.townName != null and disputeRecord.townName != ''"> |
| | | and br.town_name like concat('%',#{disputeRecord.townName},'%') |
| | | </if> |
| | | <if test="disputeRecord.communityName != null and disputeRecord.communityName != ''"> |
| | | and jbr.name like concat('%',#{disputeRecord.communityName},'%') |
| | | </if> |
| | | <if test="disputeRecord.pcsName != null and disputeRecord.pcsName != ''"> |
| | | and jpag.pcs_name like concat('%',#{disputeRecord.pcsName},'%') |
| | | </if> |
| | | <if test="disputeRecord.address != null and disputeRecord.address != ''"> |
| | | and jdr.address like concat('%',#{disputeRecord.address},'%') |
| | | </if> |
| | | <if test="disputeRecord.disputeContent != null and disputeRecord.disputeContent != ''"> |
| | | and jdr.dispute_content like concat('%',#{disputeRecord.disputeContent},'%') |
| | | </if> |
| | | <if test="disputeRecord.nameOne != null and disputeRecord.nameOne != ''"> |
| | | and jdr.name_one like concat('%',#{disputeRecord.nameOne},'%') |
| | | </if> |
| | | <if test="disputeRecord.phoneOne != null and disputeRecord.phoneOne != ''"> |
| | | and jdr.phone_one like concat('%',#{disputeRecord.phoneOne},'%') |
| | | </if> |
| | | <if test="disputeRecord.idCardOne != null and disputeRecord.idCardOne != ''"> |
| | | and jdr.id_card_one like concat('%',#{disputeRecord.idCardOne},'%') |
| | | </if> |
| | | <if test="disputeRecord.nameTwo != null and disputeRecord.nameTwo != ''"> |
| | | and jdr.name_two like concat('%',#{disputeRecord.nameTwo},'%') |
| | | </if> |
| | | <if test="disputeRecord.phoneTwo != null and disputeRecord.phoneTwo != ''"> |
| | | and jdr.phone_two like concat('%',#{disputeRecord.phoneOne},'%') |
| | | </if> |
| | | <if test="disputeRecord.idCardTwo != null and disputeRecord.idCardTwo != ''"> |
| | | and jdr.id_card_two like concat('%',#{disputeRecord.idCardTwo},'%') |
| | | </if> |
| | | <if test="disputeRecord.startTime != null and disputeRecord.startTime != ''"> |
| | | and date_format(jdr.event_time,'%Y-%m-%d') >= #{disputeRecord.startTime} |
| | | </if> |
| | | <if test="disputeRecord.endTime != null and disputeRecord.endTime != ''"> |
| | | and date_format(jdr.event_time,'%Y-%m-%d') <= #{disputeRecord.endTime} |
| | | </if> |
| | | <if test="disputeRecord.searchKey!=null and disputeRecord.searchKey!=''"> |
| | | and CONCAT( |
| | | ifnull(jdr.name_one,''), |
| | | ifnull(jdr.phone_one,''), |
| | | ifnull(jdr.name_two,''), |
| | | ifnull(jdr.phone_two,''), |
| | | ifnull(jdr.address,''), |
| | | ifnull(jdr.dispute_content,'') |
| | | ) like CONCAT ('%', #{disputeRecord.searchKey},'%') |
| | | </if> |
| | | <if test="isAdministrator==2"> |
| | | <choose> |
| | | <when test="disputeRecord.roleName != null and disputeRecord.roleName != ''"> |
| | | <if test="disputeRecord.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="disputeRecord.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 jdr.id desc,jdr.create_time desc |
| | | </select> |
| | | |
| | | <!--自定列表分页查询--> |
| | | <select id="getDetail" resultType="org.springblade.modules.disputeRecord.vo.DisputeRecordVO"> |
| | | select |
| | | jdr.*, |
| | | br.town_name as townName, |
| | | br.name as communityName, |
| | | jpag.pcs_name pcsName |
| | | from jczz_dispute_record jdr |
| | | LEFT JOIN jczz_grid jg on jg.grid_code = jdr.grid_code and jg.is_deleted = 0 |
| | | LEFT JOIN jczz_police_affairs_grid jpag on jdr.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0 |
| | | LEFT JOIN blade_region br on br.code = jpag.community_code |
| | | where jdr.is_deleted = 0 |
| | | <if test="disputeRecord.id != null"> |
| | | and jdr.id = #{disputeRecord.id} |
| | | </if> |
| | | <if test="disputeRecord.disputeType != null"> |
| | | and jdr.dispute_type = #{disputeRecord.disputeType} |
| | | </if> |
| | | <if test="disputeRecord.injuryFlag != null"> |
| | | and jdr.injury_flag = #{disputeRecord.injuryFlag} |
| | | </if> |
| | | <if test="disputeRecord.source != null"> |
| | | and jdr.source = #{disputeRecord.source} |
| | | </if> |
| | | <if test="disputeRecord.handleResult != null"> |
| | | and jdr.handle_result = #{disputeRecord.handleResult} |
| | | </if> |
| | | <if test="disputeRecord.townName != null and disputeRecord.townName != ''"> |
| | | and br.town_name like concat('%',#{disputeRecord.townName},'%') |
| | | </if> |
| | | <if test="disputeRecord.communityName != null and disputeRecord.communityName != ''"> |
| | | and jbr.name like concat('%',#{disputeRecord.communityName},'%') |
| | | </if> |
| | | <if test="disputeRecord.pcsName != null and disputeRecord.pcsName != ''"> |
| | | and jpag.pcs_name like concat('%',#{disputeRecord.pcsName},'%') |
| | | </if> |
| | | <if test="disputeRecord.address != null and disputeRecord.address != ''"> |
| | | and jdr.address like concat('%',#{disputeRecord.address},'%') |
| | | </if> |
| | | <if test="disputeRecord.disputeContent != null and disputeRecord.disputeContent != ''"> |
| | | and jdr.dispute_content like concat('%',#{disputeRecord.disputeContent},'%') |
| | | </if> |
| | | <if test="disputeRecord.nameOne != null and disputeRecord.nameOne != ''"> |
| | | and jdr.name_one like concat('%',#{disputeRecord.nameOne},'%') |
| | | </if> |
| | | <if test="disputeRecord.phoneOne != null and disputeRecord.phoneOne != ''"> |
| | | and jdr.phone_one like concat('%',#{disputeRecord.phoneOne},'%') |
| | | </if> |
| | | <if test="disputeRecord.idCardOne != null and disputeRecord.idCardOne != ''"> |
| | | and jdr.id_card_one like concat('%',#{disputeRecord.idCardOne},'%') |
| | | </if> |
| | | <if test="disputeRecord.nameTwo != null and disputeRecord.nameTwo != ''"> |
| | | and jdr.name_two like concat('%',#{disputeRecord.nameTwo},'%') |
| | | </if> |
| | | <if test="disputeRecord.phoneTwo != null and disputeRecord.phoneTwo != ''"> |
| | | and jdr.phone_two like concat('%',#{disputeRecord.phoneOne},'%') |
| | | </if> |
| | | <if test="disputeRecord.idCardTwo != null and disputeRecord.idCardTwo != ''"> |
| | | and jdr.id_card_two like concat('%',#{disputeRecord.idCardTwo},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | <!--导出矛盾纠纷记录表--> |
| | | <select id="exportDisputeRecordList" resultType="org.springblade.modules.disputeRecord.excel.ExportDisputeRecordExcel"> |
| | | select |
| | | jdr.address, |
| | | jdr.event_time, |
| | | jdr.name_one, |
| | | case when jdr.gender_one =1 then '男' |
| | | when jdr.gender_one=2 then '女' |
| | | end as gender_one, |
| | | jdr.phone_one, |
| | | jdr.id_card_one, |
| | | jdr.name_two, |
| | | case when jdr.gender_two =1 then '男' |
| | | when jdr.gender_two=2 then '女' |
| | | end as gender_two, |
| | | jdr.phone_two, |
| | | jdr.id_card_two, |
| | | jdr.dispute_type, |
| | | jdr.dispute_content, |
| | | case when jdr.injury_flag=1 then '是' |
| | | when jdr.injury_flag=0 then '否' |
| | | end as injury_flag, |
| | | jdr.injury_desc, |
| | | jdr.alarm_num, |
| | | jdr.source, |
| | | case when jdr.handle_result=1 then '已化解' |
| | | when jdr.handle_result=2 then '未化解' |
| | | when jdr.handle_result=3 then '移送e呼即办' |
| | | end as handle_result, |
| | | br.town_name as townName, |
| | | br.name as communityName, |
| | | jpag.pcs_name pcsName |
| | | from jczz_dispute_record jdr |
| | | LEFT JOIN jczz_grid jg on jg.grid_code = jdr.grid_code and jg.is_deleted = 0 |
| | | LEFT JOIN jczz_police_affairs_grid jpag on jdr.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0 |
| | | LEFT JOIN blade_region br on br.code = jpag.community_code |
| | | where jdr.is_deleted = 0 |
| | | <if test="disputeRecord.disputeType != null"> |
| | | and jdr.dispute_type = #{disputeRecord.disputeType} |
| | | </if> |
| | | <if test="disputeRecord.injuryFlag != null"> |
| | | and jdr.injury_flag = #{disputeRecord.injuryFlag} |
| | | </if> |
| | | <if test="disputeRecord.source != null"> |
| | | and jdr.source = #{disputeRecord.source} |
| | | </if> |
| | | <if test="disputeRecord.townName != null and disputeRecord.townName != ''"> |
| | | and br.town_name like concat('%',#{disputeRecord.townName},'%') |
| | | </if> |
| | | <if test="disputeRecord.communityName != null and disputeRecord.communityName != ''"> |
| | | and jbr.name like concat('%',#{disputeRecord.communityName},'%') |
| | | </if> |
| | | <if test="disputeRecord.pcsName != null and disputeRecord.pcsName != ''"> |
| | | and jpag.pcs_name like concat('%',#{disputeRecord.pcsName},'%') |
| | | </if> |
| | | <if test="disputeRecord.address != null and disputeRecord.address != ''"> |
| | | and jdr.address like concat('%',#{disputeRecord.address},'%') |
| | | </if> |
| | | <if test="disputeRecord.disputeContent != null and disputeRecord.disputeContent != ''"> |
| | | and jdr.dispute_content like concat('%',#{disputeRecord.disputeContent},'%') |
| | | </if> |
| | | <if test="disputeRecord.nameOne != null and disputeRecord.nameOne != ''"> |
| | | and jdr.name_one like concat('%',#{disputeRecord.nameOne},'%') |
| | | </if> |
| | | <if test="disputeRecord.phoneOne != null and disputeRecord.phoneOne != ''"> |
| | | and jdr.phone_one like concat('%',#{disputeRecord.phoneOne},'%') |
| | | </if> |
| | | <if test="disputeRecord.idCardOne != null and disputeRecord.idCardOne != ''"> |
| | | and jdr.id_card_one like concat('%',#{disputeRecord.idCardOne},'%') |
| | | </if> |
| | | <if test="disputeRecord.nameTwo != null and disputeRecord.nameTwo != ''"> |
| | | and jdr.name_two like concat('%',#{disputeRecord.nameTwo},'%') |
| | | </if> |
| | | <if test="disputeRecord.phoneTwo != null and disputeRecord.phoneTwo != ''"> |
| | | and jdr.phone_two like concat('%',#{disputeRecord.phoneOne},'%') |
| | | </if> |
| | | <if test="disputeRecord.idCardTwo != null and disputeRecord.idCardTwo != ''"> |
| | | and jdr.id_card_two like concat('%',#{disputeRecord.idCardTwo},'%') |
| | | </if> |
| | | <if test="disputeRecord.startTime != null and disputeRecord.startTime != ''"> |
| | | and date_format(jdr.event_time,'%Y-%m-%d') >= #{disputeRecord.startTime} |
| | | </if> |
| | | <if test="disputeRecord.endTime != null and disputeRecord.endTime != ''"> |
| | | and date_format(jdr.event_time,'%Y-%m-%d') <= #{disputeRecord.endTime} |
| | | </if> |
| | | <if test="disputeRecord.searchKey!=null and disputeRecord.searchKey!=''"> |
| | | and CONCAT( |
| | | ifnull(jdr.name_one,''), |
| | | ifnull(jdr.phone_one,''), |
| | | ifnull(jdr.name_two,''), |
| | | ifnull(jdr.phone_two,''), |
| | | ifnull(jdr.address,''), |
| | | ifnull(jdr.dispute_content,'') |
| | | ) like CONCAT ('%', #{disputeRecord.searchKey},'%') |
| | | </if> |
| | | <if test="isAdministrator==2"> |
| | | <choose> |
| | | <when test="disputeRecord.roleName != null and disputeRecord.roleName != ''"> |
| | | <if test="disputeRecord.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="disputeRecord.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 jdr.id desc,jdr.create_time desc |
| | | </select> |
| | | |
| | | </mapper> |