<?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: liyj
|
* @time:2022-11-08 15:29:20
|
* @version 1.0.0
|
-->
|
<mapper namespace="cn.huge.module.judic.dao.mapper.JudicInfoMapper">
|
<!-- 结果集 -->
|
<resultMap id="dataResult" type="cn.huge.module.judic.domain.po.JudicInfo">
|
<result property="id" column="id"/>
|
<result property="serieStatus" column="serie_status"/>
|
<result property="caseId" column="case_id"/>
|
<result property="judicTitle" column="judic_title"/>
|
<result property="judicNo" column="judic_no"/>
|
<result property="mediateJudicNo" column="mediate_judic_no"/>
|
<result property="applyCanal" column="apply_canal"/>
|
<result property="applyCanalName" column="apply_canal_name"/>
|
<result property="applyTime" column="apply_time"/>
|
<result property="applyUnitId" column="apply_unit_id"/>
|
<result property="applyUnitName" column="apply_unit_name"/>
|
<result property="applyUserId" column="apply_user_id"/>
|
<result property="applyUserName" column="apply_user_name"/>
|
<result property="applyContent" column="apply_content"/>
|
<result property="auditTag" column="audit_tag"/>
|
<result property="auditTaskId" column="audit_task_id"/>
|
<result property="auditTime" column="audit_time"/>
|
<result property="auditUserId" column="audit_user_id"/>
|
<result property="auditUserName" column="audit_user_name"/>
|
<result property="judicAudit" column="judic_audit"/>
|
<result property="judicAuditName" column="judic_audit_name"/>
|
<result property="judicHandle" column="judic_handle"/>
|
<result property="judicHandleName" column="judic_handle_name"/>
|
<result property="judicAuditContent" column="judic_audit_content"/>
|
<result property="courtId" column="court_id"/>
|
<result property="courtName" column="court_name"/>
|
<result property="deptId" column="dept_id"/>
|
<result property="deptName" column="dept_name"/>
|
<result property="judgeId" column="judge_id"/>
|
<result property="judgeName" column="judge_name"/>
|
<result property="judgeMobile" column="judge_mobile"/>
|
<result property="process" column="process"/>
|
<result property="processName" column="process_name"/>
|
<result property="judicStartTime" column="judic_start_time"/>
|
<result property="judicEndTime" column="judic_end_time"/>
|
<result property="judicResult" column="judic_result"/>
|
<result property="judicResultName" column="judic_result_name"/>
|
<result property="judicFalseCause" column="judic_false_cause"/>
|
<result property="judicContent" column="judic_content"/>
|
<result property="custId" column="cust_id"/>
|
<result property="deleteStatus" column="delete_status"/>
|
<result property="createTime" column="create_time"/>
|
<result property="updateTime" column="update_time"/>
|
<result property="status" column="status"/>
|
<result property="handleUnitId" column="handle_unit_id"/>
|
<result property="handleUnitName" column="handle_unit_name"/>
|
<result property="handleDeptId" column="handle_dept_id"/>
|
<result property="handleDeptName" column="handle_dept_name"/>
|
<result property="handleUserId" column="handle_user_id"/>
|
<result property="handleUserName" column="handle_user_name"/>
|
<result property="handleContent" column="handle_content"/>
|
<result property="handleTime" column="handle_time"/>
|
</resultMap>
|
<!-- 表 -->
|
<sql id='table-name'>dyh_judic_info</sql>
|
<!-- 字段 -->
|
<sql id="column-part">
|
id,
|
serie_status,
|
case_id,
|
judic_title,
|
judic_no,
|
mediate_judic_no,
|
apply_canal,
|
apply_canal_name,
|
apply_time,
|
apply_unit_id,
|
apply_unit_name,
|
apply_user_id,
|
apply_user_name,
|
apply_content,
|
audit_tag,
|
audit_task_id,
|
audit_time,
|
audit_user_id,
|
audit_user_name,
|
judic_audit,
|
judic_audit_name,
|
judic_handle,
|
judic_handle_name,
|
judic_audit_content,
|
court_id,
|
court_name,
|
dept_id,
|
dept_name,
|
judge_id,
|
judge_name,
|
judge_mobile,
|
process,
|
process_name,
|
judic_start_time,
|
judic_end_time,
|
judic_result,
|
judic_result_name,
|
judic_false_cause,
|
judic_content,
|
cust_id,
|
delete_status,
|
create_time,
|
update_time,
|
status,
|
handle_unit_id,
|
handle_unit_name,
|
handle_dept_id,
|
handle_dept_name,
|
handle_user_id,
|
handle_user_name,
|
handle_content,
|
handle_time
|
</sql>
|
<!-- 更新实体字段 -->
|
<sql id="set-part">
|
<if test="entity.serieStatus != null">serie_status = #{entity.serieStatus},</if>
|
<if test="entity.caseId != null">case_id = #{entity.caseId},</if>
|
<if test="entity.judicTitle != null">judic_title = #{entity.judicTitle},</if>
|
<if test="entity.judicNo != null">judic_no = #{entity.judicNo},</if>
|
<if test="entity.mediateJudicNo != null">mediate_judic_no = #{entity.mediateJudicNo},</if>
|
<if test="entity.applyCanal != null">apply_canal = #{entity.applyCanal},</if>
|
<if test="entity.applyCanalName != null">apply_canal_name = #{entity.applyCanalName},</if>
|
<if test="entity.applyTime != null">apply_time = #{entity.applyTime},</if>
|
<if test="entity.applyUnitId != null">apply_unit_id = #{entity.applyUnitId},</if>
|
<if test="entity.applyUnitName != null">apply_unit_name = #{entity.applyUnitName},</if>
|
<if test="entity.applyUserId != null">apply_user_id = #{entity.applyUserId},</if>
|
<if test="entity.applyUserName != null">apply_user_name = #{entity.applyUserName},</if>
|
<if test="entity.applyContent != null">apply_content = #{entity.applyContent},</if>
|
<if test="entity.auditTag != null">audit_tag = #{entity.auditTag},</if>
|
<if test="entity.auditTaskId != null">audit_task_id = #{entity.auditTaskId},</if>
|
<if test="entity.auditTime != null">audit_time = #{entity.auditTime},</if>
|
<if test="entity.auditUserId != null">audit_user_id = #{entity.auditUserId},</if>
|
<if test="entity.auditUserName != null">audit_user_name = #{entity.auditUserName},</if>
|
<if test="entity.judicAudit != null">judic_audit = #{entity.judicAudit},</if>
|
<if test="entity.judicAuditName != null">judic_audit_name = #{entity.judicAuditName},</if>
|
<if test="entity.judicHandle != null">judic_handle = #{entity.judicHandle},</if>
|
<if test="entity.judicHandleName != null">judic_handle_name = #{entity.judicHandleName},</if>
|
<if test="entity.judicAuditContent != null">judic_audit_content = #{entity.judicAuditContent},</if>
|
<if test="entity.courtId != null">court_id = #{entity.courtId},</if>
|
<if test="entity.courtName != null">court_name = #{entity.courtName},</if>
|
<if test="entity.deptId != null">dept_id = #{entity.deptId},</if>
|
<if test="entity.deptName != null">dept_name = #{entity.deptName},</if>
|
<if test="entity.judgeId != null">judge_id = #{entity.judgeId},</if>
|
<if test="entity.judgeName != null">judge_name = #{entity.judgeName},</if>
|
<if test="entity.judgeMobile != null">judge_mobile = #{entity.judgeMobile},</if>
|
<if test="entity.process != null">process = #{entity.process},</if>
|
<if test="entity.processName != null">process_name = #{entity.processName},</if>
|
<if test="entity.judicStartTime != null">judic_start_time = #{entity.judicStartTime},</if>
|
<if test="entity.judicEndTime != null">judic_end_time = #{entity.judicEndTime},</if>
|
<if test="entity.judicResult != null">judic_result = #{entity.judicResult},</if>
|
<if test="entity.judicResultName != null">judic_result_name = #{entity.judicResultName},</if>
|
<if test="entity.judicFalseCause != null">judic_false_cause = #{entity.judicFalseCause},</if>
|
<if test="entity.judicContent != null">judic_content = #{entity.judicContent},</if>
|
<if test="entity.custId != null">cust_id = #{entity.custId},</if>
|
<if test="entity.deleteStatus != null">delete_status = #{entity.deleteStatus},</if>
|
<if test="entity.createTime != null">create_time = #{entity.createTime},</if>
|
<if test="entity.updateTime != null">update_time = #{entity.updateTime},</if>
|
<if test="entity.status != null">status = #{entity.status},</if>
|
<if test="entity.handleUnitId != null">handle_unit_id = #{entity.handleUnitId},</if>
|
<if test="entity.handleUnitName != null">handle_unit_name = #{entity.handleUnitName},</if>
|
<if test="entity.handleDeptId != null">handle_dept_id = #{entity.handleDeptId},</if>
|
<if test="entity.handleDeptName != null">handle_dept_name = #{entity.handleDeptName},</if>
|
<if test="entity.handleUserId != null">handle_user_id = #{entity.handleUserId},</if>
|
<if test="entity.handleUserName != null">handle_user_name = #{entity.handleUserName},</if>
|
<if test="entity.handleContent != null">handle_content = #{entity.handleContent},</if>
|
<if test="entity.handleTime != null">handle_time = #{entity.handleTime},</if>
|
</sql>
|
<!-- 条件 -->
|
<sql id="where-part">
|
<if test="terms != null">
|
<where>
|
<if test="terms.id != null and terms.id !=''">
|
and id = #{terms.id}
|
</if>
|
<if test="terms.serieStatus != null and terms.serieStatus !=''">
|
and serie_status = #{terms.serieStatus}
|
</if>
|
<if test="terms.caseId != null and terms.caseId !=''">
|
and case_id = #{terms.caseId}
|
</if>
|
<if test="terms.judicTitle != null and terms.judicTitle !=''">
|
and judic_title = #{terms.judicTitle}
|
</if>
|
<if test="terms.judicNo != null and terms.judicNo !=''">
|
and judic_no = #{terms.judicNo}
|
</if>
|
<if test="terms.mediateJudicNo != null and terms.mediateJudicNo !=''">
|
and mediate_judic_no = #{terms.mediateJudicNo}
|
</if>
|
<if test="terms.applyCanal != null and terms.applyCanal !=''">
|
and apply_canal = #{terms.applyCanal}
|
</if>
|
<if test="terms.applyCanalName != null and terms.applyCanalName !=''">
|
and apply_canal_name = #{terms.applyCanalName}
|
</if>
|
<if test="terms.applyTime != null and terms.applyTime !=''">
|
and apply_time = #{terms.applyTime}
|
</if>
|
<if test="terms.applyUnitId != null and terms.applyUnitId !=''">
|
and apply_unit_id = #{terms.applyUnitId}
|
</if>
|
<if test="terms.applyUnitName != null and terms.applyUnitName !=''">
|
and apply_unit_name = #{terms.applyUnitName}
|
</if>
|
<if test="terms.applyUserId != null and terms.applyUserId !=''">
|
and apply_user_id = #{terms.applyUserId}
|
</if>
|
<if test="terms.applyUserName != null and terms.applyUserName !=''">
|
and apply_user_name = #{terms.applyUserName}
|
</if>
|
<if test="terms.applyContent != null and terms.applyContent !=''">
|
and apply_content = #{terms.applyContent}
|
</if>
|
<if test="terms.auditTag != null and terms.auditTag !=''">
|
and audit_tag = #{terms.auditTag}
|
</if>
|
<if test="terms.auditTaskId != null and terms.auditTaskId !=''">
|
and audit_task_id = #{terms.auditTaskId}
|
</if>
|
<if test="terms.auditTime != null and terms.auditTime !=''">
|
and audit_time = #{terms.auditTime}
|
</if>
|
<if test="terms.auditUserId != null and terms.auditUserId !=''">
|
and audit_user_id = #{terms.auditUserId}
|
</if>
|
<if test="terms.auditUserName != null and terms.auditUserName !=''">
|
and audit_user_name = #{terms.auditUserName}
|
</if>
|
<if test="terms.judicAudit != null and terms.judicAudit !=''">
|
and judic_audit = #{terms.judicAudit}
|
</if>
|
<if test="terms.judicAuditName != null and terms.judicAuditName !=''">
|
and judic_audit_name = #{terms.judicAuditName}
|
</if>
|
<if test="terms.judicHandle != null and terms.judicHandle !=''">
|
and judic_handle = #{terms.judicHandle}
|
</if>
|
<if test="terms.judicHandleName != null and terms.judicHandleName !=''">
|
and judic_handle_name = #{terms.judicHandleName}
|
</if>
|
<if test="terms.judicAuditContent != null and terms.judicAuditContent !=''">
|
and judic_audit_content = #{terms.judicAuditContent}
|
</if>
|
<if test="terms.courtId != null and terms.courtId !=''">
|
and court_id = #{terms.courtId}
|
</if>
|
<if test="terms.courtName != null and terms.courtName !=''">
|
and court_name = #{terms.courtName}
|
</if>
|
<if test="terms.deptId != null and terms.deptId !=''">
|
and dept_id = #{terms.deptId}
|
</if>
|
<if test="terms.deptName != null and terms.deptName !=''">
|
and dept_name = #{terms.deptName}
|
</if>
|
<if test="terms.judgeId != null and terms.judgeId !=''">
|
and judge_id = #{terms.judgeId}
|
</if>
|
<if test="terms.judgeName != null and terms.judgeName !=''">
|
and judge_name = #{terms.judgeName}
|
</if>
|
<if test="terms.judgeMobile != null and terms.judgeMobile !=''">
|
and judge_mobile = #{terms.judgeMobile}
|
</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.judicStartTime != null and terms.judicStartTime !=''">
|
and judic_start_time = #{terms.judicStartTime}
|
</if>
|
<if test="terms.judicEndTime != null and terms.judicEndTime !=''">
|
and judic_end_time = #{terms.judicEndTime}
|
</if>
|
<if test="terms.judicResult != null and terms.judicResult !=''">
|
and judic_result = #{terms.judicResult}
|
</if>
|
<if test="terms.judicResultName != null and terms.judicResultName !=''">
|
and judic_result_name = #{terms.judicResultName}
|
</if>
|
<if test="terms.judicFalseCause != null and terms.judicFalseCause !=''">
|
and judic_false_cause = #{terms.judicFalseCause}
|
</if>
|
<if test="terms.judicContent != null and terms.judicContent !=''">
|
and judic_content = #{terms.judicContent}
|
</if>
|
<if test="terms.custId != null and terms.custId !=''">
|
and cust_id = #{terms.custId}
|
</if>
|
<if test="terms.deleteStatus = null and terms.deleteStatus =''">
|
and delete_status = '1'
|
</if>
|
<if test="terms.deleteStatus != null and terms.deleteStatus !=''">
|
and delete_status = #{terms.deleteStatus}
|
</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>
|
</where>
|
</if>
|
</sql>
|
<!-- 更新对象 -->
|
<update id="updateJudicInfo">
|
update
|
<include refid="table-name"/>
|
<set>
|
<include refid="set-part"/>
|
</set>
|
<where>
|
id = #{entity.id}
|
</where>
|
</update>
|
<!-- 条件更新对象 -->
|
<update id="updateJudicInfoTerms">
|
update
|
<include refid="table-name"/>
|
<set>
|
<include refid="set-part"/>
|
</set>
|
<include refid="where-part"/>
|
</update>
|
<!-- 根据编号物理删除 -->
|
<delete id="deleteJudicInfo">
|
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="getById" resultMap="dataResult">
|
select
|
<include refid="column-part"/>
|
from
|
<include refid="table-name" />
|
where id = #{id}
|
</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="unitApply-where-part">
|
<if test="terms != null">
|
<where>
|
<if test="terms.plaintiffs != null and terms.plaintiffs !=''">
|
and (t2.plaintiffs like concat('%',#{terms.plaintiffs},'%') or t2.pagents like concat('%',#{terms.plaintiffs},'%'))
|
</if>
|
<if test="terms.defendants != null and terms.defendants !=''">
|
and (defendants like concat('%',#{terms.defendants},'%') or dagents like concat('%',#{terms.defendants},'%'))
|
</if>
|
<if test="terms.applyStart != null and terms.applyStart !='' and terms.applyEnd != null and terms.applyEnd !=''">
|
and (DATE_FORMAT(t1.apply_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.applyStart}
|
and DATE_FORMAT(t1.apply_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.applyEnd})
|
</if>
|
<if test="terms.auditResult != null and terms.auditResult !=''">
|
and t1.judic_audit = #{terms.auditResult}
|
</if>
|
<if test="terms.addr != null and terms.addr !=''">
|
AND CONCAT(
|
IFNULL( t2.prov_name, '' ),
|
IFNULL( t2.city_name, '' ),
|
IFNULL( t2.area_name, '' ),
|
IFNULL( t2.road_name, '' ),
|
IFNULL( t2.village_name, '' ),
|
IFNULL( t2.addr, '' )) like concat('%',#{terms.addr},'%')
|
</if>
|
<if test="terms.caseNo != null and terms.caseNo !=''">
|
and t2.case_no like concat('%',#{terms.caseNo},'%')
|
</if>
|
<if test="terms.applyUnitId != null and terms.applyUnitId !=''">
|
and t1.apply_unit_id = #{terms.applyUnitId}
|
</if>
|
<if test="terms.deleteStatus = null and terms.deleteStatus =''">
|
and t1.delete_status = '1' and t2.delete_status = '1'
|
</if>
|
</where>
|
</if>
|
</sql>
|
<!-- 调解组织司法确认申请列表-统计 -->
|
<select id="countUnitApplyTerms" resultType="java.lang.Long">
|
SELECT
|
COUNT(distinct t1.id)
|
FROM dyh_judic_info t1
|
LEFT JOIN dyh_case_info t2 ON t1.case_id = t2.id
|
<include refid="unitApply-where-part"/>
|
</select>
|
|
<!-- 查询调解组织司法确认申请列表各种状态数量 -->
|
<select id="countUnitApplyByStatus" resultType="map">
|
select
|
count(distinct t1.id) as zs,
|
count(distinct case when t1.judic_status in ('22_00029-1', '22_00029-3', '22_00029-4') then t1.id end) zc,
|
count(distinct case when t1.judic_status = '22_00029-2' then t1.id end) th,
|
count(distinct case when t1.judic_status = '22_00029-5' then t1.id end) bysl,
|
count(distinct case when t1.judic_status = '22_00029-6' then t1.id end) yczz
|
FROM dyh_judic_info t1
|
LEFT JOIN dyh_case_info t2 ON t1.case_id = t2.serie_no
|
<include refid="unitApply-where-part"/>
|
</select>
|
|
|
<sql id="successCase-where-part">
|
<if test="terms != null">
|
<where>
|
<if test="terms.plaintiffs != null and terms.plaintiffs !=''">
|
and (plaintiffs like concat('%',#{terms.plaintiffs},'%') or pagents like concat('%',#{terms.plaintiffs},'%'))
|
</if>
|
<if test="terms.defendants != null and terms.defendants !=''">
|
and (defendants like concat('%',#{terms.defendants},'%') or dagents like concat('%',#{terms.defendants},'%'))
|
</if>
|
<if test="terms.mediEndStart != null and terms.mediEndStart !='' and terms.mediEndEnd != null and terms.mediEndEnd !=''">
|
and (DATE_FORMAT(medi_end_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.mediEndStart}
|
and DATE_FORMAT(medi_end_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.mediEndEnd})
|
</if>
|
<if test="terms.mediateUserName != null and terms.mediateUserName !=''">
|
and mediator like concat('%',#{terms.mediateUserName},'%')
|
</if>
|
<if test="terms.addr != null and terms.addr !=''">
|
AND CONCAT(
|
IFNULL( prov_name, '' ),
|
IFNULL( city_name, '' ),
|
IFNULL( area_name, '' ),
|
IFNULL( road_name, '' ),
|
IFNULL( village_name, '' ),
|
IFNULL( addr, '' )) like concat('%',#{terms.addr},'%')
|
</if>
|
<if test="terms.caseNo != null and terms.caseNo !=''">
|
and case_no like concat('%',#{terms.caseNo},'%')
|
</if>
|
<if test="terms.judicApply != null and terms.judicApply !=''">
|
and judic_apply = #{terms.judicApply}
|
</if>
|
<if test="terms.mediResult != null and terms.mediResult !=''">
|
and medi_result = #{terms.mediResult}
|
</if>
|
<if test="terms.mediateUnitId != null and terms.mediateUnitId !=''">
|
and mediate_unit_id = #{terms.mediateUnitId}
|
</if>
|
</where>
|
</if>
|
</sql>
|
|
|
<resultMap id="dataResult-all" type="cn.huge.module.judic.domain.dto.CaseJudicPageDTO">
|
<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="caseLevel" column="case_level"/>
|
<result property="caseType" column="case_type"/>
|
<result property="caseTypeName" column="case_type_name"/>
|
<result property="caseRef" column="case_ref"/>
|
<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="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="judicApply" column="judic_apply"/>
|
<result property="judicResult" column="judic_result"/>
|
<result property="judicResultName" column="judic_result_name"/>
|
<result property="mediator" column="mediator"/>
|
<result property="applyTime" column="apply_time"/>
|
<result property="applyUnitName" column="apply_unit_name"/>
|
<result property="judgeName" column="judge_name"/>
|
<result property="applyContent" column="apply_content"/>
|
<result property="judicId" column="judic_id"/>
|
<result property="judicNo" column="judic_no"/>
|
<result property="caseId" column="case_id"/>
|
<result property="courtName" column="court_name"/>
|
<result property="judicAudit" column="judic_audit"/>
|
<result property="judicAuditName" column="judic_audit_name"/>
|
<result property="status" column="status"/>
|
<result property="processName" column="process_name"/>
|
<result property="process" column="process"/>
|
<result property="auditTime" column="audit_time"/>
|
<result property="handleUserName" column="handle_user_name"/>
|
<result property="judicEndTime" column="judic_end_time"/>
|
<result property="waitHours" column="wait_hours"/>
|
|
</resultMap>
|
|
<sql id="column-part-all">
|
a.id,
|
a.id as case_id,
|
a.status_name,
|
a.canal,
|
a.canal_name,
|
a.case_level,
|
a.case_type,
|
a.case_type_name,
|
a.case_ref,
|
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,
|
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.judic_apply,
|
b.mediator,
|
d.id as caseTaskId,
|
j.apply_time,
|
j.court_name,
|
j.judic_audit,
|
j.judic_audit_name,
|
j.judic_result,
|
j.judic_result_name,
|
j.status,
|
j.process,
|
j.process_name,
|
j.judic_result_name,
|
j.apply_unit_name
|
</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.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.caseRef != null and terms.caseRef !=''">
|
and a.case_ref like CONCAT('%', #{terms.caseRef}, '%')
|
</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') <![CDATA[ >= ]]> #{terms.createStart}
|
and DATE_FORMAT(a.create_time,'%Y-%m-%d') <![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') <![CDATA[ >= ]]> #{terms.closeStart}
|
and DATE_FORMAT(b.close_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.closeEnd})
|
</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.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.belongUnitId != null and terms.belongUnitId !=''">
|
and b.belong_unit_id = #{terms.belongUnitId}
|
</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.judicApply != null and terms.judicApply !=''">
|
and b.judic_apply = #{terms.judicApply}
|
</if>
|
<if test='terms.mediResult != null and terms.mediResult =="1"'>
|
and a.info_process <![CDATA[ < ]]> 3
|
</if>
|
<if test="terms.infoProcess != null and terms.infoProcess !=''">
|
and a.info_process = #{terms.infoProcess}
|
</if>
|
<if test="terms.judicResult != null and terms.judicResult !=''">
|
and j.judic_result = #{terms.judicResult}
|
</if>
|
|
</where>
|
</if>
|
</sql>
|
|
<!-- 查询平台内调解成功案件-统计 -->
|
<select id="countSuccessCaseTerms" 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
|
LEFT JOIN (
|
SELECT j1.* FROM dyh_judic_info j1 INNER JOIN (
|
SELECT case_id, MAX(create_time) AS max_create_time FROM dyh_judic_info WHERE delete_status = '0' GROUP BY case_id
|
) j2 ON j1.case_id = j2.case_id AND j1.create_time = j2.max_create_time WHERE j1.delete_status = '0'
|
) j ON a.id = j.case_id
|
<include refid="where-part-all"/>
|
</select>
|
|
<!-- 查询平台内调解成功案件-分页查询 -->
|
<select id="pageSuccessCaseTerms" 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 j1.* FROM dyh_judic_info j1 INNER JOIN (
|
SELECT case_id, MAX(create_time) AS max_create_time FROM dyh_judic_info WHERE delete_status = '0' GROUP BY case_id
|
) j2 ON j1.case_id = j2.case_id AND j1.create_time = j2.max_create_time WHERE j1.delete_status = '0'
|
) j ON a.id = j.case_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>
|
|
|
<!-- 司法确认总览列表-条件 -->
|
<sql id="judicTotal-where-part">
|
<if test="terms != null">
|
<where>
|
<if test="terms.plaintiffs != null and terms.plaintiffs !=''">
|
and (t2.plaintiffs like concat('%', #{terms.plaintiffs}, '%') or t2.pagents like concat('%', #{terms.plaintiffs}, '%'))
|
</if>
|
<if test="terms.defendants != null and terms.defendants !=''">
|
and (t2.defendants like concat('%', #{terms.defendants}, '%') or dagents like concat('%', #{terms.defendants}, '%'))
|
</if>
|
<if test="terms.applyStart != null and terms.applyStart !='' and terms.applyEnd != null and terms.applyEnd !=''">
|
and (DATE_FORMAT(t1.apply_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.applyStart}
|
and DATE_FORMAT(t1.apply_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.applyEnd})
|
</if>
|
<if test="terms.judicNo != null and terms.judicNo !=''">
|
and t1.judic_no like concat('%', #{terms.judicNo}, '%')
|
</if>
|
<if test="terms.process != null and terms.process !=''">
|
and t1.process = #{terms.process}
|
</if>
|
<if test="terms.judicResult != null and terms.judicResult !=''">
|
and t1.judic_result = #{terms.judicResult}
|
</if>
|
<if test="terms.mediateJudicNo != null and terms.mediateJudicNo !=''">
|
and t1.mediate_judic_no like concat('%', #{terms.mediateJudicNo}, '%')
|
</if>
|
<if test="terms.addr != null and terms.addr !=''">
|
AND CONCAT(
|
IFNULL( t2.prov_name, '' ),
|
IFNULL( t2.city_name, '' ),
|
IFNULL( t2.area_name, '' ),
|
IFNULL( t2.road_name, '' ),
|
IFNULL( t2.village_name, '' ),
|
IFNULL( t2.addr, '' )) like concat('%',#{terms.addr},'%')
|
</if>
|
<if test="terms.courtName != null and terms.courtName !=''">
|
and t1.court_name like concat('%', #{terms.courtName}, '%')
|
</if>
|
<if test="terms.mediateUnitName != null and terms.mediateUnitName !=''">
|
and t1.mediate_unit_name like concat('%', #{terms.mediateUnitName}, '%')
|
</if>
|
<if test="terms.caseNo != null and terms.caseNo !=''">
|
and t2.case_no like concat('%', #{terms.caseNo}, '%')
|
</if>
|
<if test="terms.caseType != null and terms.caseType !=''">
|
and t2.case_type = #{terms.caseType}
|
</if>
|
<if test="terms.judgeName != null and terms.judgeName !=''">
|
and t1.judge_name like concat('%', #{terms.judgeName}, '%')
|
</if>
|
|
<if test="terms.applyUnitId != null and terms.applyUnitId !=''">
|
and t1.apply_unit_id = #{terms.applyUnitId}
|
</if>
|
<if test="terms.courtId != null and terms.courtId !=''">
|
and t1.court_id = #{terms.courtId}
|
</if>
|
<if test="terms.judgeId != null and terms.judgeId !=''">
|
and t1.judge_id = #{terms.judgeId}
|
</if>
|
<if test="terms.deleteStatus = null and terms.deleteStatus =''">
|
and t1.delete_status = '1' and t2.delete_status = '1'
|
</if>
|
</where>
|
</if>
|
</sql>
|
<!-- 司法确认总览列表-统计 -->
|
<select id="countJudicTotalTerms" resultType="java.lang.Long">
|
SELECT
|
COUNT(distinct t1.id)
|
FROM dyh_judic_info t1
|
LEFT JOIN dyh_case_info t2 ON t1.case_id = t2.serie_no
|
<include refid="judicTotal-where-part"/>
|
</select>
|
|
<select id="countProcess" resultType="map">
|
select
|
count(distinct id) countZsProcess,
|
count(distinct id) countTjcgResult,
|
count(distinct case when (judic_result = '22_00028-1' and process = '22_00029-4') then id end) countSfqrJudic,
|
0 as countTjzProcess,
|
0 as countTjsbResult
|
from dyh_judic_info
|
where delete_status = 1
|
<if test="terms != null">
|
<if test="terms.courtId != null and terms.courtId !=''">
|
and court_id = #{terms.courtId}
|
</if>
|
<if test="terms.courtIds != null and terms.courtIds !=''">
|
and court_id in ( ${terms.courtIds} )
|
</if>
|
<if test="terms.judgeId != null and terms.judgeId !=''">
|
and judge_id = #{terms.judgeId}
|
</if>
|
<if test="terms.custId != null and terms.custId !=''">
|
and cust_id = #{terms.custId}
|
</if>
|
<if test="terms.notPower != null and terms.notPower !=''">
|
and judge_id = #{terms.notPower}
|
</if>
|
</if>
|
</select>
|
|
<!-- 工作台-工作统计(近一年的数据) -->
|
<select id="countOneYear" resultType="map">
|
SELECT a.allDate, IFNULL(b.zs,0) AS zs, IFNULL(b.wdc,0) AS wdc, IFNULL(b.ydc,0) AS ydc
|
FROM
|
(SELECT
|
DATE_FORMAT(DATEADD(MONTH, ROW_NUMBER() OVER (ORDER BY NULL) -1 - 12, CURRENT_DATE) ,'%Y-%m')AS allDate
|
FROM
|
(SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5
|
UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL SELECT 10
|
UNION ALL SELECT 11 UNION ALL SELECT 12 UNION ALL SELECT 13)) a
|
LEFT JOIN (
|
SELECT COUNT(DISTINCT id) AS zs,
|
COUNT(DISTINCT CASE WHEN judic_result = '22_00028-1' THEN id END) AS ydc,
|
COUNT(DISTINCT CASE WHEN judic_result = '22_00028-2' THEN id END) AS wdc,
|
DATE_FORMAT(create_time, '%Y-%m') AS pdate
|
FROM dyh_judic_info
|
WHERE DATE_SUB(CURDATE(), INTERVAL '1' YEAR) <![CDATA[ <= ]]> create_time
|
<if test="terms != null">
|
<if test="terms.courtId != null and terms.courtId !=''">
|
and court_id = #{terms.courtId}
|
</if>
|
<if test="terms.courtIds != null and terms.courtIds !=''">
|
and court_id in ( ${terms.courtIds} )
|
</if>
|
<if test="terms.judgeId != null and terms.judgeId !=''">
|
and judge_id = #{terms.judgeId}
|
</if>
|
<if test="terms.custId != null and terms.custId !=''">
|
and cust_id = #{terms.custId}
|
</if>
|
<if test="terms.notPower != null and terms.notPower !=''">
|
and judge_id = #{terms.notPower}
|
</if>
|
</if>
|
GROUP BY
|
DATE_FORMAT(create_time, '%Y-%m')
|
) b ON a.allDate = b.pdate
|
ORDER BY a.allDate
|
</select>
|
|
<!-- 当事人小程序我的司法确认-条件 -->
|
<sql id="wechatMyJudic-where-part">
|
<if test="terms != null">
|
<if test="terms.process != null and terms.process !=''">
|
and t1.process = #{terms.process}
|
</if>
|
<if test="terms.plaintiffs != null and terms.plaintiffs !=''">
|
and (t2.plaintiffs like concat('%',#{terms.plaintiffs},'%') or t2.pagents like concat('%',#{terms.plaintiffs},'%'))
|
</if>
|
<if test="terms.defendants != null and terms.defendants !=''">
|
and (t2.defendants like concat('%',#{terms.defendants},'%') or t2.dagents like concat('%',#{terms.defendants},'%'))
|
</if>
|
<if test="terms.custId != null and terms.custId !=''">
|
and t1.cust_id = #{terms.custId}
|
</if>
|
</if>
|
</sql>
|
|
<!-- 当事人小程序我的司法确认-统计 -->
|
<select id="countWechatMyJudicTerms" resultType="java.lang.Long">
|
SELECT COUNT(distinct t1.id)
|
FROM dyh_judic_info t1 left join dyh_case_info t2 on t1.case_id = t2.id
|
WHERE (
|
t2.id IN (SELECT case_id FROM dyh_case_person WHERE per_type = #{terms.perType} AND party_user_id = #{terms.partyUserId})
|
OR t2.id IN (SELECT case_id FROM dyh_case_agent WHERE per_type = #{terms.perType} AND party_user_id = #{terms.partyUserId})
|
)
|
and t1.delete_status = '1'
|
<include refid="wechatMyJudic-where-part"/>
|
</select>
|
|
<!-- 司法确认申请审查列表-条件 -->
|
<sql id="courtAudit-where-part">
|
<if test="terms != null">
|
<where>
|
<if test="terms.plaintiffs != null and terms.plaintiffs !=''">
|
and t2.plaintiffs like concat('%', #{terms.plaintiffs}, '%')
|
</if>
|
<if test="terms.defendants != null and terms.defendants !=''">
|
and t2.defendants like concat('%', #{terms.defendants}, '%')
|
</if>
|
<if test="terms.applyStart != null and terms.applyStart !='' and terms.applyEnd != null and terms.applyEnd !=''">
|
and (DATE_FORMAT(t1.apply_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.applyStart}
|
and DATE_FORMAT(t1.apply_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.applyEnd})
|
</if>
|
<if test="terms.auditStart != null and terms.auditStart !='' and terms.auditEnd != null and terms.auditEnd !=''">
|
and (DATE_FORMAT(t1.audit_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.auditStart}
|
and DATE_FORMAT(t1.audit_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.auditEnd})
|
</if>
|
<if test="terms.closeStart != null and terms.closeStart !='' and terms.closeEnd != null and terms.closeEnd !=''">
|
and (DATE_FORMAT(t3.close_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.closeStart}
|
and DATE_FORMAT(t3.close_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.closeEnd})
|
</if>
|
<if test="terms.judicEndStart != null and terms.judicEndStart !='' and terms.judicEndEnd != null and terms.judicEndEnd !=''">
|
and (DATE_FORMAT(t1.judic_end_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.judicEndStart}
|
and DATE_FORMAT(t1.judic_end_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.judicEndEnd})
|
</if>
|
<if test="terms.applyUnitName != null and terms.applyUnitName !=''">
|
and t1.apply_unit_name like concat('%', #{terms.applyUnitName}, '%')
|
</if>
|
<if test="terms.addr != null and terms.addr !=''">
|
AND CONCAT(
|
IFNULL( t2.prov_name, '' ),
|
IFNULL( t2.city_name, '' ),
|
IFNULL( t2.area_name, '' ),
|
IFNULL( t2.road_name, '' ),
|
IFNULL( t2.village_name, '' ),
|
IFNULL( t2.addr, '' )) like concat('%',#{terms.addr},'%')
|
</if>
|
<if test="terms.caseNo != null and terms.caseNo !=''">
|
and t2.case_no like concat('%', #{terms.caseNo}, '%')
|
</if>
|
<if test="terms.judicNo != null and terms.judicNo !=''">
|
and t1.judic_no like concat('%', #{terms.judicNo}, '%')
|
</if>
|
<if test="terms.handleUnitId != null and terms.handleUnitId !=''">
|
and t1.handle_unit_id = #{terms.handlerUnitId}
|
</if>
|
<if test="terms.handleDeptId != null and terms.handleDeptId !=''">
|
and t1.handle_dept_id = #{terms.handlerDeptId}
|
</if>
|
<if test="terms.handleUserId != null and terms.handleUserId !=''">
|
and t1.handle_user_id = #{terms.handlerUserId}
|
</if>
|
<if test="terms.doUnit != null and terms.doUnit !=''">
|
and t1.handle_unit_id = #{terms.doUnit}
|
</if>
|
<if test="terms.status != null and terms.status !=''">
|
and t1.status = #{terms.status}
|
</if>
|
<if test="terms.judicAudit != null and terms.judicAudit !=''">
|
and t1.judic_audit = #{terms.judicAudit}
|
</if>
|
<if test="terms.judicResult != null and terms.judicResult !=''">
|
and t1.judic_result = #{terms.judicResult}
|
</if>
|
<if test="terms.assUserId != null and terms.assUserId !=''">
|
and t4.ass_user_id = #{terms.assUserId}
|
</if>
|
<if test="terms.deleteStatus = null and terms.deleteStatus =''">
|
and t1.delete_status = '0'
|
</if>
|
<if test="terms.processList != null and terms.processList.size > 0 ">
|
and t1.process in
|
<foreach item="process" collection="terms.processList" separator="," open="(" close=")" index="">
|
#{process}
|
</foreach>
|
</if>
|
</where>
|
</if>
|
</sql>
|
|
<!-- 司法确认申请审查 -->
|
<select id="countCourtAuditTerms" resultType="java.lang.Long">
|
SELECT
|
COUNT(distinct t1.id)
|
FROM dyh_judic_info t1
|
LEFT JOIN dyh_case_info t2 ON t1.case_id = t2.id
|
LEFT JOIN dyh_case_info_unfold t3 ON t1.case_id = t3.id
|
<include refid="courtAudit-where-part"/>
|
</select>
|
<!-- 司法确认申请审查/历史列表-分页查询 -->
|
<select id="pageCourtAuditTerms" resultMap="dataResult-all">
|
SELECT
|
t1.id,
|
t1.apply_time,
|
t1.handle_time as finish_time,
|
t1.apply_unit_name,
|
t1.apply_content,
|
t2.id as case_id,
|
t2.case_type_name,
|
t2.case_type_first_name,
|
t2.plaintiffs,
|
t2.defendants,
|
t3.mediate_unit_name,
|
t3.mediator,
|
t1.judge_name,
|
t1.id as judic_id,
|
t1.audit_time,
|
t1.handle_user_name,
|
t1.judic_audit,
|
t1.judic_audit_name,
|
t1.judic_no,
|
d.id as caseTaskId
|
FROM dyh_judic_info t1
|
LEFT JOIN dyh_case_info t2 ON t1.case_id = t2.id
|
LEFT JOIN dyh_case_info_unfold t3 ON t1.case_id = t3.id
|
left join (select id ,case_id from dyh_case_task group by case_id) d on t1.case_id = d.case_id
|
<include refid="courtAudit-where-part"/>
|
group by t1.id
|
<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.apply_time), t1.apply_time desc
|
</if>
|
limit #{page.offset}, #{page.size}
|
</select>
|
|
<!-- 司法确认申请审查 -->
|
<select id="countCourtConfirmTerms" resultType="java.lang.Long">
|
SELECT
|
COUNT(distinct t1.id)
|
FROM dyh_judic_info t1
|
LEFT JOIN dyh_case_info t2 ON t1.case_id = t2.id
|
LEFT JOIN dyh_case_info_unfold t3 ON t1.case_id = t3.id
|
LEFT JOIN dyh_judic_assist t4 ON t1.id = t4.judic_id
|
<include refid="courtAudit-where-part"/>
|
</select>
|
<!-- 司法确认申请审查/历史列表-分页查询 -->
|
<select id="pageCourtConfirmTerms" resultMap="dataResult-all">
|
SELECT
|
t1.id,
|
t1.apply_time,
|
t1.handle_time as finish_time,
|
t1.apply_unit_name,
|
t1.apply_content,
|
t2.case_type_name,
|
t2.case_type_first_name,
|
t2.plaintiffs,
|
t2.defendants,
|
t3.mediate_unit_name,
|
t3.mediator,
|
t1.judge_name,
|
t1.judic_no,
|
t1.case_id,
|
t1.id as judic_id,
|
t1.judic_end_time,
|
t1.judic_result,
|
t1.judic_result_name,
|
d.id as caseTaskId,
|
DATEDIFF(HOUR, judic_start_time,SYSDATE)+8 AS wait_hours
|
FROM dyh_judic_info t1
|
LEFT JOIN dyh_case_info t2 ON t1.case_id = t2.id
|
LEFT JOIN dyh_case_info_unfold t3 ON t1.case_id = t3.id
|
LEFT JOIN dyh_judic_assist t4 ON t1.id = t4.judic_id
|
left join (select id ,case_id from dyh_case_task group by case_id) d on t2.id = d.case_id
|
<include refid="courtAudit-where-part"/>
|
group by t1.id
|
<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.apply_time), t1.apply_time desc
|
</if>
|
limit #{page.offset}, #{page.size}
|
</select>
|
|
<!-- 获取再次申请已生成的申请单 -->
|
<select id="getCopyJudicInfo" resultMap="dataResult">
|
select
|
<include refid="column-part"/>
|
from
|
<include refid="table-name" />
|
where case_id = #{caseId} and delete_status = '2' order by create_time desc limit 1
|
</select>
|
|
<!-- 获取再次申请已生成的申请单 -->
|
<select id="listIdByCaseId" resultType="java.lang.String">
|
select id from
|
<include refid="table-name" />
|
where case_id = #{caseId} and delete_status = '0' order by create_time asc
|
</select>
|
|
|
</mapper>
|