<?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:2024-10-21 08:46:40
|
* @version 1.0.0
|
-->
|
<mapper namespace="cn.huge.module.bycase.dao.mapper.CaseDispMapper">
|
<!-- 结果集 -->
|
<resultMap id="dataResult" type="cn.huge.module.bycase.domain.po.CaseDisp">
|
<result property="id" column="id"/>
|
<result property="caseId" column="case_id"/>
|
<result property="caseNo" column="case_no"/>
|
<result property="serieStatus" column="serie_status"/>
|
<result property="applyCanal" column="apply_canal"/>
|
<result property="applyCanalName" column="apply_canal_name"/>
|
<result property="dispTag" column="disp_tag"/>
|
<result property="dispTagName" column="disp_tag_name"/>
|
<result property="sourceUnitId" column="source_unit_id"/>
|
<result property="sourceUnitName" column="source_unit_name"/>
|
<result property="sourceUserId" column="source_user_id"/>
|
<result property="sourceUserName" column="source_user_name"/>
|
<result property="sourceReason" column="source_reason"/>
|
<result property="sourceContent" column="source_content"/>
|
<result property="dispWay" column="disp_way"/>
|
<result property="dispWayName" column="disp_way_name"/>
|
<result property="dispType" column="disp_type"/>
|
<result property="dispTypeName" column="disp_type_name"/>
|
<result property="dispHandle" column="disp_handle"/>
|
<result property="dispHandleName" column="disp_handle_name"/>
|
<result property="dispObj" column="disp_obj"/>
|
<result property="dispObjName" column="disp_obj_name"/>
|
<result property="acceptObjId" column="accept_obj_id"/>
|
<result property="acceptObjName" column="accept_obj_name"/>
|
<result property="acceptObjSign" column="accept_obj_sign"/>
|
<result property="acceptSignTime" column="accept_sign_time"/>
|
<result property="endReason" column="end_reason"/>
|
<result property="endReasonName" column="end_reason_name"/>
|
<result property="endOtherReason" column="end_other_reason"/>
|
<result property="dispContent" column="disp_content"/>
|
<result property="dispUnitId" column="disp_unit_id"/>
|
<result property="dispUnitName" column="disp_unit_name"/>
|
<result property="dispDeptId" column="disp_dept_id"/>
|
<result property="dispDeptName" column="disp_dept_name"/>
|
<result property="dispUserId" column="disp_user_id"/>
|
<result property="dispUserName" column="disp_user_name"/>
|
<result property="dispTime" column="disp_time"/>
|
<result property="status" column="status"/>
|
<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="lastDispId" column="last_disp_id"/>
|
</resultMap>
|
<!-- 表 -->
|
<sql id='table-name'>dyh_case_disp</sql>
|
<!-- 字段 -->
|
<sql id="column-part">
|
id,
|
case_id,
|
case_no,
|
serie_status,
|
apply_canal,
|
apply_canal_name,
|
disp_tag,
|
disp_tag_name,
|
source_unit_id,
|
source_unit_name,
|
source_user_id,
|
source_user_name,
|
source_reason,
|
source_content,
|
disp_way,
|
disp_way_name,
|
disp_type,
|
disp_type_name,
|
disp_handle,
|
disp_handle_name,
|
disp_obj,
|
disp_obj_name,
|
accept_obj_id,
|
accept_obj_name,
|
accept_obj_sign,
|
accept_sign_time,
|
end_reason,
|
end_reason_name,
|
end_other_reason,
|
disp_content,
|
disp_unit_id,
|
disp_unit_name,
|
disp_dept_id,
|
disp_dept_name,
|
disp_user_id,
|
disp_user_name,
|
disp_time,
|
status,
|
cust_id,
|
delete_status,
|
create_time,
|
update_time,
|
last_disp_id
|
</sql>
|
<!-- 更新实体字段 -->
|
<sql id="set-part">
|
<if test="entity.caseId != null">case_id = #{entity.caseId},</if>
|
<if test="entity.caseNo != null">case_no = #{entity.caseNo},</if>
|
<if test="entity.serieStatus != null">serie_status = #{entity.serieStatus},</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.dispTag != null">disp_tag = #{entity.dispTag},</if>
|
<if test="entity.dispTagName != null">disp_tag_name = #{entity.dispTagName},</if>
|
<if test="entity.sourceUnitId != null">source_unit_id = #{entity.sourceUnitId},</if>
|
<if test="entity.sourceUnitName != null">source_unit_name = #{entity.sourceUnitName},</if>
|
<if test="entity.sourceUserId != null">source_user_id = #{entity.sourceUserId},</if>
|
<if test="entity.sourceUserName != null">source_user_name = #{entity.sourceUserName},</if>
|
<if test="entity.sourceReason != null">source_reason = #{entity.sourceReason},</if>
|
<if test="entity.sourceContent != null">source_content = #{entity.sourceContent},</if>
|
<if test="entity.dispWay != null">disp_way = #{entity.dispWay},</if>
|
<if test="entity.dispWayName != null">disp_way_name = #{entity.dispWayName},</if>
|
<if test="entity.dispType != null">disp_type = #{entity.dispType},</if>
|
<if test="entity.dispTypeName != null">disp_type_name = #{entity.dispTypeName},</if>
|
<if test="entity.dispHandle != null">disp_handle = #{entity.dispHandle},</if>
|
<if test="entity.dispHandleName != null">disp_handle_name = #{entity.dispHandleName},</if>
|
<if test="entity.dispObj != null">disp_obj = #{entity.dispObj},</if>
|
<if test="entity.dispObjName != null">disp_obj_name = #{entity.dispObjName},</if>
|
<if test="entity.acceptObjId != null">accept_obj_id = #{entity.acceptObjId},</if>
|
<if test="entity.acceptObjName != null">accept_obj_name = #{entity.acceptObjName},</if>
|
<if test="entity.acceptObjSign != null">accept_obj_sign = #{entity.acceptObjSign},</if>
|
<if test="entity.acceptSignTime != null">accept_sign_time = #{entity.acceptSignTime},</if>
|
<if test="entity.endReason != null">end_reason = #{entity.endReason},</if>
|
<if test="entity.endReasonName != null">end_reason_name = #{entity.endReasonName},</if>
|
<if test="entity.endOtherReason != null">end_other_reason = #{entity.endOtherReason},</if>
|
<if test="entity.dispContent != null">disp_content = #{entity.dispContent},</if>
|
<if test="entity.dispUnitId != null">disp_unit_id = #{entity.dispUnitId},</if>
|
<if test="entity.dispUnitName != null">disp_unit_name = #{entity.dispUnitName},</if>
|
<if test="entity.dispDeptId != null">disp_dept_id = #{entity.dispDeptId},</if>
|
<if test="entity.dispDeptName != null">disp_dept_name = #{entity.dispDeptName},</if>
|
<if test="entity.dispUserId != null">disp_user_id = #{entity.dispUserId},</if>
|
<if test="entity.dispUserName != null">disp_user_name = #{entity.dispUserName},</if>
|
<if test="entity.dispTime != null">disp_time = #{entity.dispTime},</if>
|
<if test="entity.status != null">status = #{entity.status},</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.lastDispId != null">last_disp_id = #{entity.lastDispId}</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.caseId != null and terms.caseId !=''">
|
and case_id = #{terms.caseId}
|
</if>
|
<if test="terms.caseNo != null and terms.caseNo !=''">
|
and case_no = #{terms.caseNo}
|
</if>
|
<if test="terms.serieStatus != null and terms.serieStatus !=''">
|
and serie_status = #{terms.serieStatus}
|
</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.dispTag != null and terms.dispTag !=''">
|
and disp_tag = #{terms.dispTag}
|
</if>
|
<if test="terms.dispTagName != null and terms.dispTagName !=''">
|
and disp_tag_name = #{terms.dispTagName}
|
</if>
|
<if test="terms.sourceUnitId != null and terms.sourceUnitId !=''">
|
and source_unit_id = #{terms.sourceUnitId}
|
</if>
|
<if test="terms.sourceUnitName != null and terms.sourceUnitName !=''">
|
and source_unit_name = #{terms.sourceUnitName}
|
</if>
|
<if test="terms.sourceUserId != null and terms.sourceUserId !=''">
|
and source_user_id = #{terms.sourceUserId}
|
</if>
|
<if test="terms.sourceUserName != null and terms.sourceUserName !=''">
|
and source_user_name = #{terms.sourceUserName}
|
</if>
|
<if test="terms.sourceReason != null and terms.sourceReason !=''">
|
and source_reason = #{terms.sourceReason}
|
</if>
|
<if test="terms.sourceContent != null and terms.sourceContent !=''">
|
and source_content = #{terms.sourceContent}
|
</if>
|
<if test="terms.dispWay != null and terms.dispWay !=''">
|
and disp_way = #{terms.dispWay}
|
</if>
|
<if test="terms.dispWayName != null and terms.dispWayName !=''">
|
and disp_way_name = #{terms.dispWayName}
|
</if>
|
<if test="terms.dispType != null and terms.dispType !=''">
|
and disp_type = #{terms.dispType}
|
</if>
|
<if test="terms.dispTypeName != null and terms.dispTypeName !=''">
|
and disp_type_name = #{terms.dispTypeName}
|
</if>
|
<if test="terms.dispHandle != null and terms.dispHandle !=''">
|
and disp_handle = #{terms.dispHandle}
|
</if>
|
<if test="terms.dispHandleName != null and terms.dispHandleName !=''">
|
and disp_handle_name = #{terms.dispHandleName}
|
</if>
|
<if test="terms.dispObj != null and terms.dispObj !=''">
|
and disp_obj = #{terms.dispObj}
|
</if>
|
<if test="terms.dispObjName != null and terms.dispObjName !=''">
|
and disp_obj_name = #{terms.dispObjName}
|
</if>
|
<if test="terms.acceptObjId != null and terms.acceptObjId !=''">
|
and accept_obj_id = #{terms.acceptObjId}
|
</if>
|
<if test="terms.acceptObjName != null and terms.acceptObjName !=''">
|
and accept_obj_name = #{terms.acceptObjName}
|
</if>
|
<if test="terms.acceptObjSign != null and terms.acceptObjSign !=''">
|
and accept_obj_sign = #{terms.acceptObjSign}
|
</if>
|
<if test="terms.acceptSignTime != null and terms.acceptSignTime !=''">
|
and accept_sign_time = #{terms.acceptSignTime}
|
</if>
|
<if test="terms.endReason != null and terms.endReason !=''">
|
and end_reason = #{terms.endReason}
|
</if>
|
<if test="terms.endReasonName != null and terms.endReasonName !=''">
|
and end_reason_name = #{terms.endReasonName}
|
</if>
|
<if test="terms.endOtherReason != null and terms.endOtherReason !=''">
|
and end_other_reason = #{terms.endOtherReason}
|
</if>
|
<if test="terms.dispContent != null and terms.dispContent !=''">
|
and disp_content = #{terms.dispContent}
|
</if>
|
<if test="terms.dispUnitId != null and terms.dispUnitId !=''">
|
and disp_unit_id = #{terms.dispUnitId}
|
</if>
|
<if test="terms.dispUnitName != null and terms.dispUnitName !=''">
|
and disp_unit_name = #{terms.dispUnitName}
|
</if>
|
<if test="terms.dispDeptId != null and terms.dispDeptId !=''">
|
and disp_dept_id = #{terms.dispDeptId}
|
</if>
|
<if test="terms.dispDeptName != null and terms.dispDeptName !=''">
|
and disp_dept_name = #{terms.dispDeptName}
|
</if>
|
<if test="terms.dispUserId != null and terms.dispUserId !=''">
|
and disp_user_id = #{terms.dispUserId}
|
</if>
|
<if test="terms.dispUserName != null and terms.dispUserName !=''">
|
and disp_user_name = #{terms.dispUserName}
|
</if>
|
<if test="terms.dispTime != null and terms.dispTime !=''">
|
and disp_time = #{terms.dispTime}
|
</if>
|
<if test="terms.status != null and terms.status !=''">
|
and status = #{terms.status}
|
</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>
|
<if test="terms.lastDispId != null and terms.lastDispId !=''">
|
and last_disp_id = #{terms.lastDispId}
|
</if>
|
</where>
|
</if>
|
</sql>
|
<!-- 更新对象 -->
|
<update id="updateCaseDisp">
|
update
|
<include refid="table-name"/>
|
<set>
|
<include refid="set-part"/>
|
</set>
|
<where>
|
id = #{entity.id}
|
</where>
|
</update>
|
<!-- 条件更新对象 -->
|
<update id="updateCaseDispTerms">
|
update
|
<include refid="table-name"/>
|
<set>
|
<include refid="set-part"/>
|
</set>
|
<include refid="where-part"/>
|
</update>
|
<!-- 根据编号物理删除 -->
|
<delete id="deleteCaseDisp">
|
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>
|