<?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: dyh_casebook_info_unfold
|
* @description: 自定义sql,请自行实现业务逻辑
|
* @company: hugeinfo
|
* @author: liyj
|
* @time:2024-10-26 12:31:22
|
* @version 1.0.0
|
-->
|
<mapper namespace="cn.huge.module.casebook.dao.mapper.CasebookInfoUnfoldMapper">
|
<!-- 结果集 -->
|
<resultMap id="dataResult" type="cn.huge.module.casebook.domain.po.CasebookInfoUnfold">
|
<result property="id" column="id"/>
|
<result property="acceptTime" column="accept_time"/>
|
<result property="mediateUnitId" column="mediate_unit_id"/>
|
<result property="mediateUnitName" column="mediate_unit_name"/>
|
<result property="mediateDeptId" column="mediate_dept_id"/>
|
<result property="mediateDeptName" column="mediate_dept_name"/>
|
<result property="mediatorId" column="mediator_id"/>
|
<result property="mediator" column="mediator"/>
|
<result property="mediatorMobile" column="mediator_mobile"/>
|
<result property="assistUnitId" column="assist_unit_id"/>
|
<result property="assistUnitName" column="assist_unit_name"/>
|
<result property="mediStartTime" column="medi_start_time"/>
|
<result property="mediEndTime" column="medi_end_time"/>
|
<result property="mediResult" column="medi_result"/>
|
<result property="mediResultName" column="medi_result_name"/>
|
<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="mediFalse" column="medi_false"/>
|
<result property="mediFalseName" column="medi_false_name"/>
|
<result property="civilStatus" column="civil_status"/>
|
<result property="courtId" column="court_id"/>
|
<result property="courtName" column="court_name"/>
|
<result property="closeTime" column="close_time"/>
|
<result property="judicApply" column="judic_apply"/>
|
<result property="judicResult" column="judic_result"/>
|
<result property="judicResultName" column="judic_result_name"/>
|
<result property="fileStatus" column="file_status"/>
|
<result property="fileUserId" column="file_user_id"/>
|
<result property="fileUserName" column="file_user_name"/>
|
<result property="fileTime" column="file_time"/>
|
<result property="fileYear" column="file_year"/>
|
<result property="fileBookName" column="file_book_name"/>
|
<result property="fileBookNo" column="file_book_no"/>
|
<result property="fileNo" column="file_no"/>
|
<result property="fileLimitYear" column="file_limit_year"/>
|
<result property="fileAddr" column="file_addr"/>
|
<result property="fileContent" column="file_content"/>
|
<result property="fulfilSitu" column="fulfil_situ"/>
|
<result property="fulfilSituName" column="fulfil_situ_name"/>
|
<result property="visitUpStatus" column="visit_up_status"/>
|
<result property="visitUpContent" column="visit_up_content"/>
|
<result property="partyJoy" column="party_joy"/>
|
<result property="custId" column="cust_id"/>
|
<result property="createTime" column="create_time"/>
|
<result property="updateTime" column="update_time"/>
|
<result property="belongUnitId" column="belong_unit_id"/>
|
<result property="belongUnitName" column="belong_unit_name"/>
|
</resultMap>
|
<!-- 表 -->
|
<sql id='table-name'>dyh_casebook_info_unfold</sql>
|
<!-- 字段 -->
|
<sql id="column-part">
|
id,
|
accept_time,
|
mediate_unit_id,
|
mediate_unit_name,
|
mediate_dept_id,
|
mediate_dept_name,
|
mediator_id,
|
mediator,
|
mediator_mobile,
|
assist_unit_id,
|
assist_unit_name,
|
medi_start_time,
|
medi_end_time,
|
medi_result,
|
medi_result_name,
|
agree_type,
|
agree_type_name,
|
agree_content,
|
windup_content,
|
medi_false,
|
medi_false_name,
|
civil_status,
|
court_id,
|
court_name,
|
close_time,
|
judic_apply,
|
judic_result,
|
judic_result_name,
|
file_status,
|
file_user_id,
|
file_user_name,
|
file_time,
|
file_year,
|
file_book_name,
|
file_book_no,
|
file_no,
|
file_limit_year,
|
file_addr,
|
file_content,
|
fulfil_situ,
|
fulfil_situ_name,
|
visit_up_status,
|
visit_up_content,
|
party_joy,
|
cust_id,
|
create_time,
|
update_time,
|
belong_unit_id,
|
belong_unit_name
|
</sql>
|
<!-- 更新实体字段 -->
|
<sql id="set-part">
|
<if test="entity.acceptTime != null">accept_time = #{entity.acceptTime},</if>
|
<if test="entity.mediateUnitId != null">mediate_unit_id = #{entity.mediateUnitId},</if>
|
<if test="entity.mediateUnitName != null">mediate_unit_name = #{entity.mediateUnitName},</if>
|
<if test="entity.mediateDeptId != null">mediate_dept_id = #{entity.mediateDeptId},</if>
|
<if test="entity.mediateDeptName != null">mediate_dept_name = #{entity.mediateDeptName},</if>
|
<if test="entity.mediatorId != null">mediator_id = #{entity.mediatorId},</if>
|
<if test="entity.mediator != null">mediator = #{entity.mediator},</if>
|
<if test="entity.mediatorMobile != null">mediator_mobile = #{entity.mediatorMobile},</if>
|
<if test="entity.assistUnitId != null">assist_unit_id = #{entity.assistUnitId},</if>
|
<if test="entity.assistUnitName != null">assist_unit_name = #{entity.assistUnitName},</if>
|
<if test="entity.mediStartTime != null">medi_start_time = #{entity.mediStartTime},</if>
|
<if test="entity.mediEndTime != null">medi_end_time = #{entity.mediEndTime},</if>
|
<if test="entity.mediResult != null">medi_result = #{entity.mediResult},</if>
|
<if test="entity.mediResultName != null">medi_result_name = #{entity.mediResultName},</if>
|
<if test="entity.agreeType != null">agree_type = #{entity.agreeType},</if>
|
<if test="entity.agreeTypeName != null">agree_type_name = #{entity.agreeTypeName},</if>
|
<if test="entity.agreeContent != null">agree_content = #{entity.agreeContent},</if>
|
<if test="entity.windupContent != null">windup_content = #{entity.windupContent},</if>
|
<if test="entity.mediFalse != null">medi_false = #{entity.mediFalse},</if>
|
<if test="entity.mediFalseName != null">medi_false_name = #{entity.mediFalseName},</if>
|
<if test="entity.civilStatus != null">civil_status = #{entity.civilStatus},</if>
|
<if test="entity.courtId != null">court_id = #{entity.courtId},</if>
|
<if test="entity.courtName != null">court_name = #{entity.courtName},</if>
|
<if test="entity.closeTime != null">close_time = #{entity.closeTime},</if>
|
<if test="entity.judicApply != null">judic_apply = #{entity.judicApply},</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.fileStatus != null">file_status = #{entity.fileStatus},</if>
|
<if test="entity.fileUserId != null">file_user_id = #{entity.fileUserId},</if>
|
<if test="entity.fileUserName != null">file_user_name = #{entity.fileUserName},</if>
|
<if test="entity.fileTime != null">file_time = #{entity.fileTime},</if>
|
<if test="entity.fileYear != null">file_year = #{entity.fileYear},</if>
|
<if test="entity.fileBookName != null">file_book_name = #{entity.fileBookName},</if>
|
<if test="entity.fileBookNo != null">file_book_no = #{entity.fileBookNo},</if>
|
<if test="entity.fileNo != null">file_no = #{entity.fileNo},</if>
|
<if test="entity.fileLimitYear != null">file_limit_year = #{entity.fileLimitYear},</if>
|
<if test="entity.fileAddr != null">file_addr = #{entity.fileAddr},</if>
|
<if test="entity.fileContent != null">file_content = #{entity.fileContent},</if>
|
<if test="entity.fulfilSitu != null">fulfil_situ = #{entity.fulfilSitu},</if>
|
<if test="entity.fulfilSituName != null">fulfil_situ_name = #{entity.fulfilSituName},</if>
|
<if test="entity.visitUpStatus != null">visit_up_status = #{entity.visitUpStatus},</if>
|
<if test="entity.visitUpContent != null">visit_up_content = #{entity.visitUpContent},</if>
|
<if test="entity.partyJoy != null">party_joy = #{entity.partyJoy},</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.belongUnitId != null">belong_unit_id = #{entity.belongUnitId},</if>
|
<if test="entity.belongUnitName != null">belong_unit_name = #{entity.belongUnitName}</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.acceptTime != null and terms.acceptTime !=''">
|
and accept_time = #{terms.acceptTime}
|
</if>
|
<if test="terms.mediateUnitId != null and terms.mediateUnitId !=''">
|
and mediate_unit_id = #{terms.mediateUnitId}
|
</if>
|
<if test="terms.mediateUnitName != null and terms.mediateUnitName !=''">
|
and mediate_unit_name = #{terms.mediateUnitName}
|
</if>
|
<if test="terms.mediateDeptId != null and terms.mediateDeptId !=''">
|
and mediate_dept_id = #{terms.mediateDeptId}
|
</if>
|
<if test="terms.mediateDeptName != null and terms.mediateDeptName !=''">
|
and mediate_dept_name = #{terms.mediateDeptName}
|
</if>
|
<if test="terms.mediatorId != null and terms.mediatorId !=''">
|
and mediator_id = #{terms.mediatorId}
|
</if>
|
<if test="terms.mediator != null and terms.mediator !=''">
|
and mediator = #{terms.mediator}
|
</if>
|
<if test="terms.mediatorMobile != null and terms.mediatorMobile !=''">
|
and mediator_mobile = #{terms.mediatorMobile}
|
</if>
|
<if test="terms.assistUnitId != null and terms.assistUnitId !=''">
|
and assist_unit_id = #{terms.assistUnitId}
|
</if>
|
<if test="terms.assistUnitName != null and terms.assistUnitName !=''">
|
and assist_unit_name = #{terms.assistUnitName}
|
</if>
|
<if test="terms.mediStartTime != null and terms.mediStartTime !=''">
|
and medi_start_time = #{terms.mediStartTime}
|
</if>
|
<if test="terms.mediEndTime != null and terms.mediEndTime !=''">
|
and medi_end_time = #{terms.mediEndTime}
|
</if>
|
<if test="terms.mediResult != null and terms.mediResult !=''">
|
and medi_result = #{terms.mediResult}
|
</if>
|
<if test="terms.mediResultName != null and terms.mediResultName !=''">
|
and medi_result_name = #{terms.mediResultName}
|
</if>
|
<if test="terms.agreeType != null and terms.agreeType !=''">
|
and agree_type = #{terms.agreeType}
|
</if>
|
<if test="terms.agreeTypeName != null and terms.agreeTypeName !=''">
|
and agree_type_name = #{terms.agreeTypeName}
|
</if>
|
<if test="terms.agreeContent != null and terms.agreeContent !=''">
|
and agree_content = #{terms.agreeContent}
|
</if>
|
<if test="terms.windupContent != null and terms.windupContent !=''">
|
and windup_content = #{terms.windupContent}
|
</if>
|
<if test="terms.mediFalse != null and terms.mediFalse !=''">
|
and medi_false = #{terms.mediFalse}
|
</if>
|
<if test="terms.mediFalseName != null and terms.mediFalseName !=''">
|
and medi_false_name = #{terms.mediFalseName}
|
</if>
|
<if test="terms.civilStatus != null and terms.civilStatus !=''">
|
and civil_status = #{terms.civilStatus}
|
</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.closeTime != null and terms.closeTime !=''">
|
and close_time = #{terms.closeTime}
|
</if>
|
<if test="terms.judicApply != null and terms.judicApply !=''">
|
and judic_apply = #{terms.judicApply}
|
</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.fileStatus != null and terms.fileStatus !=''">
|
and file_status = #{terms.fileStatus}
|
</if>
|
<if test="terms.fileUserId != null and terms.fileUserId !=''">
|
and file_user_id = #{terms.fileUserId}
|
</if>
|
<if test="terms.fileUserName != null and terms.fileUserName !=''">
|
and file_user_name = #{terms.fileUserName}
|
</if>
|
<if test="terms.fileTime != null and terms.fileTime !=''">
|
and file_time = #{terms.fileTime}
|
</if>
|
<if test="terms.fileYear != null and terms.fileYear !=''">
|
and file_year = #{terms.fileYear}
|
</if>
|
<if test="terms.fileBookName != null and terms.fileBookName !=''">
|
and file_book_name = #{terms.fileBookName}
|
</if>
|
<if test="terms.fileBookNo != null and terms.fileBookNo !=''">
|
and file_book_no = #{terms.fileBookNo}
|
</if>
|
<if test="terms.fileNo != null and terms.fileNo !=''">
|
and file_no = #{terms.fileNo}
|
</if>
|
<if test="terms.fileLimitYear != null and terms.fileLimitYear !=''">
|
and file_limit_year = #{terms.fileLimitYear}
|
</if>
|
<if test="terms.fileAddr != null and terms.fileAddr !=''">
|
and file_addr = #{terms.fileAddr}
|
</if>
|
<if test="terms.fileContent != null and terms.fileContent !=''">
|
and file_content = #{terms.fileContent}
|
</if>
|
<if test="terms.fulfilSitu != null and terms.fulfilSitu !=''">
|
and fulfil_situ = #{terms.fulfilSitu}
|
</if>
|
<if test="terms.fulfilSituName != null and terms.fulfilSituName !=''">
|
and fulfil_situ_name = #{terms.fulfilSituName}
|
</if>
|
<if test="terms.visitUpStatus != null and terms.visitUpStatus !=''">
|
and visit_up_status = #{terms.visitUpStatus}
|
</if>
|
<if test="terms.visitUpContent != null and terms.visitUpContent !=''">
|
and visit_up_content = #{terms.visitUpContent}
|
</if>
|
<if test="terms.partyJoy != null and terms.partyJoy !=''">
|
and party_joy = #{terms.partyJoy}
|
</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.belongUnitId != null and terms.belongUnitId !=''">
|
and belong_unit_id = #{terms.belongUnitId}
|
</if>
|
<if test="terms.belongUnitName != null and terms.belongUnitName !=''">
|
and belong_unit_name = #{terms.belongUnitName}
|
</if>
|
</where>
|
</if>
|
</sql>
|
<!-- 更新对象 -->
|
<update id="updateCasebookInfoUnfold">
|
update
|
<include refid="table-name"/>
|
<set>
|
<include refid="set-part"/>
|
</set>
|
<where>
|
id = #{entity.id}
|
</where>
|
</update>
|
<!-- 条件更新对象 -->
|
<update id="updateCasebookInfoUnfoldTerms">
|
update
|
<include refid="table-name"/>
|
<set>
|
<include refid="set-part"/>
|
</set>
|
<include refid="where-part"/>
|
</update>
|
<!-- 根据编号物理删除 -->
|
<delete id="deleteCasebookInfoUnfold">
|
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>
|