数字督察一体化平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

432 lines
18 KiB

<?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="com.biutag.supervision.mapper.ComplaintCollectionMapper">
<!-- 批量插入:全字段 -->
<insert id="insertBatch" parameterType="java.util.List">
INSERT INTO complaint_collection (
id,
source_table,
origin_id,
discovery_time,
responder_name,
responder_phone,
business_type_name,
thing_desc,
involved_issue,
second_depart_name,
third_depart_name,
involve_problem,
distribution_state,
second_depart_id,
third_depart_id,
problem_sources_code,
problem_sources,
police_type_name,
channel_for_filing_complaints,
acceptance_level,
initial_petition,
entanglement_visits,
mass_visits,
police_type,
responder_id_code,
people_number,
appeal,
business_class,
register_depart_name,
transfer_depart,
handle_method,
handle_depart_name,
completed_time,
involve_depart_name,
receiving_leader_name,
is_mian_responsib,
receiving_depart_name,
negative_id,
petition_type,
petition_processing_status,
happen_time,
is_real,
source,
creator,
source_involve_depart_name,
outer_id,
crx_state,
business_type_code,
check_status,
check_status_name,
check_status_desc,
processing_status,
accountability_target,
crt_time,
gwf1, gwf2, gwf3, gwf4, gwf5,
create_by,
create_time,
update_by,
update_time,
delete_flag
)
VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.id},
#{item.sourceTable},
#{item.originId},
#{item.discoveryTime},
#{item.responderName},
#{item.responderPhone},
#{item.businessTypeName},
#{item.thingDesc},
#{item.involvedIssue},
#{item.secondDepartName},
#{item.thirdDepartName},
#{item.involveProblem},
#{item.distributionState},
#{item.secondDepartId},
#{item.thirdDepartId},
#{item.problemSourcesCode},
#{item.problemSources},
#{item.policeTypeName},
#{item.channelForFilingComplaints},
#{item.acceptanceLevel},
#{item.initialPetition},
#{item.entanglementVisits},
#{item.massVisits},
#{item.policeType},
#{item.responderIdCode},
#{item.peopleNumber},
#{item.appeal},
#{item.businessClass},
#{item.registerDepartName},
#{item.transferDepart},
#{item.handleMethod},
#{item.handleDepartName},
#{item.completedTime},
#{item.involveDepartName},
#{item.receivingLeaderName},
#{item.isMianResponsib},
#{item.receivingDepartName},
#{item.negativeId},
#{item.petitionType},
#{item.petitionProcessingStatus},
#{item.happenTime},
#{item.isReal},
#{item.source},
#{item.creator},
#{item.sourceInvolveDepartName},
#{item.outerId},
#{item.crxState},
#{item.businessTypeCode},
#{item.checkStatus},
#{item.checkStatusName},
#{item.checkStatusDesc},
#{item.processingStatus},
#{item.accountabilityTarget},
#{item.crtTime},
#{item.gwf1}, #{item.gwf2}, #{item.gwf3}, #{item.gwf4}, #{item.gwf5},
#{item.createBy},
#{item.createTime},
#{item.updateBy},
#{item.updateTime},
#{item.deleteFlag}
)
</foreach>
</insert>
<select id="selectPageWithConditions" resultType="com.biutag.supervision.pojo.entity.ComplaintCollection">
SELECT
complaint_collection.*
FROM complaint_collection
<where>
<if test="param.sourceTable != null and param.sourceTable != ''">
AND source_table = #{param.sourceTable}
</if>
<if test="param.sourceTableList != null and param.sourceTableList.size > 0">
AND source_table IN
<foreach collection="param.sourceTableList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.sourceTableSubOne != null and param.sourceTableSubOne != ''">
AND source_table_sub_one = #{param.sourceTableSubOne}
</if>
<if test="param.sourceTableSubOneList != null and param.sourceTableSubOneList.size > 0">
AND source_table_sub_one IN
<foreach collection="param.sourceTableSubOneList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.originId != null and param.originId != ''">
AND origin_id LIKE CONCAT('%', #{param.originId}, '%')
</if>
<if test="param.originIds != null and param.originIds.size > 0">
AND origin_id IN
<foreach collection="param.originIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.checkStatus != null and param.checkStatus != ''">
AND check_status = #{param.checkStatus}
</if>
<if test="param.checkStatusList != null and param.checkStatusList.size > 0">
AND check_status IN
<foreach collection="param.checkStatusList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.secondDepartId != null and param.secondDepartId != ''">
AND second_depart_id = #{param.secondDepartId}
</if>
<if test="param.secondDepartIds != null and param.secondDepartIds.size > 0">
AND second_depart_id IN
<foreach collection="param.secondDepartIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.discoveryTimeList != null and param.discoveryTimeList.size == 2">
AND discovery_time BETWEEN #{param.discoveryTimeList[0]} AND #{param.discoveryTimeList[1]}
</if>
<if test="param.personInfo != null and param.personInfo != ''">
AND (
responder_name LIKE CONCAT('%', #{param.personInfo}, '%')
OR responder_phone LIKE CONCAT('%', #{param.personInfo}, '%')
OR responder_id_code LIKE CONCAT('%', #{param.personInfo}, '%')
)
</if>
<if test="param.handleMethod != null and param.handleMethod != ''">
AND handle_method = #{param.handleMethod}
</if>
<if test="param.thingDesc != null and param.thingDesc != ''">
AND thing_desc LIKE CONCAT('%', #{param.thingDesc}, '%')
</if>
<if test="param.repeatt != null and param.repeatt != ''">
AND repeatt = #{param.repeatt}
</if>
<if test="param.leadApproval != null and param.leadApproval != ''">
AND lead_approval = #{param.leadApproval}
</if>
<if test="param.processingStatus != null and param.processingStatus != ''">
AND processing_status = #{param.processingStatus}
</if>
<if test="param.status != null and param.status != ''">
AND status = #{param.status}
</if>
<if test="param.initialReviewFileList != null and param.initialReviewFileList.size > 0">
AND gwf3 IN
<foreach collection="param.initialReviewFileList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.tags != null and param.tags.size > 0">
AND (
<foreach collection="param.tags" item="tagItem" separator=" OR ">
FIND_IN_SET(#{tagItem}, tag)
</foreach>
)
</if>
<if test="param.involveProblemIdList != null and param.involveProblemIdList.size > 0">
AND (
<foreach collection="param.involveProblemIdList" item="probItem" separator=" OR ">
FIND_IN_SET(#{probItem}, involve_problem)
</foreach>
)
</if>
</where>
ORDER BY discovery_time DESC, id DESC
</select>
<select id="selectPageWithNegative" resultType="com.biutag.supervision.pojo.dto.complaintCollection.ComplaintCollectionPageDTO">
SELECT
cc.id,
cc.source_table AS sourceTable,
cc.source_table_sub_one AS sourceTableSubOne,
-- source_table_path 不从数据库查,由后端计算
cc.origin_id AS originId,
cc.discovery_time AS discoveryTime,
cc.responder_name AS responderName,
cc.responder_phone AS responderPhone,
cc.business_type_name AS businessTypeName,
cc.thing_desc AS thingDesc,
cc.involved_issue AS involvedIssue,
cc.second_depart_name AS secondDepartName,
cc.third_depart_name AS thirdDepartName,
cc.involve_problem AS involveProblem,
cc.distribution_state AS distributionState,
cc.second_depart_id AS secondDepartId,
cc.third_depart_id AS thirdDepartId,
cc.problem_sources_code AS problemSourcesCode,
cc.problem_sources AS problemSources,
cc.police_type_name AS policeTypeName,
cc.channel_for_filing_complaints AS channelForFilingComplaints,
cc.acceptance_level AS acceptanceLevel,
cc.initial_petition AS initialPetition,
cc.entanglement_visits AS entanglementVisits,
cc.mass_visits AS massVisits,
cc.police_type AS policeType,
cc.responder_id_code AS responderIdCode,
cc.people_number AS peopleNumber,
cc.appeal AS appeal,
cc.business_class AS businessClass,
cc.register_depart_name AS registerDepartName,
cc.transfer_depart AS transferDepart,
cc.handle_method AS handleMethod,
cc.handle_depart_name AS handleDepartName,
cc.completed_time AS completedTime,
cc.involve_depart_name AS involveDepartName,
cc.receiving_leader_name AS receivingLeaderName,
cc.is_mian_responsib AS isMianResponsib,
cc.receiving_depart_name AS receivingDepartName,
cc.negative_id AS negativeId,
cc.petition_type AS petitionType,
cc.petition_processing_status AS petitionProcessingStatus,
cc.happen_time AS happenTime,
cc.is_real AS isReal,
cc.source AS source,
cc.creator AS creator,
cc.source_involve_depart_name AS sourceInvolveDepartName,
cc.outer_id AS outerId,
cc.crx_state AS crxState,
cc.business_type_code AS businessTypeCode,
cc.check_status AS checkStatus,
cc.check_status_name AS checkStatusName,
cc.check_status_desc AS checkStatusDesc,
cc.processing_status AS processingStatus,
cc.accountability_target AS accountabilityTarget,
cc.crt_time AS crtTime,
cc.repeatt AS repeatt,
cc.lead_approval AS leadApproval,
cc.tag AS tag,
cc.case_number AS caseNumber,
cc.gwf1 AS gwf1,
cc.gwf2 AS gwf2,
cc.gwf3 AS gwf3,
cc.gwf4 AS gwf4,
cc.gwf5 AS gwf5,
cc.create_by AS createBy,
cc.create_time AS createTime,
cc.update_by AS updateBy,
cc.update_time AS updateTime,
cc.completion_status AS completionStatus,
cc.public_recognition AS publicRecognition,
cc.status AS status,
cc.init_work_des AS initWorkDes,
cc.init_problem_plan AS initProblemPlan,
cc.init_verdict AS initVerdict
FROM complaint_collection cc
LEFT JOIN negative n ON cc.negative_id = n.id
<where>
<if test="param.sourceTable != null and param.sourceTable != ''">
AND cc.source_table = #{param.sourceTable}
</if>
<if test="param.sourceTableList != null and param.sourceTableList.size > 0">
AND cc.source_table IN
<foreach collection="param.sourceTableList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.sourceTableSubOne != null and param.sourceTableSubOne != ''">
AND cc.source_table_sub_one = #{param.sourceTableSubOne}
</if>
<if test="param.sourceTableSubOneList != null and param.sourceTableSubOneList.size > 0">
AND cc.source_table_sub_one IN
<foreach collection="param.sourceTableSubOneList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.originId != null and param.originId != ''">
AND cc.origin_id LIKE CONCAT('%', #{param.originId}, '%')
</if>
<if test="param.originIds != null and param.originIds.size > 0">
AND cc.origin_id IN
<foreach collection="param.originIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.checkStatus != null and param.checkStatus != ''">
AND cc.check_status = #{param.checkStatus}
</if>
<if test="param.checkStatusList != null and param.checkStatusList.size > 0">
AND cc.check_status IN
<foreach collection="param.checkStatusList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.secondDepartId != null and param.secondDepartId != ''">
AND cc.second_depart_id = #{param.secondDepartId}
</if>
<if test="param.secondDepartIds != null and param.secondDepartIds.size > 0">
AND cc.second_depart_id IN
<foreach collection="param.secondDepartIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.discoveryTimeList != null and param.discoveryTimeList.size == 2">
AND cc.discovery_time BETWEEN #{param.discoveryTimeList[0]} AND #{param.discoveryTimeList[1]}
</if>
<if test="param.personInfo != null and param.personInfo != ''">
AND (
cc.responder_name LIKE CONCAT('%', #{param.personInfo}, '%')
OR cc.responder_phone LIKE CONCAT('%', #{param.personInfo}, '%')
OR cc.responder_id_code LIKE CONCAT('%', #{param.personInfo}, '%')
)
</if>
<if test="param.handleMethod != null and param.handleMethod != ''">
AND cc.handle_method = #{param.handleMethod}
</if>
<if test="param.thingDesc != null and param.thingDesc != ''">
AND cc.thing_desc LIKE CONCAT('%', #{param.thingDesc}, '%')
</if>
<if test="param.repeatt != null and param.repeatt != ''">
AND cc.repeatt = #{param.repeatt}
</if>
<if test="param.leadApproval != null and param.leadApproval != ''">
AND cc.lead_approval = #{param.leadApproval}
</if>
<if test="param.processingStatus != null and param.processingStatus != ''">
AND cc.processing_status = #{param.processingStatus}
</if>
<if test="param.status != null and param.status != ''">
AND cc.status = #{param.status}
</if>
<if test="param.initialReviewFileList != null and param.initialReviewFileList.size > 0">
AND cc.gwf3 IN
<foreach collection="param.initialReviewFileList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.tags != null and param.tags.size > 0">
AND (
<foreach collection="param.tags" item="tagItem" separator=" OR ">
FIND_IN_SET(#{tagItem}, cc.tag)
</foreach>
)
</if>
<if test="param.involveProblemIdList != null and param.involveProblemIdList.size > 0">
AND (
<foreach collection="param.involveProblemIdList" item="probItem" separator=" OR ">
FIND_IN_SET(#{probItem}, cc.involve_problem)
</foreach>
)
</if>
<if test="param.createTimeList != null and param.createTimeList.size == 2">
AND cc.create_time BETWEEN #{param.createTimeList[0]} AND #{param.createTimeList[1]}
</if>
</where>
ORDER BY cc.create_time DESC, cc.id DESC
</select>
</mapper>