<?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: zhouxt
|
* @time:2024-12-30 10:58:12
|
* @version 1.0.0
|
-->
|
<mapper namespace="cn.huge.module.byjudic.dao.mapper.JudicInfoMapper">
|
<!-- 结果集 -->
|
<resultMap id="dataResult" type="cn.huge.module.byjudic.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"/>
|
</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
|
</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>
|
</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="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>
|
|
</mapper>
|