<?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">
|
<mapper namespace="courtExecutionProcedureServiceDaoImpl">
|
|
<!-- 保存法院执行程序信息 -->
|
<insert id="saveCourtExecutionProcedure" parameterType="Map">
|
insert into court_execution_procedure(
|
owner_id, apply_time, judgment_doc_number, arrears_period,
|
arrears_amount, late_fee, acceptance_fee, other_fee,
|
total_amount, remark, callable_id
|
) values (
|
#{ownerId}, #{applyTime}, #{judgmentDocNumber}, #{arrearsPeriod},
|
#{arrearsAmount}, #{lateFee}, #{acceptanceFee}, #{otherFee},
|
#{totalAmount}, #{remark}, #{callableId}
|
)
|
</insert>
|
|
<!-- 批量保存法院执行程序信息 -->
|
<insert id="batchSaveCourtExecutionProcedure" parameterType="Map">
|
insert into court_execution_procedure(
|
owner_id, apply_time, judgment_doc_number, arrears_period,
|
arrears_amount, late_fee, acceptance_fee, other_fee,
|
total_amount, remark, callable_id
|
) values
|
<foreach collection="courtExecutionProcedureList" item="item" separator=",">
|
( #{item.ownerId}, #{item.applyTime}, #{item.judgmentDocNumber}, #{item.arrearsPeriod},
|
#{item.arrearsAmount}, #{item.lateFee}, #{item.acceptanceFee}, #{item.otherFee},
|
#{item.totalAmount}, #{item.remark}, #{item.callableId} )
|
</foreach>
|
</insert>
|
|
<!-- 查询法院执行程序信息 -->
|
<select id="getCourtExecutionProcedure" parameterType="Map" resultType="Map">
|
select
|
t.id,
|
t.owner_id ownerId,
|
t.apply_time applyTime,
|
t.judgment_doc_number judgmentDocNumber,
|
t.arrears_period arrearsPeriod,
|
t.arrears_amount arrearsAmount,
|
t.late_fee lateFee,
|
t.acceptance_fee acceptanceFee,
|
t.other_fee otherFee,
|
t.total_amount totalAmount,
|
t.remark remark,
|
t.create_time createTime,
|
t.update_time updateTime,
|
t.callable_id callableId
|
from court_execution_procedure t
|
where 1 = 1
|
<if test="id != null">
|
and t.id = #{id}
|
</if>
|
<if test="ownerId != null">
|
and t.owner_id = #{ownerId}
|
</if>
|
<if test="judgmentDocNumber != null and judgmentDocNumber != ''">
|
and t.judgment_doc_number = #{judgmentDocNumber}
|
</if>
|
<if test="applyTime != null">
|
and t.apply_time = #{applyTime}
|
</if>
|
<if test="arrearsPeriod != null and arrearsPeriod != ''">
|
and t.arrears_period = #{arrearsPeriod}
|
</if>
|
<if test="callableId != null and callableId != ''">
|
and t.callable_id = #{callableId}
|
</if>
|
<!-- 时间范围查询 -->
|
<if test="startCreateTime != null">
|
and t.create_time >= #{startCreateTime}
|
</if>
|
<if test="endCreateTime != null">
|
and t.create_time <= #{endCreateTime}
|
</if>
|
<if test="startUpdateTime != null">
|
and t.update_time >= #{startUpdateTime}
|
</if>
|
<if test="endUpdateTime != null">
|
and t.update_time <= #{endUpdateTime}
|
</if>
|
<!-- 申请时间范围查询 -->
|
<if test="startApplyTime != null">
|
and t.apply_time >= #{startApplyTime}
|
</if>
|
<if test="endApplyTime != null">
|
and t.apply_time <= #{endApplyTime}
|
</if>
|
order by t.id desc
|
<if test="page != -1 and page != null">
|
limit #{page}, #{row}
|
</if>
|
</select>
|
|
<!-- 更新法院执行程序信息 -->
|
<update id="updateCourtExecutionProcedure" parameterType="Map">
|
update court_execution_procedure t
|
<set>
|
<if test="ownerId != null">
|
t.owner_id = #{ownerId},
|
</if>
|
<if test="applyTime != null">
|
t.apply_time = #{applyTime},
|
</if>
|
<if test="judgmentDocNumber != null and judgmentDocNumber != ''">
|
t.judgment_doc_number = #{judgmentDocNumber},
|
</if>
|
<if test="arrearsPeriod != null and arrearsPeriod != ''">
|
t.arrears_period = #{arrearsPeriod},
|
</if>
|
<if test="arrearsAmount != null">
|
t.arrears_amount = #{arrearsAmount},
|
</if>
|
<if test="lateFee != null">
|
t.late_fee = #{lateFee},
|
</if>
|
<if test="acceptanceFee != null">
|
t.acceptance_fee = #{acceptanceFee},
|
</if>
|
<if test="otherFee != null">
|
t.other_fee = #{otherFee},
|
</if>
|
<if test="totalAmount != null">
|
t.total_amount = #{totalAmount},
|
</if>
|
<if test="remark != null">
|
t.remark = #{remark},
|
</if>
|
<if test="callableId != null and callableId != ''">
|
t.callable_id = #{callableId},
|
</if>
|
t.update_time = CURRENT_TIMESTAMP
|
</set>
|
where 1 = 1
|
<if test="id != null">
|
and t.id = #{id}
|
</if>
|
</update>
|
|
<!-- 删除法院执行程序信息 -->
|
<delete id="deleteCourtExecutionProcedure" parameterType="Map">
|
delete from court_execution_procedure t
|
where 1 = 1
|
<if test="id != null">
|
and t.id = #{id}
|
</if>
|
<if test="ownerId != null">
|
and t.owner_id = #{ownerId}
|
</if>
|
<if test="judgmentDocNumber != null and judgmentDocNumber != ''">
|
and t.judgment_doc_number = #{judgmentDocNumber}
|
</if>
|
</delete>
|
|
<!-- 查询法院执行程序记录数量 -->
|
<select id="queryCourtExecutionProcedureCount" parameterType="Map" resultType="Map">
|
select count(1) count
|
from court_execution_procedure t
|
where 1 = 1
|
<if test="id != null">
|
and t.id = #{id}
|
</if>
|
<if test="ownerId != null">
|
and t.owner_id = #{ownerId}
|
</if>
|
<if test="judgmentDocNumber != null and judgmentDocNumber != ''">
|
and t.judgment_doc_number = #{judgmentDocNumber}
|
</if>
|
<if test="applyTime != null">
|
and t.apply_time = #{applyTime}
|
</if>
|
<if test="callableId != null and callableId != ''">
|
and t.callable_id = #{callableId}
|
</if>
|
<!-- 时间范围查询 -->
|
<if test="startCreateTime != null">
|
and t.create_time >= #{startCreateTime}
|
</if>
|
<if test="endCreateTime != null">
|
and t.create_time <= #{endCreateTime}
|
</if>
|
<if test="startUpdateTime != null">
|
and t.update_time >= #{startUpdateTime}
|
</if>
|
<if test="endUpdateTime != null">
|
and t.update_time <= #{endUpdateTime}
|
</if>
|
<if test="startApplyTime != null">
|
and t.apply_time >= #{startApplyTime}
|
</if>
|
<if test="endApplyTime != null">
|
and t.apply_time <= #{endApplyTime}
|
</if>
|
</select>
|
|
<!-- 查询法院执行程序统计信息 -->
|
<select id="queryCourtExecutionProcedureStatistics" parameterType="Map" resultType="Map">
|
select
|
count(1) as total_count,
|
min(t.create_time) as earliest_create_time,
|
max(t.create_time) as latest_create_time,
|
min(t.update_time) as earliest_update_time,
|
max(t.update_time) as latest_update_time
|
from court_execution_procedure t
|
where 1 = 1
|
<if test="startCreateTime != null">
|
and t.create_time >= #{startCreateTime}
|
</if>
|
<if test="endCreateTime != null">
|
and t.create_time <= #{endCreateTime}
|
</if>
|
<if test="ownerId != null">
|
and t.owner_id = #{ownerId}
|
</if>
|
<if test="judgmentDocNumber != null and judgmentDocNumber != ''">
|
and t.judgment_doc_number = #{judgmentDocNumber}
|
</if>
|
</select>
|
|
<!-- 按年月分组统计法院执行程序数量 -->
|
<select id="queryCourtExecutionProcedureByMonth" parameterType="Map" resultType="Map">
|
select
|
date_format(t.create_time, '%Y-%m') as month,
|
count(1) as count
|
from court_execution_procedure t
|
where 1 = 1
|
<if test="startCreateTime != null">
|
and t.create_time >= #{startCreateTime}
|
</if>
|
<if test="endCreateTime != null">
|
and t.create_time <= #{endCreateTime}
|
</if>
|
<if test="ownerId != null">
|
and t.owner_id = #{ownerId}
|
</if>
|
<if test="judgmentDocNumber != null and judgmentDocNumber != ''">
|
and t.judgment_doc_number = #{judgmentDocNumber}
|
</if>
|
group by date_format(t.create_time, '%Y-%m')
|
order by month desc
|
</select>
|
|
<!-- 根据判决书编号查询最新的法院执行程序信息 -->
|
<select id="getLatestCourtExecutionProcedureByJudgmentDocNumber" parameterType="Map" resultType="Map">
|
select
|
t.id,
|
t.owner_id ownerId,
|
t.apply_time applyTime,
|
t.judgment_doc_number judgmentDocNumber,
|
t.arrears_period arrearsPeriod,
|
t.arrears_amount arrearsAmount,
|
t.late_fee lateFee,
|
t.acceptance_fee acceptanceFee,
|
t.other_fee otherFee,
|
t.total_amount totalAmount,
|
t.remark remark,
|
t.create_time createTime,
|
t.update_time updateTime,
|
t.callable_id callableId
|
from court_execution_procedure t
|
where t.judgment_doc_number = #{judgmentDocNumber}
|
<if test="ownerId != null">
|
and t.owner_id = #{ownerId}
|
</if>
|
order by t.update_time desc
|
limit 1
|
</select>
|
|
</mapper>
|