Files
Arbitrate-Backend/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml
T

1596 lines
73 KiB
XML
Raw Normal View History

2023-09-11 14:29:15 +08:00
<?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="com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper">
<resultMap type="CaseApplication" id="CaseApplicationResult">
<id property="id" column="id" />
<result property="caseNum" column="case_num" />
2023-11-03 16:03:08 +08:00
<result property="caseName" column="case_name" />
2023-09-11 14:29:15 +08:00
<result property="caseSubjectAmount" column="case_subject_amount" />
<result property="registerDate" column="register_date" />
<result property="arbitratMethod" column="arbitrat_method" />
<result property="caseStatus" column="case_status" />
<result property="hearDate" column="hear_date" />
<result property="arbitratClaims" column="arbitrat_claims" />
<result property="loanStartDate" column="loan_start_date" />
<result property="loanEndDate" column="loan_end_date" />
<result property="claimPrinciOwed" column="claim_princi_owed" />
<result property="claimInterestOwed" column="claim_interest_owed" />
<result property="claimLiquidDamag" column="claim_liquid_damag" />
<result property="feePayable" column="fee_payable" />
<result property="beginVideoDate" column="begin_video_date" />
<result property="onlineVideoPerson" column="online_video_person" />
<result property="contractNumber" column="contract_number" />
2023-09-19 21:09:21 +08:00
<result property="caseStatusName" column="caseStatusName" />
2023-09-11 14:29:15 +08:00
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
2023-09-22 14:59:02 +08:00
<result property="arbitratMethodName" column="arbitratMethodName" />
2023-10-17 18:56:35 +08:00
<result property="isAbsence" column="is_absence" />
<result property="responCrossOpin" column="respon_cross_opin" />
<result property="applicaCrossOpin" column="applica_cross_opin" />
<result property="responDefenOpini" column="respon_defen_opini" />
2023-09-22 14:59:02 +08:00
<result property="arbitratorId" column="arbitrator_id" />
<result property="arbitratorName" column="arbitrator_name" />
2023-09-22 17:03:26 +08:00
<result property="paymentStatus" column="payment_status" />
<result property="paymentStatusName" column="paymentStatusName" />
2023-10-15 10:16:48 +08:00
<result property="filearbitraUrl" column="filearbitra_url" />
2023-10-17 15:30:21 +08:00
<result property="requestRule" column="request_rule" />
<result property="properPreser" column="proper_preser" />
<result property="adjudicaCounter" column="adjudica_counter" />
2023-10-20 17:13:12 +08:00
<result property="lockStatus" column="lock_status" />
2023-09-11 14:29:15 +08:00
</resultMap>
2023-11-22 13:58:34 +08:00
<select id="selectCaseApplicationList1" parameterType="CaseApplication" resultMap="CaseApplicationResult">
select DISTINCT(t1.id),t1.caseLogId,t1.case_num,t1.case_subject_amount,t1.register_date,t1.arbitrat_method,
t1.arbitratMethodName,t1.case_status,t1.caseStatusName,t1.hear_date,t1.arbitrat_claims,
t1.loan_start_date,t1.loan_end_date,t1.claim_princi_owed,t1.claim_interest_owed,t1.claim_liquid_damag,t1.fee_payable,
t1.begin_video_date,t1.online_video_person,t1.contract_number,t1.create_by,t1.create_time,t1.update_by,t1.update_time,
t1.arbitrator_name,t1.name,t1.application_organ_id,t1.applicantName,t1.arbitrator_id,t1.identity_num,t1.identity_type,
t1.filearbitra_url,t1.lock_status,t1.version,t1.updateSubmitStatus
from(
<trim suffixOverrides="union">
2023-11-29 11:51:01 +08:00
<!--申请人,被申请人,仲裁员,部门长,财务,代理人案件-->
2023-11-22 13:58:34 +08:00
<if test="isOtherRole!=null and isOtherRole==1">
select t.id,t.caseLogId,t.case_num ,t.case_subject_amount ,t.register_date ,t.arbitrat_method,
t.arbitratMethodName,t.case_status,t.caseStatusName,t.hear_date ,t.arbitrat_claims ,
t.loan_start_date ,t.loan_end_date ,t.claim_princi_owed ,t.claim_interest_owed
,t.claim_liquid_damag,t.fee_payable ,
t.begin_video_date ,t.online_video_person ,t.contract_number ,t.create_by ,t.create_time ,
t.update_by ,t.update_time , t.arbitrator_name,t.name,t.application_organ_id,t.applicantName,
2023-11-28 19:51:27 +08:00
t.arbitrator_id,t.identity_num ,
t.identity_type,t.filearbitra_url,t.lock_status,t.version,t.updateSubmitStatus
2023-11-22 13:58:34 +08:00
from(
select c.id ,'' AS caseLogId,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
ELSE '无审理方式'
END arbitratMethodName,
c.case_status ,
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
when 31 then '待修改开庭时间'
ELSE '无案件状态'
END caseStatusName,
c.hear_date ,c.arbitrat_claims ,
c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag
2023-11-28 19:51:27 +08:00
,c.fee_payable ,c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by
,c.create_time,
c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name
as applicantName,
c.arbitrator_id,ca.identity_num ,ca.identity_type,c.filearbitra_url,c.lock_status,c.version,null as
updateSubmitStatus
2023-11-22 13:58:34 +08:00
from case_application c
JOIN case_affiliate ca ON ca.case_appli_id = c.id
<!--查询条件-->
<where>
<if test="caseStatus != null">
AND c.case_status = #{caseStatus}
</if>
<if test="caseNum != null and caseNum != ''">
AND c.case_num = #{caseNum}
</if>
<if test="nameId != null and nameId != ''">
AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
</if>
<if test="caseStatusList != null and caseStatusList.size() > 0">
and c.case_status in
<foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
#{caseStatus}
</foreach>
</if>
<if test="lockStatus != null">
AND c.lock_status = #{lockStatus}
</if>
</where>
) t
<where>
2023-11-29 11:51:01 +08:00
<!--根据角色和状态过滤-->
2023-11-22 13:58:34 +08:00
<!--被申请人-->
<if test="idCard != null and idCard != ''">
or (t.identity_num=#{idCard} AND t.identity_type=2 and (t.case_status=4 or t.case_status=17))
</if>
<!--仲裁员-->
<if test="userId != null and userId != ''">
or ( t.identity_type=1 and
2023-11-28 19:51:27 +08:00
t.case_status in (7,8,9,11,13,17)
2023-11-22 13:58:34 +08:00
and
instr (t.arbitrator_id,#{userId})>0)
</if>
2023-11-23 10:30:29 +08:00
<!--申请人-->
2023-11-29 11:51:01 +08:00
<!-- <if test="applicationOrganId != null and applicationOrganId != ''">-->
<!-- or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1-->
<!-- &lt;!&ndash;暂时改为可以查询到生成裁决书之前所有的案件状态&ndash;&gt;-->
<!-- and (t.case_status &lt;= 10 or t.case_status=31))-->
2023-11-22 13:58:34 +08:00
2023-11-29 11:51:01 +08:00
<!-- </if>-->
2023-11-22 13:58:34 +08:00
<!--部门长-->
<if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
or (t.identity_type=1 and t.case_status in
<foreach item="caseStatus" collection="deptHeadStatus" open="(" separator="," close=")">
#{caseStatus}
</foreach>)
</if>
<!--财务-->
<if test="financeStatus != null and financeStatus != ''">
or (t.identity_type=1 and t.case_status =#{financeStatus})
</if>
<!--代理人-->
<if test="agentDeptIds != null and agentDeptIds.size()>0">
or (
t.application_organ_id in
<foreach item="deptId" collection="agentDeptIds" open="(" separator="," close=")">#{deptId}
</foreach>
AND t.identity_type=1
and t.case_status in (0,9))
</if>
</where>
union
</if>
2023-11-23 18:47:16 +08:00
<if test="applicationOrganId != null and applicationOrganId != ''">
2023-11-22 13:58:34 +08:00
2023-11-23 18:47:16 +08:00
<!--申请人案件-->
2023-11-24 19:22:32 +08:00
select c.id ,l.id AS caseLogId,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
2023-11-23 18:47:16 +08:00
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
ELSE '无审理方式'
END arbitratMethodName,
c.case_status ,
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
when 31 then '待修改开庭时间'
ELSE '无案件状态'
END caseStatusName,
2023-11-24 19:22:32 +08:00
c.hear_date ,c.arbitrat_claims ,
c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag
,c.fee_payable ,
c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
2023-11-23 18:47:16 +08:00
c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name
as
applicantName,
2023-11-28 19:51:27 +08:00
c.arbitrator_id,ca.identity_num , ca.identity_type,c.filearbitra_url,c.lock_status,(select version from
case_application_log where case_appli_id=c.id order by version desc limit 1) as version,(select
update_submit_status from case_application_log where case_appli_id=c.id order by version desc limit 1)
as updateSubmitStatus
2023-11-23 18:47:16 +08:00
from case_application c
JOIN case_application_log l ON c.id = l.case_appli_id and c.version=l.version
JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id AND ca.identity_type = 1
2023-11-22 13:58:34 +08:00
2023-11-23 18:47:16 +08:00
<where>
(c.case_status &lt;= 10 or c.case_status=31) AND ca.identity_type=1
2023-11-22 13:58:34 +08:00
2023-11-23 18:47:16 +08:00
<if test="applicationOrganId != null and applicationOrganId != ''">
AND ca.application_organ_id = #{applicationOrganId}
</if>
<if test="caseStatus != null">
AND c.case_status = #{caseStatus}
</if>
<if test="caseNum != null and caseNum != ''">
AND c.case_num = #{caseNum}
</if>
<if test="nameId != null and nameId != ''">
AND ca.application_organ_id=#{nameId}
</if>
<if test="lockStatus != null">
AND c.lock_status = #{lockStatus}
</if>
</where>
union
</if>
2023-11-22 13:58:34 +08:00
<!--秘书案件-->
<if test="deptIds != null and deptIds.size() > 0">
<!--秘书主表案件-->
2023-11-28 19:51:27 +08:00
select tt.* from(
2023-11-22 13:58:34 +08:00
SELECT
c.id,
'' AS caseLogId,
c.case_num,
c.case_subject_amount,
c.register_date,
c.arbitrat_method,
CASE
c.arbitrat_method
WHEN 1 THEN
'开庭审理'
WHEN 2 THEN
'书面审理' ELSE '无审理方式'
END arbitratMethodName,
c.case_status,
CASE
c.case_status
WHEN 0 THEN
'立案申请'
WHEN 1 THEN
'待立案审查'
WHEN 2 THEN
'待缴费'
WHEN 3 THEN
'待缴费确认'
WHEN 4 THEN
'待案件质证'
WHEN 5 THEN
'待组庭审核'
WHEN 6 THEN
'待组庭确定'
WHEN 7 THEN
'待审核仲裁方式'
WHEN 8 THEN
'待开庭审理'
WHEN 9 THEN
'待书面审理'
WHEN 10 THEN
'待生成仲裁文书'
WHEN 11 THEN
'待核验仲裁文书'
WHEN 12 THEN
'待审核仲裁文书'
WHEN 13 THEN
'待仲裁文书签名'
WHEN 14 THEN
'待仲裁文书用印'
WHEN 15 THEN
'待仲裁文书送达'
WHEN 16 THEN
'待案件归档'
WHEN 17 THEN
'已归档'
WHEN 31 THEN
'待修改开庭时间' ELSE '无案件状态'
END caseStatusName,
c.hear_date,
c.arbitrat_claims,
c.loan_start_date,
c.loan_end_date,
c.claim_princi_owed,
c.claim_interest_owed,
c.claim_liquid_damag,
c.fee_payable,
c.begin_video_date,
c.online_video_person,
c.contract_number,
c.create_by,
c.create_time,
c.update_by,
c.update_time,
c.arbitrator_name,
ca.name,
ca.application_organ_id ,
ca.application_organ_name AS applicantName,
c.arbitrator_id,ca.identity_num ,ca.identity_type,
c.filearbitra_url,
c.lock_status,c.version,
null as updateSubmitStatus
FROM
case_application c
JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type = 1
2023-11-28 19:51:27 +08:00
JOIN case_application_log l on l.case_appli_id=c.id and l.update_submit_status not in(1, 2) and
l.version
2023-11-22 13:58:34 +08:00
= (
SELECT
max( version ) version
FROM
case_application_log
WHERE case_appli_id = c.id
2023-11-28 19:51:27 +08:00
)
2023-11-22 13:58:34 +08:00
WHERE
2023-11-28 19:51:27 +08:00
ca.identity_type=1
and c.case_status in (1,5,14,15,16,17,31)
2023-11-22 13:58:34 +08:00
<if test="deptIds != null and deptIds.size() > 0">
and ca.application_organ_id in
<foreach item="item" collection="deptIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="lockStatus != null">
AND c.lock_status = #{lockStatus}
</if>
2023-11-28 19:51:27 +08:00
2023-11-22 13:58:34 +08:00
<if test="caseNum != null and caseNum != ''">
AND c.case_num = #{caseNum}
</if>
<if test="nameId != null and nameId != ''">
AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
2023-11-28 19:51:27 +08:00
</if>) tt
2023-11-29 11:51:01 +08:00
<where>
<if test="caseStatusList != null and caseStatusList.size() > 0">
and tt.case_status in
<foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
#{caseStatus}
</foreach>
</if>
<if test="caseStatus != null">
AND tt.case_status = #{caseStatus}
</if>
2023-11-28 19:51:27 +08:00
2023-11-29 11:51:01 +08:00
</where>
2023-11-22 13:58:34 +08:00
union
<!--秘书审核案件-->
2023-11-29 11:51:01 +08:00
select tt2.* from(
2023-11-22 13:58:34 +08:00
SELECT
l.case_appli_id id,
l.id AS caseLogId,
2023-11-23 22:51:29 +08:00
c.case_num,
c.case_subject_amount,
2023-11-22 13:58:34 +08:00
c.register_date,
c.arbitrat_method,
CASE
c.arbitrat_method
WHEN 1 THEN
'开庭审理'
WHEN 2 THEN
'书面审理' ELSE '无审理方式'
END arbitratMethodName,
c.case_status,
CASE
c.case_status
WHEN 0 THEN
'立案申请'
WHEN 1 THEN
'待立案审查'
WHEN 2 THEN
'待缴费'
WHEN 3 THEN
'待缴费确认'
WHEN 4 THEN
'待案件质证'
WHEN 5 THEN
'待组庭审核'
WHEN 6 THEN
'待组庭确定'
WHEN 7 THEN
'待审核仲裁方式'
WHEN 8 THEN
'待开庭审理'
WHEN 9 THEN
'待书面审理'
WHEN 10 THEN
'待生成仲裁文书'
WHEN 11 THEN
'待核验仲裁文书'
WHEN 12 THEN
'待审核仲裁文书'
WHEN 13 THEN
'待仲裁文书签名'
WHEN 14 THEN
'待仲裁文书用印'
WHEN 15 THEN
'待仲裁文书送达'
WHEN 16 THEN
'待案件归档'
WHEN 17 THEN
'已归档'
WHEN 31 THEN
'待修改开庭时间' ELSE '无案件状态'
END caseStatusName,
c.hear_date,
2023-11-23 22:51:29 +08:00
c.arbitrat_claims,
c.loan_start_date,
c.loan_end_date,
c.claim_princi_owed,
c.claim_interest_owed,
c.claim_liquid_damag,
c.fee_payable,
2023-11-22 13:58:34 +08:00
c.begin_video_date,
c.online_video_person,
2023-11-23 22:51:29 +08:00
c.contract_number,
c.create_by,
2023-11-22 13:58:34 +08:00
c.create_time,
2023-11-23 22:51:29 +08:00
c.update_by,
c.update_time,
2023-11-22 13:58:34 +08:00
c.arbitrator_name,
2023-11-29 11:51:01 +08:00
ca.name,
2023-11-22 13:58:34 +08:00
ca.application_organ_id ,
ca.application_organ_name AS applicantName,
c.arbitrator_id,ca.identity_num ,ca.identity_type,
2023-11-29 11:51:01 +08:00
c.filearbitra_url,c.lock_status,l.version,l.update_submit_status as updateSubmitStatus
2023-11-22 13:58:34 +08:00
FROM
case_application c
JOIN case_application_log l ON c.id = l.case_appli_id
JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id
AND ca.identity_type = 1
WHERE
2023-11-29 11:51:01 +08:00
l.update_submit_status IN ( 1, 2 ) and ca.identity_type=1
<!-- <if test="caseStatusList != null and caseStatusList.size() > 0">-->
<!-- and c.case_status in-->
<!-- <foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">-->
<!-- #{caseStatus}-->
<!-- </foreach>-->
<!-- </if>-->
2023-11-22 13:58:34 +08:00
<if test="deptIds != null and deptIds.size() > 0">
and ca.application_organ_id in
<foreach item="item" collection="deptIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
2023-11-29 11:51:01 +08:00
<!-- <if test="caseStatus != null">-->
<!-- AND c.case_status = #{caseStatus}-->
<!-- </if>-->
2023-11-22 13:58:34 +08:00
<if test="lockStatus != null">
AND c.lock_status = #{lockStatus}
</if>
<if test="caseNum != null and caseNum != ''">
AND c.case_num = #{caseNum}
</if>
<if test="nameId != null and nameId != ''">
AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
</if>
<!-- <if test="caseStatusList != null and caseStatusList.size() > 0">-->
<!-- and c.case_status in (1,5)-->
<!-- </if>-->
<!-- 查询该案件的最新记录 -->
AND l.version = (
SELECT
max( version ) version
FROM
case_application_log
WHERE
2023-11-23 18:47:16 +08:00
c.id = case_appli_id)
2023-11-29 11:51:01 +08:00
) tt2
<where>
<if test="caseStatusList != null and caseStatusList.size() > 0">
2023-11-29 13:01:30 +08:00
and tt2.case_status in
2023-11-29 11:51:01 +08:00
<foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
#{caseStatus}
</foreach>
</if>
<if test="caseStatus != null">
2023-11-29 13:01:30 +08:00
AND tt2.case_status = #{caseStatus}
2023-11-29 11:51:01 +08:00
</if>
</where>
2023-11-22 13:58:34 +08:00
</if>
</trim>
) t1
order by t1.create_time desc,t1.case_num desc
</select>
2023-10-30 15:56:34 +08:00
<select id="selectHandledCase" resultMap="CaseApplicationResult">
select DISTINCT(c.id) id,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
ELSE '无审理方式'
END arbitratMethodName,
c.case_status ,
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
when 31 then '待修改开庭时间'
ELSE '无案件状态'
END caseStatusName,
c.hear_date ,c.arbitrat_claims ,
c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,c.lock_status,
2023-11-27 17:59:24 +08:00
c.update_by ,c.update_time , c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName,c.filearbitra_url,c.version
2023-10-30 15:56:34 +08:00
from case_log_record r
join case_application c on r.case_appli_id=c.id
2023-11-29 11:51:01 +08:00
JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1
2023-10-30 15:56:34 +08:00
<where>
2023-11-29 11:51:01 +08:00
2023-10-30 15:56:34 +08:00
<if test="lockStatus != null">
AND c.lock_status = #{lockStatus}
</if>
<if test="caseNum != null and caseNum != ''">
AND c.case_num = #{caseNum}
</if>
<if test="nameId != null and nameId != ''">
AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
</if>
<if test="loginUserName != null and loginUserName != ''">
AND r.create_by=#{loginUserName} AND ca.identity_type=1
</if>
2023-11-02 14:49:18 +08:00
2023-10-30 15:56:34 +08:00
</where>
order by c.create_time desc,c.case_num desc
</select>
2023-09-11 14:29:15 +08:00
<select id="selectCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
2023-11-14 11:35:26 +08:00
select DISTINCT(t1.id),t1.case_num,t1.case_subject_amount,t1.register_date,t1.arbitrat_method,
t1.arbitratMethodName,t1.case_status,t1.caseStatusName,t1.hear_date,t1.arbitrat_claims,
t1.loan_start_date,t1.loan_end_date,t1.claim_princi_owed,t1.claim_interest_owed,t1.claim_liquid_damag,t1.fee_payable,
t1.begin_video_date,t1.online_video_person,t1.contract_number,t1.create_by,t1.create_time,t1.update_by,t1.update_time,
t1.arbitrator_name,t1.name,t1.application_organ_id,t1.applicantName,t1.arbitrator_id,t1.identity_num,t1.identity_type,
2023-11-22 13:58:34 +08:00
t1.filearbitra_url,t1.lock_status,t1.version
2023-11-14 11:35:26 +08:00
from(
select t.id,t.case_num ,t.case_subject_amount ,t.register_date ,t.arbitrat_method,
2023-10-18 18:04:31 +08:00
t.arbitratMethodName,t.case_status,t.caseStatusName,t.hear_date ,t.arbitrat_claims ,
2023-10-17 11:47:11 +08:00
t.loan_start_date ,t.loan_end_date ,t.claim_princi_owed ,t.claim_interest_owed ,t.claim_liquid_damag,t.fee_payable ,
t.begin_video_date ,t.online_video_person ,t.contract_number ,t.create_by ,t.create_time ,
2023-10-17 12:19:47 +08:00
t.update_by ,t.update_time , t.arbitrator_name,t.name,t.application_organ_id,t.applicantName,
2023-11-22 13:58:34 +08:00
t.arbitrator_id,t.identity_num , t.identity_type,t.filearbitra_url,t.lock_status,t.version
2023-10-17 11:47:11 +08:00
from(
2023-09-22 14:59:02 +08:00
select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
2023-10-16 20:44:30 +08:00
ELSE '无审理方式'
END arbitratMethodName,
2023-09-22 14:59:02 +08:00
c.case_status ,
2023-09-19 21:09:21 +08:00
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
2023-10-16 20:44:30 +08:00
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
2023-10-25 11:01:37 +08:00
when 31 then '待修改开庭时间'
2023-10-16 20:44:30 +08:00
ELSE '无案件状态'
END caseStatusName,
2023-09-19 21:09:21 +08:00
c.hear_date ,c.arbitrat_claims ,
2023-10-16 20:44:30 +08:00
c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag
,c.fee_payable ,
2023-09-20 15:53:56 +08:00
c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
2023-10-16 20:44:30 +08:00
c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name as
applicantName,
2023-11-22 13:58:34 +08:00
c.arbitrator_id,ca.identity_num , ca.identity_type,c.filearbitra_url,c.lock_status,c.version
2023-09-11 14:29:15 +08:00
from case_application c
2023-11-29 11:51:01 +08:00
JOIN case_affiliate ca ON ca.case_appli_id = c.id
2023-10-15 18:38:28 +08:00
<where>
<if test="caseStatus != null">
AND c.case_status = #{caseStatus}
</if>
<if test="caseNum != null and caseNum != ''">
AND c.case_num = #{caseNum}
</if>
2023-11-06 14:50:46 +08:00
<if test="nameId != null and nameId != ''">
AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
</if>
2023-10-15 18:38:28 +08:00
<if test="caseStatusList != null and caseStatusList.size() > 0">
and c.case_status in
<foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
#{caseStatus}
</foreach>
</if>
2023-10-20 14:47:58 +08:00
<if test="lockStatus != null">
AND c.lock_status = #{lockStatus}
</if>
2023-10-15 18:38:28 +08:00
</where>
2023-10-15 22:28:44 +08:00
) t
<where>
2023-10-16 20:44:30 +08:00
<!--被申请人-->
<if test="idCard != null and idCard != ''">
2023-10-18 19:27:31 +08:00
or (t.identity_num=#{idCard} AND t.identity_type=2 and (t.case_status=4 or t.case_status=17))
2023-10-16 20:44:30 +08:00
</if>
<!--仲裁员-->
<if test="userId != null and userId != ''">
or ( t.identity_type=1 and
2023-11-02 15:34:32 +08:00
t.case_status in (7,8,9,12,13,17)
2023-10-16 20:44:30 +08:00
and
instr (t.arbitrator_id,#{userId})>0)
</if>
2023-11-22 13:58:34 +08:00
<!--法律顾问秘书-->
2023-11-29 11:51:01 +08:00
<!-- <if test="deptIds != null and deptIds.size() > 0">-->
<!-- or (t.identity_type=1 and t.case_status in (1,5,11,15,16,17,31)-->
<!-- and t.application_organ_id in-->
<!-- <foreach item="item" collection="deptIds" open="(" separator="," close=")">-->
<!-- #{item}-->
<!-- </foreach> )-->
<!-- </if>-->
2023-10-17 12:19:47 +08:00
2023-10-18 18:04:31 +08:00
<!--申请人-->
2023-11-14 11:35:26 +08:00
<if test="applicationOrganId != null and applicationOrganId != ''">
2023-11-06 14:50:46 +08:00
or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1
2023-11-22 13:58:34 +08:00
<!--暂时改为可以查询到生成裁决书之前所有的案件状态-->
and (t.case_status &lt;= 10 or t.case_status=31))
2023-10-17 12:19:47 +08:00
2023-10-18 18:04:31 +08:00
</if>
<!--部门长-->
2023-10-17 12:19:47 +08:00
<if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
2023-10-18 18:04:31 +08:00
or (t.identity_type=1 and t.case_status in
<foreach item="caseStatus" collection="deptHeadStatus" open="(" separator="," close=")">#{caseStatus}
</foreach>)
2023-10-17 12:19:47 +08:00
</if>
2023-10-17 13:50:15 +08:00
<!--财务-->
2023-10-17 12:19:47 +08:00
<if test="financeStatus != null and financeStatus != ''">
2023-10-18 18:11:00 +08:00
or (t.identity_type=1 and t.case_status =#{financeStatus})
2023-10-18 18:04:31 +08:00
2023-10-15 18:38:28 +08:00
</if>
2023-11-16 15:59:40 +08:00
<!--代理人-->
<if test="agentDeptIds != null and agentDeptIds.size()>0">
or (
t.application_organ_id in
<foreach item="deptId" collection="agentDeptIds" open="(" separator="," close=")">#{deptId}
</foreach>
2023-11-29 11:51:01 +08:00
AND t.identity_type=1
2023-11-16 15:59:40 +08:00
and t.case_status in (0,9))
2023-10-18 19:27:31 +08:00
2023-11-16 15:59:40 +08:00
</if>
2023-10-15 18:38:28 +08:00
</where>
) t1
2023-10-18 18:19:14 +08:00
2023-10-15 18:38:28 +08:00
order by t1.create_time desc,t1.case_num desc
</select>
2023-10-17 11:47:11 +08:00
<select id="selectTodoCountByRole" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
select sum( case when t1.case_status=0 then 1 else 0 end) caseApply,
sum( case when t1.case_status=1 then 1 else 0 end) caseApplyCheck,
sum( case when t1.case_status=2 then 1 else 0 end) caseApplyPay,
sum( case when t1.case_status=3 then 1 else 0 end) caseApplyPayCheck,
sum( case when t1.case_status=4 then 1 else 0 end) caseApplyEvidence,
sum( case when t1.case_status=5 then 1 else 0 end) caseApplyGroupCheck,
sum( case when t1.case_status=6 then 1 else 0 end) caseApplyGroupConfirm,
sum( case when t1.case_status=7 then 1 else 0 end) caseApplyArbitrateWay,
sum( case when t1.case_status=8 then 1 else 0 end) caseApplyGroupOnline,
sum( case when t1.case_status=9 then 1 else 0 end) caseApplyGroupOffline,
sum( case when t1.case_status=10 then 1 else 0 end) caseApplyAward,
sum( case when t1.case_status=11 then 1 else 0 end) caseApplyAwardCheck,
sum( case when t1.case_status=12 then 1 else 0 end) caseApplyAwardConfirm,
sum( case when t1.case_status=13 then 1 else 0 end) caseApplyAwardSign,
sum( case when t1.case_status=14 then 1 else 0 end) caseApplyAwardSeal,
sum( case when t1.case_status=15 then 1 else 0 end) caseApplyAwardSend,
sum( case when t1.case_status=16 then 1 else 0 end) caseApplyStored,
2023-10-23 16:08:51 +08:00
sum( case when t1.case_status=17 then 1 else 0 end) caseApplyArchived,
sum( case when t1.case_status=31 then 1 else 0 end) updateOnlineHearDate
2023-10-17 11:47:11 +08:00
from(
2023-11-22 13:58:34 +08:00
<trim suffixOverrides="union">
2023-11-29 11:51:01 +08:00
<!--被申请人,仲裁员,部门长,财务,代理人案件-->
<if test="isOtherRole!=null and isOtherRole==1">
select DISTINCT(t.id),t.case_status,t.application_organ_id, t.arbitrator_id,t.identity_num , t.identity_type from(
select c.id ,
c.case_status,ca.application_organ_id,
c.arbitrator_id,ca.identity_num , ca.identity_type
from case_application c
JOIN case_affiliate ca ON ca.case_appli_id = c.id
<where>
<if test="caseStatus != null">
AND c.case_status = #{caseStatus}
</if>
2023-10-17 11:47:11 +08:00
2023-11-29 11:51:01 +08:00
<if test="caseStatusList != null and caseStatusList.size() > 0">
and c.case_status in
<foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
#{caseStatus}
</foreach>
</if>
</where>
) t
<where>
<!--被申请人-->
<if test="idCard != null and idCard != ''">
or (t.identity_num=#{idCard} AND t.identity_type=2 and (t.case_status=4 or t.case_status=17))
</if>
<!--仲裁员-->
<if test="userId != null and userId != ''">
or ( t.identity_type=1 and
t.case_status in (7,8,9,11,13,17)
and
instr (t.arbitrator_id,#{userId})>0)
</if>
<!--法律顾问-->
<!-- <if test="deptIds != null and deptIds.size() > 0">-->
<!-- or (t.identity_type=1 and t.case_status in (1,5,11,15,16,17,31)-->
<!-- and t.application_organ_id in-->
<!-- <foreach item="item" collection="deptIds" open="(" separator="," close=")">-->
<!-- #{item}-->
<!-- </foreach> )-->
<!-- </if>-->
<!--申请人-->
<if test="applicationOrganId != null and applicationOrganId != ''">
or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1
and t.case_status in (0,2,17))
</if>
<!--部门长-->
<if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
or (t.identity_type=1 and t.case_status in
<foreach item="caseStatus" collection="deptHeadStatus" open="(" separator="," close=")">
#{caseStatus}
</foreach>)
</if>
<!--财务-->
<if test="financeStatus != null and financeStatus != ''">
or ( t.identity_type=1 and t.case_status =#{financeStatus})
</if>
<!--代理人-->
<if test="agentDeptIds != null and agentDeptIds.size()>0">
or (
t.application_organ_id in
<foreach item="deptId" collection="agentDeptIds" open="(" separator="," close=")">#{deptId}
</foreach>
AND t.identity_type=1
and t.case_status in (0,9))
</if>
</where>
union
2023-10-17 11:47:11 +08:00
</if>
2023-11-29 11:51:01 +08:00
<!-- <if test="applicationOrganId != null and applicationOrganId != ''">-->
<!-- &lt;!&ndash;申请人案件&ndash;&gt;-->
2023-10-17 14:29:06 +08:00
2023-11-29 11:51:01 +08:00
<!-- select l.case_appli_id id ,-->
<!-- c.case_status,ca.application_organ_id,-->
<!-- c.arbitrator_id,ca.identity_num , ca.identity_type-->
<!-- from case_application c-->
<!-- JOIN case_application_log l ON c.id = l.case_appli_id-->
<!-- JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id AND ca.identity_type = 1 and c.version=l.version-->
<!-- <where>-->
<!-- (c.case_status &lt;= 10 or c.case_status=31) AND ca.identity_type=1-->
2023-10-18 18:04:31 +08:00
2023-11-29 11:51:01 +08:00
<!-- <if test="applicationOrganId != null and applicationOrganId != ''">-->
<!-- AND ca.application_organ_id = #{applicationOrganId}-->
<!-- </if>-->
<!-- <if test="caseStatus != null">-->
<!-- AND c.case_status = #{caseStatus}-->
<!-- </if>-->
<!-- <if test="caseNum != null and caseNum != ''">-->
<!-- AND c.case_num = #{caseNum}-->
<!-- </if>-->
<!-- <if test="nameId != null and nameId != ''">-->
<!-- AND ca.application_organ_id=#{nameId}-->
<!-- </if>-->
2023-11-17 10:39:01 +08:00
2023-11-29 11:51:01 +08:00
<!-- <if test="lockStatus != null">-->
<!-- AND c.lock_status = #{lockStatus}-->
<!-- </if>-->
<!-- </where>-->
<!-- union-->
<!-- </if>-->
2023-11-22 13:58:34 +08:00
<!--秘书案件-->
<if test="deptIds != null and deptIds.size() > 0">
select c.id ,
c.case_status,ca.application_organ_id,
c.arbitrator_id,ca.identity_num , ca.identity_type
FROM
case_application c
JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type = 1
2023-11-23 09:02:20 +08:00
JOIN case_application_log l on l.case_appli_id=c.id and l.update_submit_status not in(1,2) and l.version
2023-11-22 13:58:34 +08:00
= (
SELECT
max( version ) version
FROM
case_application_log
WHERE case_appli_id = c.id
2023-11-29 11:51:01 +08:00
)
2023-11-22 13:58:34 +08:00
WHERE
2023-11-28 19:51:27 +08:00
ca.identity_type=1 and c.case_status in (1,5,14,15,16,17,31)
2023-11-22 13:58:34 +08:00
<if test="deptIds != null and deptIds.size() > 0">
and ca.application_organ_id in
<foreach item="item" collection="deptIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="caseStatus != null">
AND c.case_status = #{caseStatus}
</if>
2023-11-29 11:51:01 +08:00
2023-11-22 13:58:34 +08:00
<if test="nameId != null and nameId != ''">
AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
</if>
</if>
</trim>
2023-10-17 11:47:11 +08:00
) t1
2023-10-15 18:38:28 +08:00
</select>
2023-10-17 11:47:11 +08:00
2023-10-15 18:38:28 +08:00
<select id="selectAdminCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
2023-10-17 14:29:06 +08:00
select DISTINCT(c.id) id,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
2023-10-15 18:38:28 +08:00
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
ELSE '无审理方式'
END arbitratMethodName,
c.case_status ,
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
2023-10-25 11:01:37 +08:00
when 31 then '待修改开庭时间'
2023-10-15 18:38:28 +08:00
ELSE '无案件状态'
END caseStatusName,
c.hear_date ,c.arbitrat_claims ,
c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
2023-10-20 14:47:58 +08:00
c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,c.lock_status,
2023-11-29 11:51:01 +08:00
c.update_by ,c.update_time , c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName,c.filearbitra_url,(select version from
case_application_log where case_appli_id=c.id order by version desc limit 1) as version,(select
update_submit_status from case_application_log where case_appli_id=c.id order by version desc limit 1)
as updateSubmitStatus
2023-10-15 18:38:28 +08:00
from case_application c
2023-11-29 11:51:01 +08:00
JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1
JOIN case_application_log l ON c.id = l.case_appli_id and c.version=l.version
2023-09-11 14:29:15 +08:00
<where>
2023-09-20 17:56:53 +08:00
<if test="caseStatus != null">
2023-09-11 14:29:15 +08:00
AND c.case_status = #{caseStatus}
</if>
2023-10-20 14:47:58 +08:00
<if test="lockStatus != null">
AND c.lock_status = #{lockStatus}
</if>
2023-09-11 14:29:15 +08:00
<if test="caseNum != null and caseNum != ''">
AND c.case_num = #{caseNum}
</if>
2023-10-11 11:54:57 +08:00
<if test="nameId != null and nameId != ''">
2023-10-15 18:38:28 +08:00
AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
2023-10-10 16:00:34 +08:00
</if>
2023-09-20 16:51:43 +08:00
<if test="caseStatusList != null and caseStatusList.size() > 0">
and c.case_status in
<foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
#{caseStatus}
</foreach>
</if>
2023-09-11 14:29:15 +08:00
</where>
order by c.create_time desc,c.case_num desc
2023-09-11 14:29:15 +08:00
</select>
2023-10-17 11:47:11 +08:00
<select id="selectAdminCaseToDoCount" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
SELECT
sum( case when c.case_status=0 then 1 else 0 end) caseApply,
sum( case when c.case_status=1 then 1 else 0 end) caseApplyCheck,
sum( case when c.case_status=2 then 1 else 0 end) caseApplyPay,
sum( case when c.case_status=3 then 1 else 0 end) caseApplyPayCheck,
sum( case when c.case_status=4 then 1 else 0 end) caseApplyEvidence,
sum( case when c.case_status=5 then 1 else 0 end) caseApplyGroupCheck,
sum( case when c.case_status=6 then 1 else 0 end) caseApplyGroupConfirm,
sum( case when c.case_status=7 then 1 else 0 end) caseApplyArbitrateWay,
sum( case when c.case_status=8 then 1 else 0 end) caseApplyGroupOnline,
sum( case when c.case_status=9 then 1 else 0 end) caseApplyGroupOffline,
sum( case when c.case_status=10 then 1 else 0 end) caseApplyAward,
sum( case when c.case_status=11 then 1 else 0 end) caseApplyAwardCheck,
sum( case when c.case_status=12 then 1 else 0 end) caseApplyAwardConfirm,
sum( case when c.case_status=13 then 1 else 0 end) caseApplyAwardSign,
sum( case when c.case_status=14 then 1 else 0 end) caseApplyAwardSeal,
sum( case when c.case_status=15 then 1 else 0 end) caseApplyAwardSend,
sum( case when c.case_status=16 then 1 else 0 end) caseApplyStored,
2023-10-24 10:11:58 +08:00
sum( case when c.case_status=17 then 1 else 0 end) caseApplyArchived,
sum( case when c.case_status=31 then 1 else 0 end) updateOnlineHearDate
2023-10-17 11:47:11 +08:00
FROM
case_application c
2023-10-18 18:04:31 +08:00
JOIN case_affiliate ca ON ca.case_appli_id = c.id
2023-10-17 11:47:11 +08:00
AND ca.identity_type = 1
WHERE
c.case_status IN (
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
2023-10-24 10:03:09 +08:00
17,
31
2023-10-17 11:47:11 +08:00
)
</select>
2023-10-16 20:44:30 +08:00
2023-09-11 14:29:15 +08:00
<select id="selectCaseApplicationCount" parameterType="CaseApplication" resultType="int">
select count(1) from case_application c
<where>
<if test="caseNum != null and caseNum != ''">
AND c.case_num = #{caseNum}
</if>
</where>
</select>
2023-11-22 13:58:34 +08:00
<select id="selectApplicationCase" resultMap="CaseApplicationResult">
SELECT
l.case_appli_id id,
l.id AS caseLogId,
l.version,
l.case_num,
l.case_subject_amount,
c.register_date,
c.arbitrat_method,
CASE
c.arbitrat_method
WHEN 1 THEN
'开庭审理'
WHEN 2 THEN
'书面审理' ELSE '无审理方式'
END arbitratMethodName,
c.case_status,
CASE
c.case_status
WHEN 0 THEN
'立案申请'
WHEN 1 THEN
'待立案审查'
WHEN 2 THEN
'待缴费'
WHEN 3 THEN
'待缴费确认'
WHEN 4 THEN
'待案件质证'
WHEN 5 THEN
'待组庭审核'
WHEN 6 THEN
'待组庭确定'
WHEN 7 THEN
'待审核仲裁方式'
WHEN 8 THEN
'待开庭审理'
WHEN 9 THEN
'待书面审理'
WHEN 10 THEN
'待生成仲裁文书'
WHEN 11 THEN
'待核验仲裁文书'
WHEN 12 THEN
'待审核仲裁文书'
WHEN 13 THEN
'待仲裁文书签名'
WHEN 14 THEN
'待仲裁文书用印'
WHEN 15 THEN
'待仲裁文书送达'
WHEN 16 THEN
'待案件归档'
WHEN 17 THEN
'已归档'
WHEN 31 THEN
'待修改开庭时间' ELSE '无案件状态'
END caseStatusName,
c.hear_date,
l.arbitrat_claims,
l.loan_start_date,
l.loan_end_date,
l.claim_princi_owed,
l.claim_interest_owed,
l.claim_liquid_damag,
l.fee_payable,
c.begin_video_date,
c.online_video_person,
l.contract_number,
l.create_by,
c.create_time,
c.lock_status,
l.update_by,
l.update_time,
c.arbitrator_name,
ca.application_organ_id applicationOrganId,
ca.application_organ_name AS applicantName,
c.filearbitra_url,l.update_submit_status as updateSubmitStatus,l.case_name
FROM
case_application c
JOIN case_application_log l ON c.id = l.case_appli_id
JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id
AND ca.identity_type = 1
WHERE
2023-11-29 11:51:01 +08:00
ca.identity_type=1
2023-09-11 14:29:15 +08:00
2023-11-29 11:51:01 +08:00
<if test="applicationOrganId != null and applicationOrganId != ''">
2023-11-22 13:58:34 +08:00
or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1
2023-11-29 11:51:01 +08:00
<!--暂时改为可以查询到生成裁决书之前所有的案件状态-->
2023-11-22 13:58:34 +08:00
and (t.case_status &lt;= 10 or t.case_status=31))
2023-11-29 11:51:01 +08:00
<!-- and t.case_status in (0,2,17))-->
2023-11-22 13:58:34 +08:00
2023-11-29 11:51:01 +08:00
</if>
2023-11-22 13:58:34 +08:00
<if test="caseStatus != null">
AND c.case_status = #{caseStatus}
</if>
<if test="lockStatus != null">
AND c.lock_status = #{lockStatus}
</if>
<if test="caseNum != null and caseNum != ''">
AND c.case_num = #{caseNum}
</if>
<if test="nameId != null and nameId != ''">
AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
</if>
<!-- <if test="caseStatusList != null and caseStatusList.size() > 0">-->
<!-- and c.case_status in (1,5)-->
<!-- </if>-->
<!-- 查询该案件的最新记录 -->
AND l.version = (
SELECT
max( version ) version
FROM
case_application_log
WHERE case_appli_id = t.id
2023-11-22 17:14:31 +08:00
update_submit_status IN ( 1, 2 ))
2023-11-22 13:58:34 +08:00
order by c.create_time desc,c.case_num desc
</select>
<select id="selectSecretaryCase" parameterType="CaseApplication" resultMap="CaseApplicationResult">
SELECT
2023-11-29 11:51:01 +08:00
t.id,
t.caseLogId,
max( version ) version,
t.case_num,
t.case_subject_amount,
t.register_date,
t.arbitrat_method,
t.caseStatusName,
t.hear_date,
t.arbitrat_claims,
t.loan_start_date,
t.loan_end_date,
t.claim_princi_owed,
t.claim_interest_owed,
t.claim_liquid_damag,
t.fee_payable,
t.begin_video_date,
t.online_video_person,
t.contract_number,
t.create_by,
t.create_time,
t.lock_status,
t.update_by,
t.update_time,
t.arbitrator_name,
t.applicationOrganId,
t.applicantName,
t.filearbitra_url,
t.updateSubmitStatus,t.case_name
2023-11-22 13:58:34 +08:00
FROM
2023-11-29 11:51:01 +08:00
(
<!-- 查询案件主表 -->
SELECT
c.id,
'' AS caseLogId,
c.version,
c.case_num,
c.case_subject_amount,
c.register_date,
c.arbitrat_method,
CASE
c.arbitrat_method
WHEN 1 THEN
'开庭审理'
WHEN 2 THEN
'书面审理' ELSE '无审理方式'
END arbitratMethodName,
c.case_status,
CASE
c.case_status
WHEN 0 THEN
'立案申请'
WHEN 1 THEN
'待立案审查'
WHEN 2 THEN
'待缴费'
WHEN 3 THEN
'待缴费确认'
WHEN 4 THEN
'待案件质证'
WHEN 5 THEN
'待组庭审核'
WHEN 6 THEN
'待组庭确定'
WHEN 7 THEN
'待审核仲裁方式'
WHEN 8 THEN
'待开庭审理'
WHEN 9 THEN
'待书面审理'
WHEN 10 THEN
'待生成仲裁文书'
WHEN 11 THEN
'待核验仲裁文书'
WHEN 12 THEN
'待审核仲裁文书'
WHEN 13 THEN
'待仲裁文书签名'
WHEN 14 THEN
'待仲裁文书用印'
WHEN 15 THEN
'待仲裁文书送达'
WHEN 16 THEN
'待案件归档'
WHEN 17 THEN
'已归档'
WHEN 31 THEN
'待修改开庭时间' ELSE '无案件状态'
END caseStatusName,
c.hear_date,
c.arbitrat_claims,
c.loan_start_date,
c.loan_end_date,
c.claim_princi_owed,
c.claim_interest_owed,
c.claim_liquid_damag,
c.fee_payable,
c.begin_video_date,
c.online_video_person,
c.contract_number,
c.create_by,
c.create_time,
c.lock_status,
c.update_by,
c.update_time,
c.arbitrator_name,
ca.application_organ_id applicationOrganId,
ca.application_organ_name AS applicantName,
c.filearbitra_url,null as updateSubmitStatus,c.case_name
FROM
case_application c
JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type = 1
JOIN case_application_log l on l.case_appli_id=c.id and l.update_submit_status not in(1, 2) and l.version = (
2023-11-22 13:58:34 +08:00
SELECT
max( version ) version
FROM
case_application_log
WHERE case_appli_id = c.id
2023-11-22 17:14:31 +08:00
update_submit_status IN ( 1, 2 ))
2023-11-29 11:51:01 +08:00
WHERE
2023-11-22 13:58:34 +08:00
ca.identity_type=1 and c.case_status in (1,5)
<if test="deptIds != null and deptIds.size() > 0">
and ca.application_organ_id in
<foreach item="item" collection="deptIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="caseStatus != null">
AND c.case_status = #{caseStatus}
</if>
<if test="lockStatus != null">
AND c.lock_status = #{lockStatus}
</if>
<if test="caseNum != null and caseNum != ''">
AND c.case_num = #{caseNum}
</if>
<if test="nameId != null and nameId != ''">
AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
</if>
2023-11-29 11:51:01 +08:00
UNION
2023-11-22 13:58:34 +08:00
<!-- 查询案件记录表修改提交申请和撤销申请的案件 -->
2023-11-29 11:51:01 +08:00
SELECT
l.case_appli_id id,
l.id AS caseLogId,
l.version,
l.case_num,
l.case_subject_amount,
c.register_date,
c.arbitrat_method,
CASE
c.arbitrat_method
WHEN 1 THEN
'开庭审理'
WHEN 2 THEN
'书面审理' ELSE '无审理方式'
END arbitratMethodName,
c.case_status,
CASE
c.case_status
WHEN 0 THEN
'立案申请'
WHEN 1 THEN
'待立案审查'
WHEN 2 THEN
'待缴费'
WHEN 3 THEN
'待缴费确认'
WHEN 4 THEN
'待案件质证'
WHEN 5 THEN
'待组庭审核'
WHEN 6 THEN
'待组庭确定'
WHEN 7 THEN
'待审核仲裁方式'
WHEN 8 THEN
'待开庭审理'
WHEN 9 THEN
'待书面审理'
WHEN 10 THEN
'待生成仲裁文书'
WHEN 11 THEN
'待核验仲裁文书'
WHEN 12 THEN
'待审核仲裁文书'
WHEN 13 THEN
'待仲裁文书签名'
WHEN 14 THEN
'待仲裁文书用印'
WHEN 15 THEN
'待仲裁文书送达'
WHEN 16 THEN
'待案件归档'
WHEN 17 THEN
'已归档'
WHEN 31 THEN
'待修改开庭时间' ELSE '无案件状态'
END caseStatusName,
c.hear_date,
l.arbitrat_claims,
l.loan_start_date,
l.loan_end_date,
l.claim_princi_owed,
l.claim_interest_owed,
l.claim_liquid_damag,
l.fee_payable,
c.begin_video_date,
c.online_video_person,
l.contract_number,
l.create_by,
c.create_time,
c.lock_status,
l.update_by,
l.update_time,
c.arbitrator_name,
ca.application_organ_id applicationOrganId,
ca.application_organ_name AS applicantName,
c.filearbitra_url,l.update_submit_status as updateSubmitStatus,l.case_name
FROM
case_application c
JOIN case_application_log l ON c.id = l.case_appli_id
JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id
AND ca.identity_type = 1
WHERE
l.update_submit_status IN ( 1, 2 ) and ca.identity_type=1
<if test="deptIds != null and deptIds.size() > 0">
and ca.application_organ_id in
<foreach item="item" collection="deptIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="caseStatus != null">
AND c.case_status = #{caseStatus}
</if>
<if test="lockStatus != null">
AND c.lock_status = #{lockStatus}
</if>
<if test="caseNum != null and caseNum != ''">
AND c.case_num = #{caseNum}
</if>
<if test="nameId != null and nameId != ''">
AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
</if>
<!-- <if test="caseStatusList != null and caseStatusList.size() > 0">-->
<!-- and c.case_status in (1,5)-->
<!-- </if>-->
<!-- 查询该案件的最新记录 -->
AND l.version = (
SELECT
max( version ) version
FROM
case_application_log
WHERE
update_submit_status IN ( 1, 2 ))
) t
2023-11-22 13:58:34 +08:00
GROUP BY
2023-11-29 11:51:01 +08:00
t.id,
t.caseLogId,
t.version,
t.case_num,
t.case_subject_amount,
t.register_date,
t.arbitrat_method,
t.caseStatusName,
t.hear_date,
t.arbitrat_claims,
t.loan_start_date,
t.loan_end_date,
t.claim_princi_owed,
t.claim_interest_owed,
t.claim_liquid_damag,
t.fee_payable,
t.begin_video_date,
t.online_video_person,
t.contract_number,
t.create_by,
t.create_time,
t.lock_status,
t.update_by,
t.update_time,
t.arbitrator_name,
t.applicationOrganId,
t.applicantName,
t.filearbitra_url,
t.updateSubmitStatus,
t.case_name
2023-11-22 13:58:34 +08:00
ORDER BY
2023-11-29 11:51:01 +08:00
t.create_time DESC,
t.case_num DESC
2023-11-22 13:58:34 +08:00
</select>
2023-09-11 14:29:15 +08:00
<insert id="insertCaseApplication" parameterType="CaseApplication" useGeneratedKeys="true" keyProperty="id">
insert into case_application(
2023-11-03 10:57:15 +08:00
<if test="caseName != null and caseName != ''">case_name ,</if>
2023-09-11 14:29:15 +08:00
<if test="caseNum != null and caseNum != ''">case_num,</if>
<if test="caseSubjectAmount != null">case_subject_amount,</if>
2023-10-12 11:17:48 +08:00
register_date,
2023-09-11 14:29:15 +08:00
<if test="arbitratMethod != null and arbitratMethod != ''">arbitrat_method,</if>
<if test="caseStatus != null ">case_status,</if>
<if test="hearDate != null ">hear_date,</if>
<if test="arbitratClaims != null and arbitratClaims != ''">arbitrat_claims,</if>
2023-10-17 15:30:21 +08:00
<if test="requestRule != null and requestRule != ''">request_rule,</if>
2023-09-11 14:29:15 +08:00
<if test="loanStartDate != null ">loan_start_date,</if>
<if test="loanEndDate != null ">loan_end_date,</if>
<if test="claimPrinciOwed != null ">claim_princi_owed,</if>
<if test="claimInterestOwed != null ">claim_interest_owed,</if>
<if test="claimLiquidDamag != null ">claim_liquid_damag,</if>
<if test="feePayable != null ">fee_payable,</if>
<if test="beginVideoDate != null ">begin_video_date,</if>
<if test="onlineVideoPerson != null and onlineVideoPerson != ''">online_video_person,</if>
<if test="contractNumber != null and contractNumber != ''">contract_number,</if>
2023-10-17 15:30:21 +08:00
<if test="adjudicaCounter != null ">adjudica_counter,</if>
<if test="properPreser != null ">proper_preser,</if>
2023-09-11 14:29:15 +08:00
<if test="createBy != null and createBy != ''">create_by,</if>
2023-11-01 11:06:44 +08:00
<if test="importFlag != null ">import_flag,</if>
2023-11-22 13:58:34 +08:00
<if test="version != null ">version,</if>
2023-09-11 14:29:15 +08:00
create_time
)values(
2023-11-03 10:57:15 +08:00
<if test="caseName != null and caseName != ''">#{caseName},</if>
2023-09-11 14:29:15 +08:00
<if test="caseNum != null and caseNum != ''">#{caseNum},</if>
<if test="caseSubjectAmount != null">#{caseSubjectAmount},</if>
2023-10-18 18:04:31 +08:00
sysdate(),
2023-09-11 14:29:15 +08:00
<if test="arbitratMethod != null and arbitratMethod != ''">#{arbitratMethod},</if>
<if test="caseStatus != null ">#{caseStatus},</if>
<if test="hearDate != null ">#{hearDate},</if>
<if test="arbitratClaims != null and arbitratClaims != ''">#{arbitratClaims},</if>
2023-10-17 15:30:21 +08:00
<if test="requestRule != null and requestRule != ''">#{requestRule},</if>
2023-09-11 14:29:15 +08:00
<if test="loanStartDate != null ">#{loanStartDate},</if>
<if test="loanEndDate != null ">#{loanEndDate},</if>
<if test="claimPrinciOwed != null ">#{claimPrinciOwed},</if>
<if test="claimInterestOwed != null ">#{claimInterestOwed},</if>
<if test="claimLiquidDamag != null ">#{claimLiquidDamag},</if>
<if test="feePayable != null ">#{feePayable},</if>
<if test="beginVideoDate != null ">#{beginVideoDate},</if>
<if test="onlineVideoPerson != null and onlineVideoPerson != ''">#{onlineVideoPerson},</if>
<if test="contractNumber != null and contractNumber != ''">#{contractNumber},</if>
2023-10-17 15:30:21 +08:00
<if test="adjudicaCounter != null ">#{adjudicaCounter},</if>
<if test="properPreser != null ">#{properPreser},</if>
2023-09-11 14:29:15 +08:00
<if test="createBy != null and createBy != ''">#{createBy},</if>
2023-11-01 11:06:44 +08:00
<if test="importFlag != null ">#{importFlag},</if>
2023-11-22 13:58:34 +08:00
<if test="version != null ">#{version},</if>
2023-09-11 14:29:15 +08:00
sysdate()
)
</insert>
<update id="updataCaseApplication" parameterType="CaseApplication">
update case_application
<set>
<if test="caseSubjectAmount != null">case_subject_amount = #{caseSubjectAmount},</if>
<if test="registerDate != null">register_date = #{registerDate},</if>
<if test="arbitratMethod != null and arbitratMethod != ''">arbitrat_method = #{arbitratMethod},</if>
<if test="hearDate != null ">hear_date = #{hearDate},</if>
<if test="arbitratClaims != null and arbitratClaims != ''">arbitrat_claims = #{arbitratClaims},</if>
2023-10-17 15:30:21 +08:00
<if test="requestRule != null and requestRule != ''">request_rule = #{requestRule},</if>
2023-09-11 14:29:15 +08:00
<if test="loanStartDate != null ">loan_start_date = #{loanStartDate},</if>
<if test="loanEndDate != null ">loan_end_date = #{loanEndDate},</if>
<if test="loanEndDate != null ">claim_princi_owed = #{claimPrinciOwed},</if>
<if test="claimInterestOwed != null ">claim_interest_owed = #{claimInterestOwed},</if>
<if test="claimLiquidDamag != null ">claim_liquid_damag = #{claimLiquidDamag},</if>
<if test="feePayable != null ">fee_payable = #{feePayable},</if>
<if test="beginVideoDate != null ">begin_video_date = #{beginVideoDate},</if>
<if test="onlineVideoPerson != null and onlineVideoPerson != ''">online_video_person = #{onlineVideoPerson},</if>
<if test="contractNumber != null and contractNumber != ''">contract_number = #{contractNumber},</if>
2023-09-18 18:15:34 +08:00
<if test="caseName != null and caseName != ''">case_name = #{caseName},</if>
<if test="caseDescribe != null and caseDescribe != ''">case_describe = #{caseDescribe},</if>
<if test="caseResult != null and caseResult != ''">case_result = #{caseResult},</if>
<if test="caseStatus != null">case_status = #{caseStatus},</if>
2023-11-01 14:29:16 +08:00
<if test="properPreser != null">proper_preser = #{properPreser},</if>
2023-09-18 18:15:34 +08:00
2023-09-11 14:29:15 +08:00
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
2023-09-22 17:03:26 +08:00
<if test="caseNum != null and caseNum != ''">case_num = #{caseNum},</if>
2023-11-22 13:58:34 +08:00
<if test="version != null and version != ''">version = #{version},</if>
2023-09-11 14:29:15 +08:00
update_time = sysdate()
</set>
where id = #{id}
</update>
<update id="submitCaseApplication" parameterType="CaseApplication">
update case_application
<set>
2023-09-14 18:40:44 +08:00
<if test="caseStatus != null">case_status = #{caseStatus},</if>
<if test="arbitratorId != null and arbitratorId != ''">arbitrator_id = #{arbitratorId},</if>
<if test="arbitratorName != null and arbitratorName != ''">arbitrator_name = #{arbitratorName},</if>
<if test="pendingAppointArbotrar != null ">pending_appoint_arbotrar = #{pendingAppointArbotrar},</if>
2023-09-18 15:33:40 +08:00
<if test="arbitratMethod != null ">arbitrat_method = #{arbitratMethod},</if>
2023-09-18 18:15:34 +08:00
<if test="caseName != null and caseName != ''">case_name = #{caseName},</if>
<if test="caseDescribe != null and caseDescribe != ''">case_describe = #{caseDescribe},</if>
<if test="caseResult != null and caseResult != ''">case_result = #{caseResult},</if>
2023-09-19 10:13:16 +08:00
<if test="isAgreePendTral != null">is_agree_pend_tral = #{isAgreePendTral},</if>
2023-10-17 15:30:21 +08:00
<if test="adjudicaCounter != null">adjudica_counter = #{adjudicaCounter},</if>
<if test="objectiJuris != null">objecti_juris = #{objectiJuris},</if>
<if test="isAbsence != null">is_absence = #{isAbsence},</if>
<if test="appliIsAbsen != null">appli_is_absen = #{appliIsAbsen},</if>
<if test="responCrossOpin != null and responCrossOpin != ''">respon_cross_opin = #{responCrossOpin},</if>
<if test="applicaCrossOpin != null and applicaCrossOpin != ''">applica_cross_opin = #{applicaCrossOpin},</if>
<if test="responDefenOpini != null and responDefenOpini != ''">respon_defen_opini = #{responDefenOpini},</if>
2023-09-19 14:42:31 +08:00
<if test="objectionAddEviden != null">objection_add_eviden = #{objectionAddEviden},</if>
<if test="openCourtHear != null">open_court_hear = #{openCourtHear},</if>
2023-09-19 21:09:21 +08:00
<if test="hearDate != null">hear_date = #{hearDate},</if>
2023-10-15 10:16:48 +08:00
<if test="filearbitraUrl != null and filearbitraUrl != ''">filearbitra_url = #{filearbitraUrl},</if>
2023-11-25 11:03:51 +08:00
<if test="adjudicaCounterReason != null and adjudicaCounterReason != ''">adjudica_counter_reason = #{adjudicaCounterReason},</if>
2023-09-11 14:29:15 +08:00
</set>
where id = #{id}
</update>
2023-10-15 18:50:54 +08:00
<update id="updatePayType">
2023-11-23 20:15:55 +08:00
update case_application set pay_type=#{payType} where id in
2023-11-23 17:35:59 +08:00
<foreach item="caseId" collection="caseIds" open="(" separator="," close=")">
#{caseId}
</foreach>
2023-10-15 18:50:54 +08:00
</update>
2023-10-20 14:47:58 +08:00
<update id="updateCaseLockStatus">
update case_application set lock_status=#{lockStatus} where id = #{id}
</update>
2023-10-27 16:24:42 +08:00
<update id="bindCaseId">
2023-11-24 19:22:32 +08:00
update case_application set room_id=#{roomId} where id = #{caseId}
2023-11-22 17:14:31 +08:00
2023-11-29 11:51:01 +08:00
<!-- update case_application set room_id= CONCAT(room_id,',',#{roomId}) where id =#{caseId} -->
2023-10-27 16:24:42 +08:00
</update>
2023-11-22 13:58:34 +08:00
<update id="updateVersionById">
update case_application set version = #{version} where id = #{id}
</update>
2023-09-11 14:29:15 +08:00
<delete id="deletecaseApplication" parameterType="CaseApplication">
delete from case_application where id = #{id}
</delete>
2023-10-20 15:43:44 +08:00
<delete id="batchDeletecaseApplication">
delete from case_application
where id in
2023-10-20 16:26:31 +08:00
<foreach collection="ids" item="item" open="(" separator="," close=")">
#{item}
2023-10-20 15:43:44 +08:00
</foreach>
</delete>
2023-09-11 14:29:15 +08:00
<select id="selectCaseApplication" parameterType="CaseApplication" resultMap="CaseApplicationResult">
2023-09-22 14:59:02 +08:00
select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
2023-10-18 18:04:31 +08:00
ELSE '无审理方式'
END arbitratMethodName,
2023-11-29 11:51:01 +08:00
c.case_name,
2023-09-22 14:59:02 +08:00
c.case_status ,
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 15 then '待仲裁文书送达' when 16 then '待案件归档'
ELSE '无案件状态'
END caseStatusName,
c.hear_date ,c.arbitrat_claims ,
2023-09-11 14:29:15 +08:00
c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
2023-10-17 15:30:21 +08:00
c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,c.request_rule,c.adjudica_counter,c.proper_preser,
2023-10-17 18:56:35 +08:00
c.is_absence ,c.respon_cross_opin ,c.applica_cross_opin ,c.respon_defen_opini ,
2023-10-15 18:50:54 +08:00
c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName
2023-09-11 14:29:15 +08:00
from case_application c
2023-10-10 20:53:40 +08:00
LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
2023-10-15 18:50:54 +08:00
2023-09-11 14:29:15 +08:00
<where>
<if test="id != null ">
AND c.id = #{id}
</if>
</where>
2023-11-29 11:51:01 +08:00
order by c.create_time desc limit 1
2023-09-11 14:29:15 +08:00
</select>
2023-10-21 20:20:42 +08:00
<select id="listCaseApplicationByIds" resultMap="CaseApplicationResult">
select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
ELSE '无审理方式'
END arbitratMethodName,
c.case_status ,
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 15 then '待仲裁文书送达' when 16 then '待案件归档'
ELSE '无案件状态'
END caseStatusName,
c.hear_date ,c.arbitrat_claims ,
c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,c.request_rule,c.adjudica_counter,c.proper_preser,
c.is_absence ,c.respon_cross_opin ,c.applica_cross_opin ,c.respon_defen_opini ,
c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName
from case_application c
LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
2023-09-11 14:29:15 +08:00
2023-10-21 20:20:42 +08:00
<where>
<if test="ids != null and ids.size() > 0 ">
2023-11-29 11:51:01 +08:00
c.id in
2023-10-21 20:20:42 +08:00
<foreach item="id" collection="ids" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
</select>
2023-09-22 17:03:26 +08:00
<select id="selectCaseApplicationConfirm" parameterType="CaseApplication" resultMap="CaseApplicationResult">
select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
2023-10-18 18:04:31 +08:00
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
ELSE '无审理方式'
END arbitratMethodName,
c.case_status ,
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 15 then '待仲裁文书送达' when 16 then '待案件归档'
ELSE '无案件状态'
END caseStatusName,
c.hear_date ,c.arbitrat_claims ,
c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,
p.payment_status ,
CASE p.payment_status when 1 then '已支付' when 0 then '未支付'
ELSE '无支付状态'
END paymentStatusName,c.pay_type,
CASE c.pay_type when 0 then '线上支付' when 0 then '线下支付' else '' end payTypeName
2023-09-22 17:03:26 +08:00
from case_application c left join case_payment_record p on c.id = p.case_id
2023-11-27 17:59:24 +08:00
where c.id = #{id} and p.payment_status=1 limit 1
2023-09-22 17:03:26 +08:00
</select>
<select id="selectCaseNumLike" resultType="java.lang.Integer">
select max(substring(case_num, #{length}+1,12)+1) as maxCaseNum
from case_application where case_num like CONCAT(#{caseNum},'%') ;
</select>
2023-10-12 17:23:15 +08:00
<select id="selectArbitratorList" resultType="java.lang.String">
select a.arbitrator_id id from case_application a where a.id=#{id}
</select>
2023-10-27 16:24:42 +08:00
<select id="selectCaseIdByRoomId" resultType="java.lang.Long">
select id
2023-11-24 19:22:32 +08:00
from case_application where room_id=#{roomId} limit 1
2023-10-27 16:24:42 +08:00
</select>
2023-09-11 14:29:15 +08:00
2023-11-23 18:47:16 +08:00
<select id="selectMaxRoomId" resultType="java.lang.Long">
2023-11-14 11:35:26 +08:00
select max(room_id+1) as maxRoomId
from reserved_conference ;
</select>
2023-10-30 15:56:34 +08:00
2023-11-22 13:58:34 +08:00
2023-10-18 18:04:31 +08:00
</mapper>