<?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-11-18 16:14:50
|
* @version 1.0.0
|
-->
|
<mapper namespace="cn.huge.module.thirdByRmtj.dao.mapper.ThRmtjAuditMapper">
|
<!-- 结果集 -->
|
<resultMap id="dataResult" type="cn.huge.module.thirdByRmtj.domain.po.ThRmtjAudit">
|
<result property="id" column="id"/>
|
<result property="caseId" column="case_id"/>
|
<result property="applyId" column="apply_id"/>
|
<result property="auditNode" column="audit_node"/>
|
<result property="auditResult" column="audit_result"/>
|
<result property="auditResultName" column="audit_result_name"/>
|
<result property="auditContent" column="audit_content"/>
|
<result property="auditerId" column="auditer_id"/>
|
<result property="auditerName" column="auditer_name"/>
|
<result property="auditUnitId" column="audit_unit_id"/>
|
<result property="auditUnitName" column="audit_unit_name"/>
|
<result property="auditTime" column="audit_time"/>
|
<result property="custId" column="cust_id"/>
|
<result property="createTime" column="create_time"/>
|
<result property="updateTime" column="update_time"/>
|
</resultMap>
|
<!-- 表 -->
|
<sql id='table-name'>dyh_th_rmtj_audit</sql>
|
<!-- 字段 -->
|
<sql id="column-part">
|
id,
|
case_id,
|
apply_id,
|
audit_node,
|
audit_result,
|
audit_result_name,
|
audit_content,
|
auditer_id,
|
auditer_name,
|
audit_unit_id,
|
audit_unit_name,
|
audit_time,
|
cust_id,
|
create_time,
|
update_time
|
</sql>
|
<!-- 更新实体字段 -->
|
<sql id="set-part">
|
<if test="entity.caseId != null">case_id = #{entity.caseId},</if>
|
<if test="entity.applyId != null">apply_id = #{entity.applyId},</if>
|
<if test="entity.auditNode != null">audit_node = #{entity.auditNode},</if>
|
<if test="entity.auditResult != null">audit_result = #{entity.auditResult},</if>
|
<if test="entity.auditResultName != null">audit_result_name = #{entity.auditResultName},</if>
|
<if test="entity.auditContent != null">audit_content = #{entity.auditContent},</if>
|
<if test="entity.auditerId != null">auditer_id = #{entity.auditerId},</if>
|
<if test="entity.auditerName != null">auditer_name = #{entity.auditerName},</if>
|
<if test="entity.auditUnitId != null">audit_unit_id = #{entity.auditUnitId},</if>
|
<if test="entity.auditUnitName != null">audit_unit_name = #{entity.auditUnitName},</if>
|
<if test="entity.auditTime != null">audit_time = #{entity.auditTime},</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>
|
</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.applyId != null and terms.applyId !=''">
|
and apply_id = #{terms.applyId}
|
</if>
|
<if test="terms.auditNode != null and terms.auditNode !=''">
|
and audit_node = #{terms.auditNode}
|
</if>
|
<if test="terms.auditResult != null and terms.auditResult !=''">
|
and audit_result = #{terms.auditResult}
|
</if>
|
<if test="terms.auditResultName != null and terms.auditResultName !=''">
|
and audit_result_name = #{terms.auditResultName}
|
</if>
|
<if test="terms.auditContent != null and terms.auditContent !=''">
|
and audit_content = #{terms.auditContent}
|
</if>
|
<if test="terms.auditerId != null and terms.auditerId !=''">
|
and auditer_id = #{terms.auditerId}
|
</if>
|
<if test="terms.auditerName != null and terms.auditerName !=''">
|
and auditer_name = #{terms.auditerName}
|
</if>
|
<if test="terms.auditUnitId != null and terms.auditUnitId !=''">
|
and audit_unit_id = #{terms.auditUnitId}
|
</if>
|
<if test="terms.auditUnitName != null and terms.auditUnitName !=''">
|
and audit_unit_name = #{terms.auditUnitName}
|
</if>
|
<if test="terms.auditTime != null and terms.auditTime !=''">
|
and audit_time = #{terms.auditTime}
|
</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>
|
</where>
|
</if>
|
</sql>
|
<!-- 更新对象 -->
|
<update id="updateThRmtjAudit">
|
update
|
<include refid="table-name"/>
|
<set>
|
<include refid="set-part"/>
|
</set>
|
<where>
|
id = #{entity.id}
|
</where>
|
</update>
|
<!-- 条件更新对象 -->
|
<update id="updateThRmtjAuditTerms">
|
update
|
<include refid="table-name"/>
|
<set>
|
<include refid="set-part"/>
|
</set>
|
<include refid="where-part"/>
|
</update>
|
<!-- 根据编号物理删除 -->
|
<delete id="deleteThRmtjAudit">
|
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>
|
|
<!-- 根据业务编号集合查询 -->
|
<select id="listByOwnerIs" resultType="cn.huge.module.sys.dto.FileInfoBaseDTO">
|
SELECT t1.*
|
FROM dyh_file_info t1
|
LEFT JOIN dyh_file_relate t2 ON t1.id = t2.file_id
|
WHERE t2.owner_id in
|
<foreach collection="ownerIdList" item="ownerIdList" index="index" open="(" separator="," close=")">
|
#{ownerIdList}
|
</foreach>
|
</select>
|
|
</mapper>
|