<?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:11
|
* @version 1.0.0
|
-->
|
<mapper namespace="cn.huge.module.byjudic.dao.mapper.JudicTaskMapper">
|
<!-- 结果集 -->
|
<resultMap id="dataResult" type="cn.huge.module.byjudic.domain.po.JudicTask">
|
<result property="id" column="id"/>
|
<result property="judicId" column="judic_id"/>
|
<result property="caseId" column="case_id"/>
|
<result property="serieStatus" column="serie_status"/>
|
<result property="flowId" column="flow_id"/>
|
<result property="processInstanceId" column="process_instance_id"/>
|
<result property="processTaskId" column="process_task_id"/>
|
<result property="taskNode" column="task_node"/>
|
<result property="taskNodeName" column="task_node_name"/>
|
<result property="taskNodeType" column="task_node_type"/>
|
<result property="taskType" column="task_type"/>
|
<result property="handlerUnitId" column="handler_unit_id"/>
|
<result property="handlerUnitName" column="handler_unit_name"/>
|
<result property="handlerDeptId" column="handler_dept_id"/>
|
<result property="handlerDeptName" column="handler_dept_name"/>
|
<result property="handlerRoleCode" column="handler_role_code"/>
|
<result property="handlerRoleName" column="handler_role_name"/>
|
<result property="handlerUserId" column="handler_user_id"/>
|
<result property="handlerUserName" column="handler_user_name"/>
|
<result property="expireTime" column="expire_time"/>
|
<result property="status" column="status"/>
|
<result property="handleResult" column="handle_result"/>
|
<result property="errorCause" column="error_cause"/>
|
<result property="errorCauseName" column="error_cause_name"/>
|
<result property="handleContent" column="handle_content"/>
|
<result property="finishTime" column="finish_time"/>
|
<result property="mediateJudicNo" column="mediate_judic_no"/>
|
<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="judicResult" column="judic_result"/>
|
<result property="judicResultName" column="judic_result_name"/>
|
<result property="judicFalseCause" column="judic_false_cause"/>
|
<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="nextUserId" column="next_user_id"/>
|
<result property="nextUserName" column="next_user_name"/>
|
<result property="lastTaskId" column="last_task_id"/>
|
<result property="lastUnitId" column="last_unit_id"/>
|
<result property="lastUnitName" column="last_unit_name"/>
|
<result property="lastDeptId" column="last_dept_id"/>
|
<result property="lastDeptName" column="last_dept_name"/>
|
<result property="lastUserId" column="last_user_id"/>
|
<result property="lastUserName" column="last_user_name"/>
|
<result property="lastContent" column="last_content"/>
|
</resultMap>
|
<!-- 表 -->
|
<sql id='table-name'>dyh_judic_task</sql>
|
<!-- 字段 -->
|
<sql id="column-part">
|
id,
|
judic_id,
|
case_id,
|
serie_status,
|
flow_id,
|
process_instance_id,
|
process_task_id,
|
task_node,
|
task_node_name,
|
task_node_type,
|
task_type,
|
handler_unit_id,
|
handler_unit_name,
|
handler_dept_id,
|
handler_dept_name,
|
handler_role_code,
|
handler_role_name,
|
handler_user_id,
|
handler_user_name,
|
expire_time,
|
status,
|
handle_result,
|
error_cause,
|
error_cause_name,
|
handle_content,
|
finish_time,
|
mediate_judic_no,
|
judic_audit,
|
judic_audit_name,
|
judic_handle,
|
judic_handle_name,
|
judic_result,
|
judic_result_name,
|
judic_false_cause,
|
delete_status,
|
cust_id,
|
create_time,
|
update_time,
|
next_user_id,
|
next_user_name,
|
last_task_id,
|
last_unit_id,
|
last_unit_name,
|
last_dept_id,
|
last_dept_name,
|
last_user_id,
|
last_user_name,
|
last_content
|
</sql>
|
<!-- 更新实体字段 -->
|
<sql id="set-part">
|
<if test="entity.judicId != null">judic_id = #{entity.judicId},</if>
|
<if test="entity.caseId != null">case_id = #{entity.caseId},</if>
|
<if test="entity.serieStatus != null">serie_status = #{entity.serieStatus},</if>
|
<if test="entity.flowId != null">flow_id = #{entity.flowId},</if>
|
<if test="entity.processInstanceId != null">process_instance_id = #{entity.processInstanceId},</if>
|
<if test="entity.processTaskId != null">process_task_id = #{entity.processTaskId},</if>
|
<if test="entity.taskNode != null">task_node = #{entity.taskNode},</if>
|
<if test="entity.taskNodeName != null">task_node_name = #{entity.taskNodeName},</if>
|
<if test="entity.taskNodeType != null">task_node_type = #{entity.taskNodeType},</if>
|
<if test="entity.taskType != null">task_type = #{entity.taskType},</if>
|
<if test="entity.handlerUnitId != null">handler_unit_id = #{entity.handlerUnitId},</if>
|
<if test="entity.handlerUnitName != null">handler_unit_name = #{entity.handlerUnitName},</if>
|
<if test="entity.handlerDeptId != null">handler_dept_id = #{entity.handlerDeptId},</if>
|
<if test="entity.handlerDeptName != null">handler_dept_name = #{entity.handlerDeptName},</if>
|
<if test="entity.handlerRoleCode != null">handler_role_code = #{entity.handlerRoleCode},</if>
|
<if test="entity.handlerRoleName != null">handler_role_name = #{entity.handlerRoleName},</if>
|
<if test="entity.handlerUserId != null">handler_user_id = #{entity.handlerUserId},</if>
|
<if test="entity.handlerUserName != null">handler_user_name = #{entity.handlerUserName},</if>
|
<if test="entity.expireTime != null">expire_time = #{entity.expireTime},</if>
|
<if test="entity.status != null">status = #{entity.status},</if>
|
<if test="entity.handleResult != null">handle_result = #{entity.handleResult},</if>
|
<if test="entity.errorCause != null">error_cause = #{entity.errorCause},</if>
|
<if test="entity.errorCauseName != null">error_cause_name = #{entity.errorCauseName},</if>
|
<if test="entity.handleContent != null">handle_content = #{entity.handleContent},</if>
|
<if test="entity.finishTime != null">finish_time = #{entity.finishTime},</if>
|
<if test="entity.mediateJudicNo != null">mediate_judic_no = #{entity.mediateJudicNo},</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.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.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.nextUserId != null">next_user_id = #{entity.nextUserId},</if>
|
<if test="entity.nextUserName != null">next_user_name = #{entity.nextUserName},</if>
|
<if test="entity.lastTaskId != null">last_task_id = #{entity.lastTaskId},</if>
|
<if test="entity.lastUnitId != null">last_unit_id = #{entity.lastUnitId},</if>
|
<if test="entity.lastUnitName != null">last_unit_name = #{entity.lastUnitName},</if>
|
<if test="entity.lastDeptId != null">last_dept_id = #{entity.lastDeptId},</if>
|
<if test="entity.lastDeptName != null">last_dept_name = #{entity.lastDeptName},</if>
|
<if test="entity.lastUserId != null">last_user_id = #{entity.lastUserId},</if>
|
<if test="entity.lastUserName != null">last_user_name = #{entity.lastUserName},</if>
|
<if test="entity.lastContent != null">last_content = #{entity.lastContent}</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.judicId != null and terms.judicId !=''">
|
and judic_id = #{terms.judicId}
|
</if>
|
<if test="terms.caseId != null and terms.caseId !=''">
|
and case_id = #{terms.caseId}
|
</if>
|
<if test="terms.serieStatus != null and terms.serieStatus !=''">
|
and serie_status = #{terms.serieStatus}
|
</if>
|
<if test="terms.flowId != null and terms.flowId !=''">
|
and flow_id = #{terms.flowId}
|
</if>
|
<if test="terms.processInstanceId != null and terms.processInstanceId !=''">
|
and process_instance_id = #{terms.processInstanceId}
|
</if>
|
<if test="terms.processTaskId != null and terms.processTaskId !=''">
|
and process_task_id = #{terms.processTaskId}
|
</if>
|
<if test="terms.taskNode != null and terms.taskNode !=''">
|
and task_node = #{terms.taskNode}
|
</if>
|
<if test="terms.taskNodeName != null and terms.taskNodeName !=''">
|
and task_node_name = #{terms.taskNodeName}
|
</if>
|
<if test="terms.taskNodeType != null and terms.taskNodeType !=''">
|
and task_node_type = #{terms.taskNodeType}
|
</if>
|
<if test="terms.taskType != null and terms.taskType !=''">
|
and task_type = #{terms.taskType}
|
</if>
|
<if test="terms.handlerUnitId != null and terms.handlerUnitId !=''">
|
and handler_unit_id = #{terms.handlerUnitId}
|
</if>
|
<if test="terms.handlerUnitName != null and terms.handlerUnitName !=''">
|
and handler_unit_name = #{terms.handlerUnitName}
|
</if>
|
<if test="terms.handlerDeptId != null and terms.handlerDeptId !=''">
|
and handler_dept_id = #{terms.handlerDeptId}
|
</if>
|
<if test="terms.handlerDeptName != null and terms.handlerDeptName !=''">
|
and handler_dept_name = #{terms.handlerDeptName}
|
</if>
|
<if test="terms.handlerRoleCode != null and terms.handlerRoleCode !=''">
|
and handler_role_code = #{terms.handlerRoleCode}
|
</if>
|
<if test="terms.handlerRoleName != null and terms.handlerRoleName !=''">
|
and handler_role_name = #{terms.handlerRoleName}
|
</if>
|
<if test="terms.handlerUserId != null and terms.handlerUserId !=''">
|
and handler_user_id = #{terms.handlerUserId}
|
</if>
|
<if test="terms.handlerUserName != null and terms.handlerUserName !=''">
|
and handler_user_name = #{terms.handlerUserName}
|
</if>
|
<if test="terms.expireTime != null and terms.expireTime !=''">
|
and expire_time = #{terms.expireTime}
|
</if>
|
<if test="terms.status != null and terms.status !=''">
|
and status = #{terms.status}
|
</if>
|
<if test="terms.handleResult != null and terms.handleResult !=''">
|
and handle_result = #{terms.handleResult}
|
</if>
|
<if test="terms.errorCause != null and terms.errorCause !=''">
|
and error_cause = #{terms.errorCause}
|
</if>
|
<if test="terms.errorCauseName != null and terms.errorCauseName !=''">
|
and error_cause_name = #{terms.errorCauseName}
|
</if>
|
<if test="terms.handleContent != null and terms.handleContent !=''">
|
and handle_content = #{terms.handleContent}
|
</if>
|
<if test="terms.finishTime != null and terms.finishTime !=''">
|
and finish_time = #{terms.finishTime}
|
</if>
|
<if test="terms.mediateJudicNo != null and terms.mediateJudicNo !=''">
|
and mediate_judic_no = #{terms.mediateJudicNo}
|
</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.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.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.nextUserId != null and terms.nextUserId !=''">
|
and next_user_id = #{terms.nextUserId}
|
</if>
|
<if test="terms.nextUserName != null and terms.nextUserName !=''">
|
and next_user_name = #{terms.nextUserName}
|
</if>
|
<if test="terms.lastTaskId != null and terms.lastTaskId !=''">
|
and last_task_id = #{terms.lastTaskId}
|
</if>
|
<if test="terms.lastUnitId != null and terms.lastUnitId !=''">
|
and last_unit_id = #{terms.lastUnitId}
|
</if>
|
<if test="terms.lastUnitName != null and terms.lastUnitName !=''">
|
and last_unit_name = #{terms.lastUnitName}
|
</if>
|
<if test="terms.lastDeptId != null and terms.lastDeptId !=''">
|
and last_dept_id = #{terms.lastDeptId}
|
</if>
|
<if test="terms.lastDeptName != null and terms.lastDeptName !=''">
|
and last_dept_name = #{terms.lastDeptName}
|
</if>
|
<if test="terms.lastUserId != null and terms.lastUserId !=''">
|
and last_user_id = #{terms.lastUserId}
|
</if>
|
<if test="terms.lastUserName != null and terms.lastUserName !=''">
|
and last_user_name = #{terms.lastUserName}
|
</if>
|
<if test="terms.lastContent != null and terms.lastContent !=''">
|
and last_content = #{terms.lastContent}
|
</if>
|
</where>
|
</if>
|
</sql>
|
<!-- 更新对象 -->
|
<update id="updateJudicTask">
|
update
|
<include refid="table-name"/>
|
<set>
|
<include refid="set-part"/>
|
</set>
|
<where>
|
id = #{entity.id}
|
</where>
|
</update>
|
<!-- 条件更新对象 -->
|
<update id="updateJudicTaskTerms">
|
update
|
<include refid="table-name"/>
|
<set>
|
<include refid="set-part"/>
|
</set>
|
<include refid="where-part"/>
|
</update>
|
<!-- 根据编号物理删除 -->
|
<delete id="deleteJudicTask">
|
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>
|