<?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="courtTrialProcedureServiceDaoImpl">
|
|
<!-- 保存法院审理程序信息 -->
|
<insert id="saveCourtTrialProcedure" parameterType="Map">
|
insert into court_trial_procedure(
|
owner_id, accept_court_name, judge_name, judge_contact,
|
judge_notice_accept_date, court_mediation_date, mediation_result, subpoena_sign_date,
|
undelivered_date, court_session_date1, court_session_date2, case_number,
|
court_session_result, judgment_date, judgment_result, remark, callable_id
|
) values (
|
#{ownerId}, #{acceptCourtName}, #{judgeName}, #{judgeContact},
|
#{judgeNoticeAcceptDate}, #{courtMediationDate}, #{mediationResult}, #{subpoenaSignDate},
|
#{undeliveredDate}, #{courtSessionDate1}, #{courtSessionDate2}, #{caseNumber},
|
#{courtSessionResult}, #{judgmentDate}, #{judgmentResult}, #{remark}, #{callableId}
|
)
|
</insert>
|
|
<!-- 批量保存法院审理程序信息 -->
|
<insert id="batchSaveCourtTrialProcedure" parameterType="Map">
|
insert into court_trial_procedure(
|
owner_id, accept_court_name, judge_name, judge_contact,
|
judge_notice_accept_date, court_mediation_date, mediation_result, subpoena_sign_date,
|
undelivered_date, court_session_date1, court_session_date2, case_number,
|
court_session_result, judgment_date, judgment_result, remark, callable_id
|
) values
|
<foreach collection="courtTrialProcedureList" item="item" separator=",">
|
( #{item.ownerId}, #{item.acceptCourtName}, #{item.judgeName}, #{item.judgeContact},
|
#{item.judgeNoticeAcceptDate}, #{item.courtMediationDate}, #{item.mediationResult}, #{item.subpoenaSignDate},
|
#{item.undeliveredDate}, #{item.courtSessionDate1}, #{item.courtSessionDate2}, #{item.caseNumber},
|
#{item.courtSessionResult}, #{item.judgmentDate}, #{item.judgmentResult}, #{item.remark}, #{item.callableId} )
|
</foreach>
|
</insert>
|
|
<!-- 查询法院审理程序信息 -->
|
<select id="getCourtTrialProcedure" parameterType="Map" resultType="Map">
|
select
|
t.id,
|
t.owner_id ownerId,
|
t.accept_court_name acceptCourtName,
|
t.judge_name judgeName,
|
t.judge_contact judgeContact,
|
t.judge_notice_accept_date judgeNoticeAcceptDate,
|
t.court_mediation_date courtMediationDate,
|
t.mediation_result mediationResult,
|
t.subpoena_sign_date subpoenaSignDate,
|
t.undelivered_date undeliveredDate,
|
t.court_session_date1 courtSessionDate1,
|
t.court_session_date2 courtSessionDate2,
|
t.case_number caseNumber,
|
t.court_session_result courtSessionResult,
|
t.judgment_date judgmentDate,
|
t.judgment_result judgmentResult,
|
t.remark remark,
|
t.create_time createTime,
|
t.update_time updateTime,
|
t.callable_id callableId
|
from court_trial_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="acceptCourtName != null and acceptCourtName != ''">
|
and t.accept_court_name = #{acceptCourtName}
|
</if>
|
<if test="judgeName != null and judgeName != ''">
|
and t.judge_name = #{judgeName}
|
</if>
|
<if test="judgeContact != null and judgeContact != ''">
|
and t.judge_contact = #{judgeContact}
|
</if>
|
<if test="judgeNoticeAcceptDate != null">
|
and t.judge_notice_accept_date = #{judgeNoticeAcceptDate}
|
</if>
|
<if test="caseNumber != null and caseNumber != ''">
|
and t.case_number = #{caseNumber}
|
</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="startJudgeNoticeAcceptDate != null">
|
and t.judge_notice_accept_date >= #{startJudgeNoticeAcceptDate}
|
</if>
|
<if test="endJudgeNoticeAcceptDate != null">
|
and t.judge_notice_accept_date <= #{endJudgeNoticeAcceptDate}
|
</if>
|
<if test="startJudgmentDate != null">
|
and t.judgment_date >= #{startJudgmentDate}
|
</if>
|
<if test="endJudgmentDate != null">
|
and t.judgment_date <= #{endJudgmentDate}
|
</if>
|
order by t.id desc
|
<if test="page != -1 and page != null">
|
limit #{page}, #{row}
|
</if>
|
</select>
|
|
<!-- 更新法院审理程序信息 -->
|
<update id="updateCourtTrialProcedure" parameterType="Map">
|
update court_trial_procedure t
|
<set>
|
<if test="ownerId != null">
|
t.owner_id = #{ownerId},
|
</if>
|
<if test="acceptCourtName != null and acceptCourtName != ''">
|
t.accept_court_name = #{acceptCourtName},
|
</if>
|
<if test="judgeName != null and judgeName != ''">
|
t.judge_name = #{judgeName},
|
</if>
|
<if test="judgeContact != null and judgeContact != ''">
|
t.judge_contact = #{judgeContact},
|
</if>
|
<if test="judgeNoticeAcceptDate != null">
|
t.judge_notice_accept_date = #{judgeNoticeAcceptDate},
|
</if>
|
<if test="courtMediationDate != null">
|
t.court_mediation_date = #{courtMediationDate},
|
</if>
|
<if test="mediationResult != null and mediationResult != ''">
|
t.mediation_result = #{mediationResult},
|
</if>
|
<if test="subpoenaSignDate != null">
|
t.subpoena_sign_date = #{subpoenaSignDate},
|
</if>
|
<if test="undeliveredDate != null">
|
t.undelivered_date = #{undeliveredDate},
|
</if>
|
<if test="courtSessionDate1 != null">
|
t.court_session_date1 = #{courtSessionDate1},
|
</if>
|
<if test="courtSessionDate2 != null">
|
t.court_session_date2 = #{courtSessionDate2},
|
</if>
|
<if test="caseNumber != null and caseNumber != ''">
|
t.case_number = #{caseNumber},
|
</if>
|
<if test="courtSessionResult != null and courtSessionResult != ''">
|
t.court_session_result = #{courtSessionResult},
|
</if>
|
<if test="judgmentDate != null">
|
t.judgment_date = #{judgmentDate},
|
</if>
|
<if test="judgmentResult != null">
|
t.judgment_result = #{judgmentResult},
|
</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="deleteCourtTrialProcedure" parameterType="Map">
|
delete from court_trial_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="caseNumber != null and caseNumber != ''">
|
and t.case_number = #{caseNumber}
|
</if>
|
<if test="acceptCourtName != null and acceptCourtName != ''">
|
and t.accept_court_name = #{acceptCourtName}
|
</if>
|
</delete>
|
|
<!-- 查询法院审理程序记录数量 -->
|
<select id="queryCourtTrialProcedureCount" parameterType="Map" resultType="Map">
|
select count(1) count
|
from court_trial_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="acceptCourtName != null and acceptCourtName != ''">
|
and t.accept_court_name = #{acceptCourtName}
|
</if>
|
<if test="judgeName != null and judgeName != ''">
|
and t.judge_name = #{judgeName}
|
</if>
|
<if test="caseNumber != null and caseNumber != ''">
|
and t.case_number = #{caseNumber}
|
</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="startJudgeNoticeAcceptDate != null">
|
and t.judge_notice_accept_date >= #{startJudgeNoticeAcceptDate}
|
</if>
|
<if test="endJudgeNoticeAcceptDate != null">
|
and t.judge_notice_accept_date <= #{endJudgeNoticeAcceptDate}
|
</if>
|
</select>
|
|
<!-- 查询法院审理程序统计信息 -->
|
<select id="queryCourtTrialProcedureStatistics" 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_trial_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="acceptCourtName != null and acceptCourtName != ''">
|
and t.accept_court_name = #{acceptCourtName}
|
</if>
|
</select>
|
|
<!-- 按年月分组统计法院审理程序数量 -->
|
<select id="queryCourtTrialProcedureByMonth" parameterType="Map" resultType="Map">
|
select
|
date_format(t.create_time, '%Y-%m') as month,
|
count(1) as count
|
from court_trial_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="acceptCourtName != null and acceptCourtName != ''">
|
and t.accept_court_name = #{acceptCourtName}
|
</if>
|
group by date_format(t.create_time, '%Y-%m')
|
order by month desc
|
</select>
|
|
<!-- 根据案号查询最新的法院审理程序信息 -->
|
<select id="getLatestCourtTrialProcedureByCaseNumber" parameterType="Map" resultType="Map">
|
select
|
t.id,
|
t.owner_id ownerId,
|
t.accept_court_name acceptCourtName,
|
t.judge_name judgeName,
|
t.judge_contact judgeContact,
|
t.judge_notice_accept_date judgeNoticeAcceptDate,
|
t.court_mediation_date courtMediationDate,
|
t.mediation_result mediationResult,
|
t.subpoena_sign_date subpoenaSignDate,
|
t.undelivered_date undeliveredDate,
|
t.court_session_date1 courtSessionDate1,
|
t.court_session_date2 courtSessionDate2,
|
t.case_number caseNumber,
|
t.court_session_result courtSessionResult,
|
t.judgment_date judgmentDate,
|
t.judgment_result judgmentResult,
|
t.remark remark,
|
t.create_time createTime,
|
t.update_time updateTime,
|
t.callable_id callableId
|
from court_trial_procedure t
|
where t.case_number = #{caseNumber}
|
<if test="ownerId != null">
|
and t.owner_id = #{ownerId}
|
</if>
|
order by t.update_time desc
|
limit 1
|
</select>
|
|
</mapper>
|