<?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">
|
<!--
|
* @title: 纠纷信息主表
|
* @description: 自定义sql,请自行实现业务逻辑
|
* @company: hugeinfo
|
* @author: wangwh
|
* @time:2024-08-27 10:00:57
|
* @version 1.0.0
|
-->
|
<mapper namespace="cn.huge.module.cases.dao.mapper.CaseInfoMapper">
|
<!-- 结果集 -->
|
<resultMap id="dataResult" type="cn.huge.module.cases.domain.po.CaseInfo">
|
<result property="id" column="id"/>
|
<result property="caseTitle" column="case_title"/>
|
<result property="caseRef" column="case_ref"/>
|
<result property="caseLevel" column="case_level"/>
|
<result property="visitTime" column="visit_time"/>
|
<result property="visitPeopleNum" column="visit_people_num"/>
|
<result property="mediType" column="medi_type"/>
|
<result property="mediTypeName" column="medi_type_name"/>
|
<result property="caseTypeFirst" column="case_type_first"/>
|
<result property="caseTypeFirstName" column="case_type_first_name"/>
|
<result property="caseType" column="case_type"/>
|
<result property="caseTypeName" column="case_type_name"/>
|
<result property="occurTime" column="occur_time"/>
|
<result property="addr" column="addr"/>
|
<result property="lng" column="lng"/>
|
<result property="lat" column="lat"/>
|
<result property="wgAddr" column="wg_addr"/>
|
<result property="wgLng" column="wg_lng"/>
|
<result property="wgLat" column="wg_lat"/>
|
<result property="queProv" column="que_prov"/>
|
<result property="queProvName" column="que_prov_name"/>
|
<result property="queCity" column="que_city"/>
|
<result property="queCityName" column="que_city_name"/>
|
<result property="queArea" column="que_area"/>
|
<result property="queAreaName" column="que_area_name"/>
|
<result property="queRoad" column="que_road"/>
|
<result property="queRoadName" column="que_road_name"/>
|
<result property="queVillage" column="que_village"/>
|
<result property="queVillageName" column="que_village_name"/>
|
<result property="peopleNum" column="people_num"/>
|
<result property="amount" column="amount"/>
|
<result property="crowd" column="crowd"/>
|
<result property="crowdName" column="crowd_name"/>
|
<result property="canal" column="canal"/>
|
<result property="canalName" column="canal_name"/>
|
<result property="visitWay" column="visit_way"/>
|
<result property="visitWayName" column="visit_way_name"/>
|
<result property="zxslStatus" column="zxsl_status"/>
|
<result property="caseDes" column="case_des"/>
|
<result property="caseClaim" column="case_claim"/>
|
<result property="majorStatus" column="major_status"/>
|
<result property="source" column="source"/>
|
<result property="sourceName" column="source_name"/>
|
<result property="caseNo" column="case_no"/>
|
<result property="mediateNo" column="mediate_no"/>
|
<result property="mediateBookNo" column="mediate_book_no"/>
|
<result property="civilNo" column="civil_no"/>
|
<result property="plaintiffs" column="plaintiffs"/>
|
<result property="pagents" column="pagents"/>
|
<result property="defendants" column="defendants"/>
|
<result property="dagents" column="dagents"/>
|
<result property="inputUnitId" column="input_unit_id"/>
|
<result property="inputUnitName" column="input_unit_name"/>
|
<result property="inputUserId" column="input_user_id"/>
|
<result property="inputUserName" column="input_user_name"/>
|
<result property="inputWay" column="input_way"/>
|
<result property="status" column="status"/>
|
<result property="statusName" column="status_name"/>
|
<result property="process" column="process"/>
|
<result property="processName" column="process_name"/>
|
<result property="infoProcess" column="info_process"/>
|
<result property="infoProcessName" column="info_process_name"/>
|
<result property="partyShow" column="party_show"/>
|
<result property="wantUnitId" column="want_unit_id"/>
|
<result property="wantUnitName" column="want_unit_name"/>
|
<result property="wantUserId" column="want_user_id"/>
|
<result property="wantUserName" column="want_user_name"/>
|
<result property="deleteStatus" column="delete_status"/>
|
<result property="custId" column="cust_id"/>
|
<result property="createTime" column="create_time"/>
|
<result property="updateTime" column="update_time"/>
|
<result property="syncStatus" column="sync_status"/>
|
<result property="oldCaseType" column="old_case_type"/>
|
<result property="oldCaseTypeName" column="old_case_type_name"/>
|
<result property="canalSecond" column="canal_second"/>
|
<result property="canalSecondName" column="canal_second_name"/>
|
<result property="caseRemark" column="case_remark"/>
|
</resultMap>
|
<resultMap id="dataResult-all" type="cn.huge.module.cases.domain.dto.CasePageDTO">
|
<result property="id" column="id"/>
|
<result property="status" column="status"/>
|
<result property="statusName" column="status_name"/>
|
<result property="canal" column="canal"/>
|
<result property="canalName" column="canal_name"/>
|
<result property="canalSecond" column="canal_second"/>
|
<result property="canalSecondName" column="canal_second_name"/>
|
<result property="caseLevel" column="case_level"/>
|
<result property="caseType" column="case_type"/>
|
<result property="caseTypeName" column="case_type_name"/>
|
<result property="caseTypeFirstName" column="case_type_first_name"/>
|
<result property="inputUnitId" column="input_unit_id"/>
|
<result property="inputUnitName" column="input_unit_name"/>
|
<result property="mediResult" column="medi_result"/>
|
<result property="mediResultName" column="medi_result_name"/>
|
<result property="mediateUnitId" column="mediate_unit_id"/>
|
<result property="mediateUnitName" column="mediate_unit_name"/>
|
<result property="assistUnitId" column="assist_unit_id"/>
|
<result property="assistUnitName" column="assist_unit_name"/>
|
<result property="closeTime" column="close_time"/>
|
<result property="agreeType" column="agree_type"/>
|
<result property="agreeTypeName" column="agree_type_name"/>
|
<result property="agreeContent" column="agree_content"/>
|
<result property="windupContent" column="windup_content"/>
|
<result property="createTime" column="create_time"/>
|
<result property="plaintiffs" column="plaintiffs"/>
|
<result property="defendants" column="defendants"/>
|
<result property="queCityName" column="que_city_name"/>
|
<result property="queAreaName" column="que_area_name"/>
|
<result property="queRoadName" column="que_road_name"/>
|
<result property="queVillageName" column="que_village_name"/>
|
<result property="caseTypeFirst" column="case_type_first"/>
|
<result property="caseTypeFirstName" column="case_type_first_name"/>
|
<result property="caseTaskId" column="caseTaskId"/>
|
<result property="visitTime" column="visit_time"/>
|
<result property="occurTime" column="occur_time"/>
|
<result property="addr" column="addr"/>
|
<result property="peopleNum" column="people_num"/>
|
<result property="amount" column="amount"/>
|
<result property="caseDes" column="case_des"/>
|
<result property="caseClaim" column="case_claim"/>
|
<result property="caseRef" column="case_ref"/>
|
<result property="majorStatus" column="major_status"/>
|
<result property="mediator" column="mediator"/>
|
<result property="isRisk" column="is_risk"/>
|
</resultMap>
|
<!-- 表 -->
|
<sql id='table-name'>dyh_case_info</sql>
|
<sql id="column-part-all">
|
a.id,
|
a.status,
|
a.status_name,
|
a.canal,
|
a.canal_name,
|
a.canal_second,
|
a.canal_second_name,
|
a.case_level,
|
a.case_type,
|
a.case_type_name,
|
a.case_type_first_name,
|
a.input_unit_id,
|
a.input_unit_name,
|
a.create_time,
|
a.plaintiffs,
|
a.defendants,
|
IF(c.city_name is null,a.que_city_name,c.city_name) as que_city_name,
|
IF(c.area_name is null,a.que_area_name,c.area_name) as que_area_name,
|
IF(c.road_name is null,a.que_road_name,c.road_name) as que_road_name,
|
IF(c.village_name is null,a.que_village_name,c.village_name) as que_village_name,
|
a.case_type_first,
|
a.case_type_first_name,
|
a.visit_time,
|
a.occur_time,
|
a.addr,
|
a.people_num,
|
a.amount,
|
a.case_des,
|
a.case_claim,
|
a.case_ref,
|
a.major_status,
|
b.mediator,
|
b.is_risk,
|
b.medi_result,
|
b.medi_result_name,
|
b.mediate_unit_id,
|
b.mediate_unit_name,
|
b.assist_unit_id,
|
b.assist_unit_name,
|
b.close_time,
|
b.agree_type,
|
b.agree_type_name,
|
b.agree_content,
|
b.windup_content,
|
d.id as caseTaskId
|
</sql>
|
<!-- 字段 -->
|
<sql id="column-part">
|
id,
|
case_title,
|
case_ref,
|
case_level,
|
visit_time,
|
visit_people_num,
|
medi_type,
|
medi_type_name,
|
case_type_first,
|
case_type_first_name,
|
case_type,
|
case_type_name,
|
occur_time,
|
addr,
|
lng,
|
lat,
|
wg_addr,
|
wg_lng,
|
wg_lat,
|
que_prov,
|
que_prov_name,
|
que_city,
|
que_city_name,
|
que_area,
|
que_area_name,
|
que_road,
|
que_road_name,
|
que_village,
|
que_village_name,
|
people_num,
|
amount,
|
crowd,
|
crowd_name,
|
canal,
|
canal_name,
|
visit_way,
|
visit_way_name,
|
zxsl_status,
|
case_des,
|
case_claim,
|
major_status,
|
source,
|
source_name,
|
case_no,
|
mediate_no,
|
mediate_book_no,
|
civil_no,
|
plaintiffs,
|
pagents,
|
defendants,
|
dagents,
|
input_unit_id,
|
input_unit_name,
|
input_user_id,
|
input_user_name,
|
input_way,
|
status,
|
status_name,
|
process,
|
process_name,
|
info_process,
|
info_process_name,
|
want_unit_id,
|
want_unit_name,
|
want_user_id,
|
want_user_name,
|
party_show,
|
delete_status,
|
cust_id,
|
create_time,
|
update_time,
|
sync_status,
|
old_case_type,
|
old_case_type_name,
|
canal_second,
|
canal_second_name
|
</sql>
|
<!-- 更新实体字段 -->
|
<sql id="set-part">
|
<if test="entity.caseTitle != null">case_title = #{entity.caseTitle},</if>
|
<if test="entity.caseRef != null">case_ref = #{entity.caseRef},</if>
|
<if test="entity.caseLevel != null">case_level = #{entity.caseLevel},</if>
|
<if test="entity.visitTime != null">visit_time = #{entity.visitTime},</if>
|
<if test="entity.visitPeopleNum != null">visit_people_num = #{entity.visitPeopleNum},</if>
|
<if test="entity.mediType != null">medi_type = #{entity.mediType},</if>
|
<if test="entity.mediTypeName != null">medi_type_name = #{entity.mediTypeName},</if>
|
<if test="entity.caseTypeFirst != null">case_type_first = #{entity.caseTypeFirst},</if>
|
<if test="entity.caseTypeFirstName != null">case_type_first_name = #{entity.caseTypeFirstName},</if>
|
<if test="entity.caseType != null">case_type = #{entity.caseType},</if>
|
<if test="entity.caseTypeName != null">case_type_name = #{entity.caseTypeName},</if>
|
<if test="entity.occurTime != null">occur_time = #{entity.occurTime},</if>
|
<if test="entity.addr != null">addr = #{entity.addr},</if>
|
<if test="entity.lng != null">lng = #{entity.lng},</if>
|
<if test="entity.lat != null">lat = #{entity.lat},</if>
|
<if test="entity.wgAddr != null">wg_addr = #{entity.wgAddr},</if>
|
<if test="entity.wgLng != null">wg_lng = #{entity.wgLng},</if>
|
<if test="entity.wgLat != null">wg_lat = #{entity.wgLat},</if>
|
<if test="entity.queProv != null">que_prov = #{entity.queProv},</if>
|
<if test="entity.queProvName != null">que_prov_name = #{entity.queProvName},</if>
|
<if test="entity.queCity != null">que_city = #{entity.queCity},</if>
|
<if test="entity.queCityName != null">que_city_name = #{entity.queCityName},</if>
|
<if test="entity.queArea != null">que_area = #{entity.queArea},</if>
|
<if test="entity.queAreaName != null">que_area_name = #{entity.queAreaName},</if>
|
<if test="entity.queRoad != null">que_road = #{entity.queRoad},</if>
|
<if test="entity.queRoadName != null">que_road_name = #{entity.queRoadName},</if>
|
<if test="entity.queVillage != null">que_village = #{entity.queVillage},</if>
|
<if test="entity.queVillageName != null">que_village_name = #{entity.queVillageName},</if>
|
<if test="entity.peopleNum != null">people_num = #{entity.peopleNum},</if>
|
<if test="entity.amount != null">amount = #{entity.amount},</if>
|
<if test="entity.crowd != null">crowd = #{entity.crowd},</if>
|
<if test="entity.crowdName != null">crowd_name = #{entity.crowdName},</if>
|
<if test="entity.canal != null">canal = #{entity.canal},</if>
|
<if test="entity.canalName != null">canal_name = #{entity.canalName},</if>
|
<if test="entity.visitWay != null">visit_way = #{entity.visitWay},</if>
|
<if test="entity.visitWayName != null">visit_way_name = #{entity.visitWayName},</if>
|
<if test="entity.zxslStatus != null">zxsl_status = #{entity.zxslStatus},</if>
|
<if test="entity.caseDes != null">case_des = #{entity.caseDes},</if>
|
<if test="entity.caseClaim != null">case_claim = #{entity.caseClaim},</if>
|
<if test="entity.majorStatus != null">major_status = #{entity.majorStatus},</if>
|
<if test="entity.source != null">source = #{entity.source},</if>
|
<if test="entity.sourceName != null">source_name = #{entity.sourceName},</if>
|
<if test="entity.caseNo != null">case_no = #{entity.caseNo},</if>
|
<if test="entity.mediateNo != null">mediate_no = #{entity.mediateNo},</if>
|
<if test="entity.mediateBookNo != null">mediate_book_no = #{entity.mediateBookNo},</if>
|
<if test="entity.civilNo != null">civil_no = #{entity.civilNo},</if>
|
<if test="entity.plaintiffs != null">plaintiffs = #{entity.plaintiffs},</if>
|
<if test="entity.pagents != null">pagents = #{entity.pagents},</if>
|
<if test="entity.defendants != null">defendants = #{entity.defendants},</if>
|
<if test="entity.dagents != null">dagents = #{entity.dagents},</if>
|
<if test="entity.inputUnitId != null">input_unit_id = #{entity.inputUnitId},</if>
|
<if test="entity.inputUnitName != null">input_unit_name = #{entity.inputUnitName},</if>
|
<if test="entity.inputUserId != null">input_user_id = #{entity.inputUserId},</if>
|
<if test="entity.inputUserName != null">input_user_name = #{entity.inputUserName},</if>
|
<if test="entity.inputWay != null">input_way = #{entity.inputWay},</if>
|
<if test="entity.status != null">status = #{entity.status},</if>
|
<if test="entity.statusName != null">status_name = #{entity.statusName},</if>
|
<if test="entity.process != null">process = #{entity.process},</if>
|
<if test="entity.processName != null">process_name = #{entity.processName},</if>
|
<if test="entity.infoProcess != null">info_process = #{entity.infoProcess},</if>
|
<if test="entity.infoProcessName != null">info_process_name = #{entity.infoProcessName},</if>
|
<if test="entity.partyShow != null">party_show = #{entity.partyShow},</if>
|
<if test="entity.wantUnitId != null">want_unit_id = #{entity.wantUnitId},</if>
|
<if test="entity.wantUnitName != null">want_unit_name = #{entity.wantUnitName},</if>
|
<if test="entity.wantUserId != null">want_user_id = #{entity.wantUserId},</if>
|
<if test="entity.wantUserName != null">want_user_name = #{entity.wantUserName},</if>
|
<if test="entity.deleteStatus != null">delete_status = #{entity.deleteStatus},</if>
|
<if test="entity.custId != null">cust_id = #{entity.custId},</if>
|
<if test="entity.createTime != null">create_time = #{entity.createTime},</if>
|
<if test="entity.updateTime != null">update_time = #{entity.updateTime},</if>
|
<if test="entity.syncStatus != null">sync_status = #{entity.syncStatus},</if>
|
<if test="entity.oldCaseType != null">old_case_type = #{entity.oldCaseType},</if>
|
<if test="entity.oldCaseTypeName != null">old_case_type_name = #{entity.oldCaseTypeName},</if>
|
<if test="entity.canalSecond != null">canal_second = #{entity.canalSecond},</if>
|
<if test="entity.canalSecondName != null">canal_second_name = #{entity.canalSecond}</if>
|
</sql>
|
<!-- 条件 -->
|
<sql id="where-part-all">
|
<if test="terms != null">
|
<where>
|
and a.delete_status = 0
|
<if test="terms.ids != null and terms.ids.size > 0">
|
and a.id in
|
<foreach collection="terms.ids" item="id" index="index" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</if>
|
<if test="terms.status != null and terms.status !=''">
|
and a.status = #{terms.status}
|
</if>
|
<if test="terms.statusName != null and terms.statusName !=''">
|
and a.status_name = #{terms.statusName}
|
</if>
|
<if test="terms.canal != null and terms.canal !=''">
|
and a.canal = #{terms.canal}
|
</if>
|
<if test="terms.canalList != null and terms.canalList.size > 0">
|
and a.canal in
|
<foreach collection="terms.canalList" item="canal" index="index" open="(" separator="," close=")">
|
#{canal}
|
</foreach>
|
</if>
|
<if test="terms.canalSecond != null and terms.canalSecond !=''">
|
and a.canal_second = #{terms.canalSecond}
|
</if>
|
<if test="terms.canalSecondNot != null and terms.canalSecondNot !=''">
|
and a.canal_second != #{terms.canalSecondNot}
|
</if>
|
<if test="terms.canalSecondAll != null and terms.canalSecondAll !=''">
|
and (a.canal_second != #{terms.canalSecondAll} or a.canal_second is null)
|
</if>
|
|
<if test="terms.canalName != null and terms.canalName !=''">
|
and a.canal_name = #{terms.canalName}
|
</if>
|
<if test="terms.caseLevel != null and terms.caseLevel !=''">
|
and a.case_level = #{terms.caseLevel}
|
</if>
|
<if test="terms.caseType != null and terms.caseType !=''">
|
and (a.case_type = #{terms.caseType} or a.case_type_first = #{terms.caseType})
|
</if>
|
<if test="terms.caseTypeFirst != null and terms.caseTypeFirst !=''">
|
and a.case_type_first = #{terms.caseTypeFirst}
|
</if>
|
<if test="terms.caseTypeFirstList != null and terms.caseTypeFirstList.size > 0">
|
and a.case_type_first in
|
<foreach collection="terms.caseTypeFirstList" item="caseTypeFirst" index="index" open="(" separator="," close=")">
|
#{caseTypeFirst}
|
</foreach>
|
</if>
|
<if test="terms.caseTypeName != null and terms.caseTypeName !=''">
|
and a.case_type_name = #{terms.caseTypeName}
|
</if>
|
<if test="terms.inputUnitId != null and terms.inputUnitId !=''">
|
and a.input_unit_id = #{terms.inputUnitId}
|
</if>
|
<if test="terms.inputUnitName != null and terms.inputUnitName !=''">
|
and a.input_unit_name like CONCAT('%', #{terms.inputUnitName}, '%')
|
</if>
|
<if test="terms.mediator != null and terms.mediator !=''">
|
and b.mediator = #{terms.mediator}
|
</if>
|
<if test="terms.mediatorId != null and terms.mediatorId !=''">
|
and b.mediator_id = #{terms.mediatorId}
|
</if>
|
<if test="terms.visitTimeStart != null and terms.visitTimeStart !='' and terms.visitTimeEnd != null and terms.visitTimeEnd !=''">
|
and (DATE_FORMAT(a.visit_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{terms.visitTimeStart}
|
and DATE_FORMAT(a.visit_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{terms.visitTimeEnd})
|
</if>
|
<if test="terms.createStart != null and terms.createStart !='' and terms.createEnd != null and terms.createEnd !=''">
|
and (DATE_FORMAT(a.create_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{terms.createStart}
|
and DATE_FORMAT(a.create_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{terms.createEnd})
|
</if>
|
<if test="terms.closeStart != null and terms.closeStart !='' and terms.closeEnd != null and terms.closeEnd !=''">
|
and (DATE_FORMAT(b.close_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{terms.closeStart}
|
and DATE_FORMAT(b.close_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{terms.closeEnd})
|
</if>
|
<if test="terms.fileStart != null and terms.fileStart !='' and terms.fileEnd != null and terms.fileEnd !=''">
|
and (DATE_FORMAT(b.file_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{terms.fileStart}
|
and DATE_FORMAT(b.file_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{terms.fileEnd})
|
</if>
|
<if test='terms.queCity != null and terms.queCity !="" and terms.statistics != null and terms.areaType == "1"'>
|
and (b.belong_unit_id is not null and c.city = #{terms.queCity}
|
<if test="terms.unitGrades != null and terms.unitGrades.size > 0">
|
and c.unit_grade in
|
<foreach collection="terms.unitGrades" item="unitGrade" index="index" open="(" separator="," close=")">
|
#{unitGrade}
|
</foreach>
|
</if>
|
)
|
</if>
|
|
<if test='terms.queCity != null and terms.queCity !="" and terms.statistics != null and terms.areaType == "2"'>
|
and ((b.belong_unit_id is not null and c.city = #{terms.queCity}
|
<if test="terms.unitGrades != null and terms.unitGrades.size > 0">
|
and c.unit_grade in
|
<foreach collection="terms.unitGrades" item="unitGrade" index="index" open="(" separator=","
|
close=")">
|
#{unitGrade}
|
</foreach>
|
</if>)
|
or (b.belong_unit_id is null and a.que_city = #{terms.queCity})
|
)
|
</if>
|
<if test='terms.queArea != null and terms.queArea !="" and terms.statistics != null and terms.areaType == "2"'>
|
and (b.belong_unit_id is not null and c.area = #{terms.queArea}
|
<if test="terms.unitGrades != null and terms.unitGrades.size > 0">
|
and c.unit_grade in
|
<foreach collection="terms.unitGrades" item="unitGrade" index="index" open="(" separator="," close=")">
|
#{unitGrade}
|
</foreach>
|
</if>
|
)
|
</if>
|
<if test='terms.queArea != null and terms.queArea !="" and terms.statistics != null and terms.areaType == "3"'>
|
and ((b.belong_unit_id is not null and c.area = #{terms.queArea}
|
<if test="terms.unitGrades != null and terms.unitGrades.size > 0">
|
and c.unit_grade in
|
<foreach collection="terms.unitGrades" item="unitGrade" index="index" open="(" separator="," close=")">
|
#{unitGrade}
|
</foreach>
|
</if>
|
)
|
or (b.belong_unit_id is null and a.que_area = #{terms.queArea})
|
)
|
</if>
|
|
<if test='terms.queRoad != null and terms.queRoad !="" and terms.statistics != null and terms.areaType == "3"'>
|
and (b.belong_unit_id is not null and c.road = #{terms.queRoad}
|
<if test="terms.unitGrades != null and terms.unitGrades.size > 0">
|
and c.unit_grade in
|
<foreach collection="terms.unitGrades" item="unitGrade" index="index" open="(" separator="," close=")">
|
#{unitGrade}
|
</foreach>
|
</if>
|
)
|
</if>
|
|
<if test='terms.queRoad != null and terms.queRoad !="" and terms.statistics != null and terms.areaType == "4"'>
|
and ((b.belong_unit_id is not null and c.road = #{terms.queRoad}
|
<if test="terms.unitGrades != null and terms.unitGrades.size > 0">
|
and c.unit_grade in
|
<foreach collection="terms.unitGrades" item="unitGrade" index="index" open="(" separator="," close=")">
|
#{unitGrade}
|
</foreach>
|
</if>
|
)
|
or (b.belong_unit_id is null and a.que_road = #{terms.queRoad}))
|
</if>
|
<if test='terms.queVillage != null and terms.queVillage !="" and terms.statistics != null and terms.areaType == "4"'>
|
and (b.belong_unit_id is not null and c.village = #{terms.queVillage}
|
<if test="terms.unitGrades != null and terms.unitGrades.size > 0">
|
and c.unit_grade in
|
<foreach collection="terms.unitGrades" item="unitGrade" index="index" open="(" separator="," close=")">
|
#{unitGrade}
|
</foreach>
|
</if>
|
)
|
</if>
|
<if test="terms.isArea != null and terms.isArea !=''">
|
and a.que_city is not null and a.que_area is not null and a.que_road is not null
|
</if>
|
<if test="terms.queArea != null and terms.queArea !='' and terms.statistics == null">
|
and a.que_area = #{terms.queArea}
|
</if>
|
<if test="terms.queRoad != null and terms.queRoad !='' and terms.statistics == null">
|
and a.que_road = #{terms.queRoad}
|
</if>
|
<if test="terms.caseRef != null and terms.caseRef !=''">
|
and a.case_ref like CONCAT('%', #{terms.caseRef}, '%')
|
</if>
|
<if test="terms.plaintiffs != null and terms.plaintiffs !=''">
|
and a.plaintiffs like CONCAT('%', #{terms.plaintiffs}, '%')
|
</if>
|
<if test="terms.defendants != null and terms.defendants !=''">
|
and a.defendants like CONCAT('%', #{terms.defendants}, '%')
|
</if>
|
<if test="terms.peopleNumStart != null and terms.peopleNumStart !=''">
|
and a.people_num <![CDATA[ >= ]]> #{terms.peopleNumStart}
|
</if>
|
<if test="terms.peopleNumEnd != null and terms.peopleNumEnd !=''">
|
and a.people_num <![CDATA[ <= ]]> #{terms.peopleNumEnd}
|
</if>
|
<if test="terms.amountStart != null and terms.amountStart !=''">
|
and a.amount <![CDATA[ >= ]]> #{terms.amountStart}
|
</if>
|
<if test="terms.amountEnd != null and terms.amountEnd !=''">
|
and a.amount <![CDATA[ <= ]]> #{terms.amountEnd}
|
</if>
|
<if test="terms.evaluateGrade != null and terms.evaluateGrade !=''">
|
and a.id in(select case_id from dyh_case_evaluate where evaluate_grade = #{terms.evaluateGrade})
|
</if>
|
<if test="terms.mediateUnitId != null and terms.mediateUnitId !=''">
|
and b.mediate_unit_id = #{terms.mediateUnitId}
|
</if>
|
<if test="terms.assistUnitId != null and terms.assistUnitId !=''">
|
and b.assist_unit_id = #{terms.assistUnitId}
|
</if>
|
<if test="terms.mediateUnitName != null and terms.mediateUnitName !=''">
|
and b.mediate_unit_name like CONCAT('%', #{terms.mediateUnitName}, '%')
|
</if>
|
<if test="terms.assistUnitName != null and terms.assistUnitName !=''">
|
and b.assist_unit_name like CONCAT('%', #{terms.assistUnitName}, '%')
|
</if>
|
<if test='terms.mediResult != null and terms.mediResult !="1"'>
|
and b.medi_result = #{terms.mediResult}
|
</if>
|
<if test='terms.mediResult != null and terms.mediResult =="1"'>
|
and a.info_process <![CDATA[ < ]]> 3
|
</if>
|
<if test="terms.majorStatus != null and terms.majorStatus !=''">
|
and a.major_status = #{terms.majorStatus}
|
</if>
|
<if test='terms.resolveType != null and terms.resolveType =="1"'>
|
and a.info_process <![CDATA[ < ]]> 3
|
</if>
|
<if test='terms.resolveType != null and terms.resolveType =="2"'>
|
and a.info_process = 3
|
</if>
|
<if test='terms.resolveType != null and terms.resolveType =="3"'>
|
and a.info_process = 4
|
</if>
|
<if test="terms.isRisk != null and terms.isRisk !=''">
|
and b.is_risk = #{terms.isRisk}
|
</if>
|
<if test="terms.agreeType != null and terms.agreeType !=''">
|
and b.agree_type = #{terms.agreeType}
|
</if>
|
<if test="terms.systemSource != null and terms.systemSource !=''">
|
and b.sys_source = #{systemSource}
|
</if>
|
</where>
|
</if>
|
</sql>
|
<!-- 条件 -->
|
<sql id="where-part">
|
<if test="terms != null">
|
<where>
|
<if test="terms.ids != null and terms.ids.size > 0">
|
and id in
|
<foreach collection="terms.ids" item="id" index="index" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</if>
|
<if test="terms.id != null and terms.id !=''">
|
and id = #{terms.id}
|
</if>
|
<if test="terms.partyShow != null and terms.partyShow !=''">
|
and party_show = #{terms.partyShow}
|
</if>
|
<if test="terms.caseTitle != null and terms.caseTitle !=''">
|
and case_title = #{terms.caseTitle}
|
</if>
|
<if test="terms.caseRef != null and terms.caseRef !=''">
|
and case_ref = #{terms.caseRef}
|
</if>
|
<if test="terms.caseLevel != null and terms.caseLevel !=''">
|
and case_level = #{terms.caseLevel}
|
</if>
|
<if test="terms.visitTime != null and terms.visitTime !=''">
|
and visit_time = #{terms.visitTime}
|
</if>
|
<if test="terms.visitPeopleNum != null and terms.visitPeopleNum !=''">
|
and visit_people_num = #{terms.visitPeopleNum}
|
</if>
|
<if test="terms.mediType != null and terms.mediType !=''">
|
and medi_type = #{terms.mediType}
|
</if>
|
<if test="terms.mediTypeName != null and terms.mediTypeName !=''">
|
and medi_type_name = #{terms.mediTypeName}
|
</if>
|
<if test="terms.caseTypeFirst != null and terms.caseTypeFirst !=''">
|
and case_type_first = #{terms.caseTypeFirst}
|
</if>
|
<if test="terms.caseTypeFirstName != null and terms.caseTypeFirstName !=''">
|
and case_type_first_name = #{terms.caseTypeFirstName}
|
</if>
|
<if test="terms.caseType != null and terms.caseType !=''">
|
and (case_type = #{terms.caseType} or case_type_first = #{terms.caseType})
|
</if>
|
<if test="terms.caseTypeName != null and terms.caseTypeName !=''">
|
and case_type_name = #{terms.caseTypeName}
|
</if>
|
<if test="terms.occurTime != null and terms.occurTime !=''">
|
and occur_time = #{terms.occurTime}
|
</if>
|
<if test="terms.addr != null and terms.addr !=''">
|
and addr = #{terms.addr}
|
</if>
|
<if test="terms.lng != null and terms.lng !=''">
|
and lng = #{terms.lng}
|
</if>
|
<if test="terms.lat != null and terms.lat !=''">
|
and lat = #{terms.lat}
|
</if>
|
<if test="terms.wgAddr != null and terms.wgAddr !=''">
|
and wg_addr = #{terms.wgAddr}
|
</if>
|
<if test="terms.wgLng != null and terms.wgLng !=''">
|
and wg_lng = #{terms.wgLng}
|
</if>
|
<if test="terms.wgLat != null and terms.wgLat !=''">
|
and wg_lat = #{terms.wgLat}
|
</if>
|
<if test="terms.queProv != null and terms.queProv !=''">
|
and que_prov = #{terms.queProv}
|
</if>
|
<if test="terms.queProvName != null and terms.queProvName !=''">
|
and que_prov_name = #{terms.queProvName}
|
</if>
|
<if test="terms.queCity != null and terms.queCity !=''">
|
and que_city = #{terms.queCity}
|
</if>
|
<if test="terms.queCityName != null and terms.queCityName !=''">
|
and que_city_name = #{terms.queCityName}
|
</if>
|
<if test="terms.queArea != null and terms.queArea !=''">
|
and que_area = #{terms.queArea}
|
</if>
|
<if test="terms.queAreaName != null and terms.queAreaName !=''">
|
and que_area_name = #{terms.queAreaName}
|
</if>
|
<if test="terms.queRoad != null and terms.queRoad !=''">
|
and que_road = #{terms.queRoad}
|
</if>
|
<if test="terms.queRoadName != null and terms.queRoadName !=''">
|
and que_road_name = #{terms.queRoadName}
|
</if>
|
<if test="terms.queVillage != null and terms.queVillage !=''">
|
and que_village = #{terms.queVillage}
|
</if>
|
<if test="terms.queVillageName != null and terms.queVillageName !=''">
|
and que_village_name = #{terms.queVillageName}
|
</if>
|
<if test="terms.peopleNum != null and terms.peopleNum !=''">
|
and people_num = #{terms.peopleNum}
|
</if>
|
<if test="terms.amount != null and terms.amount !=''">
|
and amount = #{terms.amount}
|
</if>
|
<if test="terms.crowd != null and terms.crowd !=''">
|
and crowd = #{terms.crowd}
|
</if>
|
<if test="terms.crowdName != null and terms.crowdName !=''">
|
and crowd_name = #{terms.crowdName}
|
</if>
|
<if test="terms.canal != null and terms.canal !=''">
|
and canal = #{terms.canal}
|
</if>
|
<if test="terms.canalName != null and terms.canalName !=''">
|
and canal_name = #{terms.canalName}
|
</if>
|
<if test="terms.visitWay != null and terms.visitWay !=''">
|
and visit_way = #{terms.visitWay}
|
</if>
|
<if test="terms.visitWayName != null and terms.visitWayName !=''">
|
and visit_way_name = #{terms.visitWayName}
|
</if>
|
<if test="terms.zxslStatus != null and terms.zxslStatus !=''">
|
and zxsl_status = #{terms.zxslStatus}
|
</if>
|
<if test="terms.caseDes != null and terms.caseDes !=''">
|
and case_des = #{terms.caseDes}
|
</if>
|
<if test="terms.caseClaim != null and terms.caseClaim !=''">
|
and case_claim = #{terms.caseClaim}
|
</if>
|
<if test="terms.majorStatus != null and terms.majorStatus !=''">
|
and major_status = #{terms.majorStatus}
|
</if>
|
<if test="terms.source != null and terms.source !=''">
|
and source = #{terms.source}
|
</if>
|
<if test="terms.sourceName != null and terms.sourceName !=''">
|
and source_name = #{terms.sourceName}
|
</if>
|
<if test="terms.caseNo != null and terms.caseNo !=''">
|
and case_no = #{terms.caseNo}
|
</if>
|
<if test="terms.mediateNo != null and terms.mediateNo !=''">
|
and mediate_no = #{terms.mediateNo}
|
</if>
|
<if test="terms.mediateBookNo != null and terms.mediateBookNo !=''">
|
and mediate_book_no = #{terms.mediateBookNo}
|
</if>
|
<if test="terms.civilNo != null and terms.civilNo !=''">
|
and civil_no = #{terms.civilNo}
|
</if>
|
<if test="terms.plaintiffs != null and terms.plaintiffs !=''">
|
and plaintiffs = #{terms.plaintiffs}
|
</if>
|
<if test="terms.pagents != null and terms.pagents !=''">
|
and pagents = #{terms.pagents}
|
</if>
|
<if test="terms.defendants != null and terms.defendants !=''">
|
and defendants = #{terms.defendants}
|
</if>
|
<if test="terms.dagents != null and terms.dagents !=''">
|
and dagents = #{terms.dagents}
|
</if>
|
<if test="terms.inputUnitId != null and terms.inputUnitId !=''">
|
and input_unit_id = #{terms.inputUnitId}
|
</if>
|
<if test="terms.inputUnitName != null and terms.inputUnitName !=''">
|
and input_unit_name = #{terms.inputUnitName}
|
</if>
|
<if test="terms.inputUserId != null and terms.inputUserId !=''">
|
and input_user_id = #{terms.inputUserId}
|
</if>
|
<if test="terms.inputUserName != null and terms.inputUserName !=''">
|
and input_user_name = #{terms.inputUserName}
|
</if>
|
<if test="terms.inputWay != null and terms.inputWay !=''">
|
and input_way = #{terms.inputWay}
|
</if>
|
<if test="terms.status != null and terms.status !=''">
|
and status = #{terms.status}
|
</if>
|
<if test="terms.statusName != null and terms.statusName !=''">
|
and status_name = #{terms.statusName}
|
</if>
|
<if test="terms.processList != null and terms.processList.size > 0">
|
and process in
|
<foreach collection="terms.processList" item="process" index="index" open="(" separator=","
|
close=")">
|
#{process}
|
</foreach>
|
</if>
|
<if test="terms.process != null and terms.process !=''">
|
and process = #{terms.process}
|
</if>
|
<if test="terms.processName != null and terms.processName !=''">
|
and process_name = #{terms.processName}
|
</if>
|
<if test="terms.infoProcess != null and terms.infoProcess !=''">
|
and info_process = #{terms.infoProcess}
|
</if>
|
<if test="terms.infoProcessName != null and terms.infoProcessName !=''">
|
and info_process_name = #{terms.infoProcessName}
|
</if>
|
<if test="terms.wantUnitId != null and terms.wantUnitId !=''">
|
and want_unit_id = #{terms.wantUnitId}
|
</if>
|
<if test="terms.wantUnitName != null and terms.wantUnitName !=''">
|
and want_unit_name = #{terms.wantUnitName}
|
</if>
|
<if test="terms.wantUserId != null and terms.wantUserId !=''">
|
and want_user_id = #{terms.wantUserId}
|
</if>
|
<if test="terms.wantUserName != null and terms.wantUserName !=''">
|
and want_user_name = #{terms.wantUserName}
|
</if>
|
<if test="terms.deleteStatus = null and terms.deleteStatus =''">
|
and delete_status = 0
|
</if>
|
<if test="terms.deleteStatus != null and terms.deleteStatus !=''">
|
and delete_status = #{terms.deleteStatus}
|
</if>
|
<if test="terms.custId != null and terms.custId !=''">
|
and cust_id = #{terms.custId}
|
</if>
|
<if test="terms.createTime != null and terms.createTime !=''">
|
and DATE_FORMAT(create_time,'%Y-%m-%d') = #{terms.createTime}
|
</if>
|
<if test="terms.createStart != null and terms.createStart !='' and terms.createEnd != null and terms.createEnd !=''">
|
and (DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.createStart}
|
and DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.createEnd})
|
</if>
|
<if test="terms.updateTime != null and terms.updateTime !=''">
|
and DATE_FORMAT(update_time,'%Y-%m-%d') = #{terms.updateTime}
|
</if>
|
<if test="terms.updateStart != null and terms.updateStart !='' and terms.updateEnd != null and terms.updateEnd !=''">
|
and (DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.updateStart}
|
and DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.updateEnd})
|
</if>
|
<if test="terms.syncStatus != null and terms.syncStatus !=''">
|
and sync_status = #{terms.syncStatus}
|
</if>
|
<if test="terms.oldCaseType != null and terms.oldCaseType !=''">
|
and old_case_type = #{terms.oldCaseType}
|
</if>
|
<if test="terms.oldCaseTypeName != null and terms.oldCaseTypeName !=''">
|
and old_case_type_name = #{terms.oldCaseTypeName}
|
</if>
|
<if test="terms.canalSecond != null and terms.canalSecond !=''">
|
and canal_second = #{terms.canalSecond}
|
</if>
|
<if test="terms.canalSecondName != null and terms.canalSecondName !=''">
|
and canal_second_name = #{terms.canalSecondName}
|
</if>
|
</where>
|
</if>
|
</sql>
|
<!-- 更新对象 -->
|
<update id="updateCaseInfoList">
|
update
|
<include refid="table-name"/>
|
<set>
|
<include refid="set-part"/>
|
</set>
|
<where>
|
id IN
|
<foreach item="id" collection="caseIdList" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</where>
|
</update>
|
|
<!-- 批量更新对象 -->
|
<update id="updateCaseInfo">
|
update
|
<include refid="table-name"/>
|
<set>
|
<include refid="set-part"/>
|
</set>
|
<where>
|
id = #{entity.id}
|
</where>
|
</update>
|
|
<!-- 条件更新对象 -->
|
<update id="updateCaseInfoTerms">
|
update
|
<include refid="table-name"/>
|
<set>
|
<include refid="set-part"/>
|
</set>
|
<include refid="where-part"/>
|
</update>
|
<!-- 根据编号物理删除 -->
|
<delete id="deleteCaseInfo">
|
delete from
|
<include refid="table-name"/>
|
where id = #{id}
|
</delete>
|
<!-- 根据条件查询 -->
|
<select id="listTerms" resultMap="dataResult">
|
select
|
<include refid="column-part"/>
|
from
|
<include refid="table-name"/>
|
<include refid="where-part"/>
|
</select>
|
<!-- 根据条件统计 -->
|
<select id="countTerms" resultType="java.lang.Long">
|
select
|
COUNT(1)
|
from
|
<include refid="table-name"/>
|
<include refid="where-part"/>
|
</select>
|
<!-- 根据条件分页查询 -->
|
<select id="pageTerms" resultMap="dataResult">
|
SELECT
|
<include refid="column-part"/>
|
FROM
|
<include refid="table-name"/>
|
<include refid="where-part"/>
|
<if test="page.sort != null">
|
<foreach collection="page.sort" item="s" index="index" separator="," open="order by ">
|
isnull(${s.property}), ${s.property} ${s.direction}
|
</foreach>
|
</if>
|
<if test="page.sort == null">
|
order by isnull(create_time), create_time desc
|
</if>
|
limit #{page.offset}, #{page.size}
|
</select>
|
|
|
<sql id="where-register-part">
|
<if test="terms != null">
|
<where>
|
<if test="terms.inputUnitId != null and terms.inputUnitId !=''">
|
and t1.input_unit_id = #{terms.inputUnitId}
|
</if>
|
<if test="terms.createStart != null and terms.createStart !='' and terms.createEnd != null and terms.createEnd !=''">
|
and (DATE_FORMAT(t1.create_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.createStart}
|
and DATE_FORMAT(t1.create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.createEnd})
|
</if>
|
<if test="terms.caseLevel != null and terms.caseLevel !=''">
|
and t1.case_level = #{terms.caseLevel}
|
</if>
|
<if test="terms.caseTypeFirstName != null and terms.caseTypeFirstName !=''">
|
and t1.case_type_first_name = #{caseTypeFirstName}
|
</if>
|
<if test="terms.caseType != null and terms.caseType !=''">
|
and t1.case_type = #{terms.caseType}
|
</if>
|
<if test="terms.canal != null and terms.canal !=''">
|
and t1.canal = #{terms.canal}
|
</if>
|
<if test="terms.canalName != null and terms.canalName !=''">
|
and t1.canal_name = #{terms.canalName}
|
</if>
|
<if test="terms.plaintiffs != null and terms.plaintiffs !=''">
|
and t1.plaintiffs like CONCAT('%', #{terms.plaintiffs}, '%')
|
</if>
|
<if test="terms.defendants != null and terms.defendants !=''">
|
and t1.defendants like CONCAT('%', #{terms.defendants}, '%')
|
</if>
|
<if test="terms.statusName != null and terms.statusName !=''">
|
and t1.status_name = #{terms.statusName}
|
</if>
|
<if test="terms.mediResultName != null and terms.mediResultName !=''">
|
and t2.medi_result_name = #{terms.mediResultName}
|
</if>
|
<if test="terms.mediResult != null and terms.mediResult !=''">
|
and t2.medi_result = #{terms.mediResult}
|
</if>
|
</where>
|
</if>
|
</sql>
|
|
<select id="pageTermsCaseRegister" resultType="cn.huge.module.cases.domain.dto.CaseRegisterDTO">
|
SELECT
|
t1.id as caseId,t1.create_time as createTime,t1.input_user_name as inputUserName,t1.status_name as statusName,t1.case_level as
|
caseLevel,t1.canal_name as canalName,
|
t1.case_type_first_name as caseTypeFirstName,t1.case_type_name as caseTypeName,t1.plaintiffs as
|
plaintiffs,t1.defendants as defendants,t2.medi_result_name as mediResultName,
|
t3.number as superviseCount,
|
t4.id as caseTaskId
|
FROM
|
dyh_case_info t1
|
left join dyh_case_info_unfold t2 on t1.id = t2.id
|
left join (select count(*) as number ,case_id from dyh_case_supervise group by case_id) t3 on t3.case_id=t1.id
|
left join (select id ,case_id from dyh_case_task group by case_id) t4 on t1.id = t4.case_id
|
<include refid="where-register-part"/>
|
<if test="page.sort != null">
|
<foreach collection="page.sort" item="s" index="index" separator="," open="order by ">
|
isnull(${s.property}), ${s.property} ${s.direction}
|
</foreach>
|
</if>
|
<if test="page.sort == null">
|
order by isnull(t1.create_time), t1.create_time desc
|
</if>
|
limit #{page.offset}, #{page.size}
|
</select>
|
|
|
<select id="countTermsCaseRegister" resultType="java.lang.Long" >
|
SELECT
|
count(t1.id)
|
FROM
|
dyh_case_info t1
|
left join dyh_case_info_unfold t2 on t1.id = t2.id
|
<include refid="where-register-part"/>
|
</select>
|
<!-- 根据条件统计 -->
|
<select id="countTermsAll" resultType="java.lang.Long">
|
select
|
COUNT(1)
|
from
|
dyh_case_info a LEFT JOIN dyh_case_info_unfold b on a.id = b.id
|
LEFT JOIN dyh_ct_unit c ON b.belong_unit_id = c.id
|
<include refid="where-part-all"/>
|
</select>
|
|
<!-- 根据条件分页查询 -->
|
<select id="pageTermsAll" resultMap="dataResult-all">
|
SELECT
|
<include refid="column-part-all"/>
|
FROM
|
dyh_case_info a LEFT JOIN dyh_case_info_unfold b on a.id = b.id
|
LEFT JOIN dyh_ct_unit c ON b.belong_unit_id = c.id
|
left join (select id ,case_id from dyh_case_task group by case_id) d on a.id = d.case_id
|
<include refid="where-part-all"/>
|
<if test="page.sort != null">
|
<foreach collection="page.sort" item="s" index="index" separator="," open="order by ">
|
isnull(${s.property}), ${s.property} ${s.direction}
|
</foreach>
|
</if>
|
<if test="page.sort == null">
|
order by isnull(a.create_time), a.create_time desc
|
</if>
|
limit #{page.offset}, #{page.size}
|
</select>
|
|
|
<!-- 根据条件分页查询 -->
|
<select id="pageTermsPersonAll" resultType="cn.huge.module.cases.domain.dto.CasePersonWeDTO">
|
SELECT
|
p.id,p.case_id as caseId,p.true_name as trueName,p.mobile,p.per_type as perType,p.per_type_name as perTypeName,
|
p.per_class as perClass,p.per_class_name as perClassName,p.certi_no as certiNo,p.orga_code as orgaCode,p.extreme
|
FROM dyh_case_person p
|
LEFT JOIN dyh_case_info a on a.id = p.case_id
|
LEFT JOIN dyh_case_info_unfold b on a.id = b.id
|
LEFT JOIN dyh_ct_unit c ON b.belong_unit_id = c.id
|
<include refid="where-part-all"/>
|
</select>
|
|
<!-- 根据条件分页查询 -->
|
<select id="pageTermsAgentAll" resultType="cn.huge.module.cases.domain.dto.CaseAgentWeDTO">
|
SELECT
|
p.case_id as caseId,p.true_name as trueName,p.mobile,p.per_type as perType,p.per_type_name as perTypeName,
|
p.certi_no as certiNo,P.person_id as personId
|
FROM dyh_case_agent p
|
LEFT JOIN dyh_case_info a on a.id = p.case_id
|
LEFT JOIN dyh_case_info_unfold b on a.id = b.id
|
LEFT JOIN dyh_ct_unit c ON b.belong_unit_id = c.id
|
<include refid="where-part-all"/>
|
</select>
|
|
<!-- 根据条件分页查询 -->
|
<select id="pageTermsHandleAll" resultType="cn.huge.module.cases.domain.dto.CaseHandleWeDTO">
|
SELECT
|
p.case_id as caseId,P.handle_content as handContent
|
FROM dyh_case_feedback p
|
LEFT JOIN dyh_case_info a on a.id = p.case_id
|
LEFT JOIN dyh_case_info_unfold b on a.id = b.id
|
LEFT JOIN dyh_ct_unit c ON b.belong_unit_id = c.id
|
<include refid="where-part-all"/>
|
and p.handle_type = 1 ORDER by p.update_time desc
|
</select>
|
|
|
<!-- 统计分析(区域) -->
|
<select id="statisticsArea" resultType="cn.huge.module.cases.domain.dto.CaseStatisticsAreaDTO">
|
SELECT
|
<if test='terms.areaType == null or terms.areaType =="1"'>
|
IF(c.city is null,a.que_city,c.city) as areaCode,IF(c.city_name is null,a.que_city_name,c.city_name) as areaName,
|
</if>
|
<if test='terms.areaType != null and terms.areaType =="2"'>
|
IF(c.area is null,a.que_area,c.area) as areaCode,IF(c.area_name is null,a.que_area_name,c.area_name) as areaName,
|
</if>
|
<if test='terms.areaType != null and terms.areaType =="3"'>
|
IF(c.road is null,a.que_road,c.road) as areaCode,IF(c.road_name is null,a.que_road_name,c.road_name) as areaName,
|
</if>
|
<if test='terms.areaType != null and terms.areaType =="4"'>
|
IF(c.village is null,a.que_village,c.village) as areaCode,IF(c.village_name is null,a.que_village_name,c.village_name) as areaName,
|
</if>
|
c.unit_grade as unitGrade,
|
count(1) as caseNum,
|
sum(case when b.medi_result = '22_00025-1' and a.info_process = 3 then 1 else 0 end) as resolveNum,
|
sum(case when a.info_process <![CDATA[ < ]]> 3 then 1 else 0 end) as resolveingNum,
|
sum(case when b.medi_result = '22_00025-2' and a.info_process = 3 then 1 else 0 end) as unResolveNum,
|
sum(case when a.info_process = 4 then 1 else 0 end) as rejectNum
|
FROM
|
dyh_case_info a
|
inner JOIN dyh_case_info_unfold b on a.id = b.id
|
LEFT JOIN dyh_ct_unit c ON b.belong_unit_id = c.id
|
<include refid="where-part-all"/>
|
group by areaCode
|
</select>
|
<!-- 统计分析(基础) -->
|
<select id="statisticsBase" resultType="cn.huge.module.cases.domain.dto.CaseStatisticsBaseDTO">
|
SELECT
|
count(1) as totalNum,
|
sum(case when b.medi_result = '22_00025-1' and a.info_process = 3 then 1 else 0 end) as resolveNum,
|
sum(case when a.info_process <![CDATA[ < ]]> 3 then 1 else 0 end) as resolveingNum,
|
sum(case when b.medi_result = '22_00025-2' and a.info_process = 3 then 1 else 0 end) as unResolveNum,
|
sum(case when a.case_level = 1 then 1 else 0 end) as oneLevelNum,
|
sum(case when a.case_level = 2 then 1 else 0 end) as twoLevelNum,
|
sum(case when a.case_level = 3 then 1 else 0 end) as threeLevelNum,
|
sum(case when a.info_process <![CDATA[ < ]]> 3 then 1 else 0 end) as processNum,
|
sum(case when a.info_process = 3 then 1 else 0 end) as finishNum,
|
sum(case when a.info_process = 4 then 1 else 0 end) as rejectNum
|
FROM
|
dyh_case_info a
|
inner JOIN dyh_case_info_unfold b on a.id = b.id
|
LEFT JOIN dyh_ct_unit c ON b.belong_unit_id = c.id
|
<include refid="where-part-all"/>
|
</select>
|
|
<!-- 统计分析(基础)-统计调解过程 -->
|
<select id="statisticsBaseProcess" resultType="cn.huge.module.cases.domain.dto.CaseStatisticsBaseDTO">
|
SELECT
|
count(1) as totalNum,
|
sum(case when b.medi_result = '22_00025-1' and a.info_process = 3 then 1 else 0 end) as resolveNum,
|
sum(case when a.info_process <![CDATA[ < ]]> 3 then 1 else 0 end) as resolveingNum,
|
sum(case when b.medi_result = '22_00025-2' and a.info_process = 3 then 1 else 0 end) as unResolveNum,
|
sum(case when a.case_level = 1 then 1 else 0 end) as oneLevelNum,
|
sum(case when a.case_level = 2 then 1 else 0 end) as twoLevelNum,
|
sum(case when a.case_level = 3 then 1 else 0 end) as threeLevelNum,
|
sum(case when a.info_process = 2 then 1
|
when a.info_process = 1 then 1 else 0 end) as processNum,
|
sum(case when a.info_process = 3 and b.medi_result = '22_00025-1' then 1 else 0 end) as finishNum,
|
sum(case when a.info_process = 4 then 1 else 0 end) as rejectNum,
|
sum(case when a.info_process = 3 and b.medi_result = '22_00025-2' then 1 else 0 end) as failNum
|
FROM
|
dyh_case_info a
|
inner JOIN dyh_case_info_unfold b on a.id = b.id
|
LEFT JOIN dyh_ct_unit c ON b.belong_unit_id = c.id
|
<include refid="where-part-all"/>
|
</select>
|
|
<!-- 统计分析(类型) -->
|
<select id="statisticsTypeFirst" resultType="cn.huge.module.cases.domain.dto.CaseStatisticsTypeDTO">
|
SELECT
|
a.case_type_first as caseType,a.case_type_first_name as caseTypeName,count(1) as caseNum
|
FROM
|
dyh_case_info a
|
inner JOIN dyh_case_info_unfold b on a.id = b.id
|
LEFT JOIN dyh_ct_unit c ON b.belong_unit_id = c.id
|
<include refid="where-part-all"/>
|
group by a.case_type_first
|
</select>
|
|
<!-- 统计分析(类型) -->
|
<select id="statisticsType" resultType="cn.huge.module.cases.domain.dto.CaseStatisticsTypeDTO">
|
SELECT
|
a.case_type as caseType,a.case_type_name as caseTypeName,count(1) as caseNum
|
FROM
|
dyh_case_info a
|
inner JOIN dyh_case_info_unfold b on a.id = b.id
|
LEFT JOIN dyh_ct_unit c ON b.belong_unit_id = c.id
|
<include refid="where-part-all"/>
|
group by a.case_type
|
</select>
|
|
<!-- 统计分析(来源) -->
|
<select id="statisticsSource" resultType="cn.huge.module.cases.domain.dto.CaseStatisticsSourceDTO">
|
SELECT
|
a.canal,a.canal_name as canalName,count(1) as caseNum,
|
sum(case when b.medi_result = '22_00025-1' and a.info_process = 3 then 1 else 0 end) as resolveNum,
|
sum(case when a.info_process <![CDATA[ < ]]> 3 then 1 else 0 end) as resolveingNum,
|
sum(case when b.medi_result = '22_00025-2' and a.info_process = 3 then 1 else 0 end) as unResolveNum,
|
sum(case when a.info_process = 4 then 1 else 0 end) as rejectNum
|
FROM
|
dyh_case_info a
|
inner JOIN dyh_case_info_unfold b on a.id = b.id
|
LEFT JOIN dyh_ct_unit c ON b.belong_unit_id = c.id
|
<include refid="where-part-all"/>
|
group by a.canal
|
</select>
|
|
<!-- 概览(账号) -->
|
<select id="overviewAcc" resultType="cn.huge.module.cases.domain.dto.CaseOverviewDetailDTO">
|
select
|
<if test='terms.areaType == null or terms.areaType =="1"'>
|
ifnull(t3.city_name, '本级') as areaName,ifnull(t3.city, '1') as areaCode,
|
</if>
|
<if test='terms.areaType != null and terms.areaType =="2"'>
|
ifnull(t3.area_name, '本级') as areaName,ifnull(t3.area, '1') as areaCode,
|
</if>
|
<if test='terms.areaType != null and terms.areaType =="3"'>
|
ifnull(t3.road_name, '本级') as areaName,ifnull(t3.road, '1') as areaCode,
|
</if>
|
<if test='terms.areaType != null and terms.areaType =="4"'>
|
ifnull(t3.village_name, '本级') as areaName,ifnull(t3.village, '1') as areaCode,
|
</if>
|
count(distinct case when DATE_FORMAT(t1.login_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.startDate} and
|
DATE_FORMAT(t1.login_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.endDate} and t3.unit_type = '101' then t1.id end)
|
as accLoginZzNum,
|
count(distinct case when DATE_FORMAT(t1.login_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.startDate} and
|
DATE_FORMAT(t1.login_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.endDate} and t3.unit_type != '101' then t1.id
|
end) as accLoginBmNum,
|
count(distinct case when DATE_FORMAT(t1.create_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.startDate} and
|
DATE_FORMAT(t1.create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.endDate} then t1.id end) as accAddNum
|
from dyh_ct_account t1 left join dyh_ct_user t2 on t1.user_id = t2.id
|
left join dyh_ct_unit t3 on t2.unit_id = t3.id
|
where
|
t1.delete_status = 0 and t2.delete_status = 0 and t3.delete_status = 0
|
<if test="terms.queCity != null and terms.queCity !=''">
|
and t3.city = #{terms.queCity}
|
</if>
|
<if test="terms.queArea != null and terms.queArea !=''">
|
and t3.area = #{terms.queArea}
|
</if>
|
<if test="terms.queRoad != null and terms.queRoad !=''">
|
and t3.road = #{terms.queRoad}
|
</if>
|
<if test="terms.queVillage != null and terms.queVillage !=''">
|
and t3.village = #{terms.queVillage}
|
</if>
|
group by areaCode
|
</select>
|
|
<!-- 概览(来源) -->
|
<select id="overviewSource" resultType="cn.huge.module.cases.domain.dto.CaseOverviewDetailDTO">
|
select
|
<if test='terms.areaType == null or terms.areaType =="1"'>
|
ifnull(t2.city_name, '本级') as areaName,ifnull(t2.city, '1') as areaCode,
|
</if>
|
<if test='terms.areaType != null and terms.areaType =="2"'>
|
ifnull(t2.area_name, '本级') as areaName,ifnull(t2.area, '1') as areaCode,
|
</if>
|
<if test='terms.areaType != null and terms.areaType =="3"'>
|
ifnull(t2.road_name, '本级') as areaName,ifnull(t2.road, '1') as areaCode,
|
</if>
|
<if test='terms.areaType != null and terms.areaType =="4"'>
|
ifnull(t2.village_name, '本级') as areaName,ifnull(t2.village, '1') as areaCode,
|
</if>
|
count(distinct t1.id) as caseAllNum,
|
count(distinct case when input_way = 1 and t1.canal = '22_00001-2' then t1.id end) as caseXsNum,
|
count(distinct case when input_way = 1 and t1.canal = '22_00001-1' then t1.id end) as caseDtNum,
|
count(distinct case when input_way = 1 and t1.canal = '22_00001-3' then t1.id end) as caseZxpcNum,
|
count(distinct case when input_way = 2 then t1.id end) as caseAjdrNum
|
from dyh_case_info t1
|
LEFT JOIN dyh_case_info_unfold t3 on t1.id = t3.id
|
left join dyh_ct_unit t2 on t3.belong_unit_id = t2.id
|
<where>
|
and t1.delete_status = 0
|
<if test="terms.startDate != null and terms.startDate !='' and terms.endDate != null and terms.endDate !=''">
|
and DATE_FORMAT(t1.create_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.startDate}
|
and DATE_FORMAT(t1.create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.endDate}
|
</if>
|
<if test="terms.queCity != null and terms.queCity !=''">
|
and t2.city = #{terms.queCity}
|
</if>
|
<if test="terms.queArea != null and terms.queArea !=''">
|
and t2.area = #{terms.queArea}
|
</if>
|
<if test="terms.queRoad != null and terms.queRoad !=''">
|
and t2.road = #{terms.queRoad}
|
</if>
|
<if test="terms.queVillage != null and terms.queVillage !=''">
|
and t2.village = #{terms.queVillage}
|
</if>
|
</where>
|
group by areaCode
|
</select>
|
|
<!-- 概览(流转)废弃 -->
|
<select id="overviewFlowCopy" resultType="cn.huge.module.cases.domain.dto.CaseOverviewDetailDTO">
|
select
|
<if test='terms.areaType == null or terms.areaType =="1"'>
|
ifnull(t2.city_name, '本级') as areaName,ifnull(t2.city, '1') as areaCode,
|
</if>
|
<if test='terms.areaType != null and terms.areaType =="2"'>
|
ifnull(t2.area_name, '本级') as areaName,ifnull(t2.area, '1') as areaCode,
|
</if>
|
<if test='terms.areaType != null and terms.areaType =="3"'>
|
ifnull(t2.road_name, '本级') as areaName,ifnull(t2.road, '1') as areaCode,
|
</if>
|
<if test='terms.areaType != null and terms.areaType =="4"'>
|
ifnull(t2.village_name, '本级') as areaName,ifnull(t2.village, '1') as areaCode,
|
</if>
|
count(distinct case when (t1.node_id = 'DSRPJ' or t1.node_id = 'JAGD' or t1.node_id = 'ZJ_DFP' or t1.node_id = 'QJ_DFP'
|
or t1.node_id = 'SJ_DFP' or t1.node_id = 'DFP' or t1.node_id = 'ZJ_DSL' or t1.node_id = 'QJ_DSL' or t1.node_id = 'SJ_DSL'
|
or t1.node_id = 'DSL' or t1.node_id = 'QJ_SBSH' or t1.node_id = 'SJ_SBSH' or t1.node_id = 'HTSH' or t1.node_id = 'ZJ_HTSH'
|
or t1.node_id = 'QJ_HTSH' or t1.node_id = 'SJ_HTSH')then t1.id end) as flowAllNum,
|
count(distinct case when (t1.node_id = 'ZJ_DFP' or t1.node_id = 'QJ_DFP' or t1.node_id = 'SJ_DFP' or t1.node_id = 'DFP') then t1.id end) as flowJbNum,
|
count(distinct case when (t1.node_id = 'ZJ_DSL' or t1.node_id = 'QJ_DSL' or t1.node_id = 'SJ_DSL' or t1.node_id = 'DSL') then t1.id end) as flowSlNum,
|
count(distinct case when (t1.node_id = 'QJ_SBSH' or t1.node_id = 'SJ_SBSH') then t1.id end) as flowSbNum,
|
count(distinct case when (t1.node_id = 'HTSH' or t1.node_id = 'ZJ_HTSH' or t1.node_id = 'QJ_HTSH' or t1.node_id = 'SJ_HTSH') then t1.id end) as flowHtNum,
|
count(distinct case when (t1.node_id = 'DSRPJ' or t1.node_id = 'JAGD') then t1.id end) as flowBjNum
|
from
|
(SELECT case_id, node_id, handle_time, create_time, cande_unit_id, id, status
|
FROM (
|
SELECT case_id, node_id, handle_time, create_time, cande_unit_id, id, status,
|
ROW_NUMBER() OVER (PARTITION BY case_id ORDER BY node_type desc, create_time DESC) AS rn
|
FROM dyh_case_task
|
where status = 2 or (status = 1 and (node_id = 'DSRPJ' or node_id = 'JAGD'))
|
) s
|
WHERE rn = 1 AND ((DATE_FORMAT(s.handle_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.startDate}
|
and DATE_FORMAT(s.handle_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.endDate}) OR DATE_FORMAT(s.create_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.startDate}
|
and DATE_FORMAT(s.create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.endDate}) group by s.case_id) t1
|
left join dyh_ct_unit t2 on (t1.cande_unit_id = t2.id) or (t1.cande_unit_id is null and t2.id = (select mediate_unit_id from dyh_case_info_unfold where id = t1.case_id))
|
<where>
|
<if test="terms.queCity != null and terms.queCity !=''">
|
and t2.city = #{terms.queCity}
|
</if>
|
<if test="terms.queArea != null and terms.queArea !=''">
|
and t2.area = #{terms.queArea}
|
</if>
|
<if test="terms.queRoad != null and terms.queRoad !=''">
|
and t2.road = #{terms.queRoad}
|
</if>
|
<if test="terms.queVillage != null and terms.queVillage !=''">
|
and t2.village = #{terms.queVillage}
|
</if>
|
</where>
|
group by areaCode
|
</select>
|
|
<select id="selectByLastTime" resultType="cn.huge.module.cases.domain.po.CaseInfo2">
|
select * from dyh_case_info
|
<if test="caseVo.type!=null and caseVo.type ==1">
|
where create_time >#{caseVo.lastTime}
|
</if>
|
<if test="caseVo.type!=null and caseVo.type ==2">
|
where update_time >=#{caseVo.lastTime} and create_time <![CDATA[ <= ]]> #{caseVo.lastTime}
|
</if>
|
</select>
|
|
<select id="getUnitByGridCode" resultType="cn.huge.module.cust.dto.CtUnitDTO">
|
select *
|
from dyh_ct_unit
|
where
|
unit_type = '101'
|
and delete_status = 0
|
and city = '440100'
|
<if test="terms.queryType == 1">
|
and road = #{terms.gridCode}
|
and unit_grade = 3
|
</if>
|
<if test="terms.queryType == 2">
|
and area = #{terms.gridCode}
|
and unit_grade = 2
|
</if>
|
<if test="terms.queryType == 3">
|
and unit_grade = 1
|
</if>
|
</select>
|
<!-- 概览(来源) -->
|
<select id="overviewResult" resultType="cn.huge.module.cases.domain.dto.CaseOverviewDetailDTO">
|
select
|
<if test='terms.areaType == null or terms.areaType =="1"'>
|
ifnull(t4.city_name, '本级') as areaName,ifnull(t4.city, '1') as areaCode,
|
</if>
|
<if test='terms.areaType != null and terms.areaType =="2"'>
|
ifnull(t4.area_name, '本级') as areaName,ifnull(t4.area, '1') as areaCode,
|
</if>
|
<if test='terms.areaType != null and terms.areaType =="3"'>
|
ifnull(t4.road_name, '本级') as areaName,ifnull(t4.road, '1') as areaCode,
|
</if>
|
<if test='terms.areaType != null and terms.areaType =="4"'>
|
ifnull(t4.village_name, '本级') as areaName,ifnull(t4.village, '1') as areaCode,
|
</if>
|
count(distinct case when t2.info_process = 1 or t2.info_process = 2 then t2.id end) as sourceHjzNum,
|
count(distinct case when t2.info_process = 3 and t3.medi_result = '22_00025-1' then t2.id end) as sourceHjcgNum,
|
count(distinct case when t2.info_process = 3 and t3.medi_result = '22_00025-2' then t2.id end) as sourceHjbcgNum,
|
count(distinct case when t2.info_process = 4 then t2.id end) as sourceByslNum
|
from (SELECT case_id, node_id, create_time, cande_unit_id, id, status,handle_result
|
FROM (
|
SELECT case_id, node_id, create_time, cande_unit_id, id, status,handle_result,
|
ROW_NUMBER() OVER (PARTITION BY case_id ORDER BY node_type desc, create_time DESC) AS rn
|
FROM dyh_case_task where node_id != 'DSRPJ' and delete_status = 0
|
) s
|
WHERE rn = 1 group by s.case_id)t1 left join dyh_case_info t2 on t2.id = t1.case_id left join dyh_case_info_unfold t3 on t2.id = t3.id
|
left join dyh_ct_unit t4 on t3.belong_unit_id = t4.id
|
<where>
|
and t2.delete_status = 0 and t4.delete_status = 0
|
<if test="terms.startDate != null and terms.startDate !='' and terms.endDate != null and terms.endDate !=''">
|
and DATE_FORMAT(t1.create_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.startDate}
|
and DATE_FORMAT(t1.create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.endDate}
|
</if>
|
<if test="terms.queCity != null and terms.queCity !=''">
|
and t4.city = #{terms.queCity}
|
</if>
|
<if test="terms.queArea != null and terms.queArea !=''">
|
and t4.area = #{terms.queArea}
|
</if>
|
<if test="terms.queRoad != null and terms.queRoad !=''">
|
and t4.road = #{terms.queRoad}
|
</if>
|
<if test="terms.queVillage != null and terms.queVillage !=''">
|
and t4.village = #{terms.queVillage}
|
</if>
|
</where>
|
group by areaCode
|
</select>
|
|
<!-- 概览(流转)废弃 -->
|
<select id="overviewFlow" resultType="cn.huge.module.cases.domain.dto.CaseOverviewDetailDTO">
|
select
|
<if test='terms.areaType == null or terms.areaType =="1"'>
|
ifnull(t4.city_name, '本级') as areaName,ifnull(t4.city, '1') as areaCode,
|
</if>
|
<if test='terms.areaType != null and terms.areaType =="2"'>
|
ifnull(t4.area_name, '本级') as areaName,ifnull(t4.area, '1') as areaCode,
|
</if>
|
<if test='terms.areaType != null and terms.areaType =="3"'>
|
ifnull(t4.road_name, '本级') as areaName,ifnull(t4.road, '1') as areaCode,
|
</if>
|
<if test='terms.areaType != null and terms.areaType =="4"'>
|
ifnull(t4.village_name, '本级') as areaName,ifnull(t4.village, '1') as areaCode,
|
</if>
|
count(distinct t1.id) as flowAllNum,
|
count(distinct case when t2.zxsl_status = 1 then t1.id end) as flowZxslNum,
|
count(distinct case when t2.zxsl_status = 0 and (t1.node_id = 'JAGD' or t1.node_id = 'BLFK'
|
or t1.node_id = 'JASH' or t1.node_id = 'JASH_EJ' or t1.node_id = 'JASH_YJ') then t1.id end) as flowLzslNum,
|
count(distinct case when t2.zxsl_status = 0 and (((t1.node_id = 'ZJ_DFP' or t1.node_id = 'QJ_DFP'
|
or t1.node_id = 'SJ_DFP' or t1.node_id = 'DFP' or t1.node_id = 'QJ_DSL' or t1.node_id = 'SJ_DSL'
|
or t1.node_id = 'DSL' or t1.node_id = 'ZJ_DSL')and t1.handle_result !=3)
|
or t1.node_id = 'SJ_SBSH'
|
or t1.node_id = 'SJ_HTSH' or t1.node_id = 'QJ_HTSH' or t1.node_id = 'QJ_SBSH' or t1.node_id = 'ZJ_HTSH'
|
or t1.node_id = 'JASQ' or t1.node_id = 'HTSH'
|
) then t1.id end) as flowLzzNum,
|
count(distinct case when (t2.zxsl_status = 0 and (t1.node_id = 'ZJ_DFP' or t1.node_id = 'QJ_DFP'
|
or t1.node_id = 'SJ_DFP' or t1.node_id = 'DFP' or t1.node_id = 'QJ_DSL' or t1.node_id = 'SJ_DSL'
|
or t1.node_id = 'DSL' or t1.node_id = 'ZJ_DSL')and t1.handle_result =3) then t1.id end) as flowByslNum
|
from
|
(SELECT case_id, node_id, create_time, cande_unit_id, id, status,handle_result
|
FROM (
|
SELECT case_id, node_id, create_time, cande_unit_id, id, status,handle_result,
|
ROW_NUMBER() OVER (PARTITION BY case_id ORDER BY node_type desc, create_time DESC) AS rn
|
FROM dyh_case_task where node_id != 'DSRPJ' and delete_status = 0
|
) s
|
WHERE rn = 1 AND DATE_FORMAT(s.create_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.startDate}
|
and DATE_FORMAT(s.create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.endDate} group by s.case_id) t1
|
left join dyh_case_info t2 on t1.case_id = t2.id left join dyh_case_info_unfold t3 on t2.id = t3.id
|
left join dyh_ct_unit t4 on t3.belong_unit_id = t4.id
|
<where>
|
and t4.delete_status = 0 and t2.delete_status = 0
|
<if test="terms.queCity != null and terms.queCity !=''">
|
and t4.city = #{terms.queCity}
|
</if>
|
<if test="terms.queArea != null and terms.queArea !=''">
|
and t4.area = #{terms.queArea}
|
</if>
|
<if test="terms.queRoad != null and terms.queRoad !=''">
|
and t4.road = #{terms.queRoad}
|
</if>
|
<if test="terms.queVillage != null and terms.queVillage !=''">
|
and t4.village = #{terms.queVillage}
|
</if>
|
</where>
|
group by areaCode
|
</select>
|
|
<update id="deleteCaseById">
|
update dyh_case_info set delete_status = 1,update_time = #{updateTime} where id = #{id}
|
</update>
|
|
<!-- 统计指定canal值下按canal_second分组的案件数量 -->
|
<select id="countByCanalSecond" resultType="cn.huge.module.cases.domain.dto.CaseStatisticsTypeDTO">
|
SELECT
|
a.canal_second as caseType,
|
COUNT(*) as caseNum
|
FROM
|
dyh_case_info a
|
inner JOIN dyh_case_info_unfold b on a.id = b.id
|
LEFT JOIN dyh_ct_unit c ON b.belong_unit_id = c.id
|
<include refid="where-part-all"/>
|
GROUP BY
|
a.canal_second
|
</select>
|
|
</mapper>
|