This commit is contained in:
18792927508
2023-12-20 09:15:28 +08:00
parent 547394f8d6
commit 20c95700ab
25 changed files with 1277 additions and 800 deletions
@@ -37,7 +37,12 @@
</resultMap>
<select id="selectCaseAffiliate" parameterType="CaseAffiliate" resultMap="CaseAffiliateResult">
select c.*,s.user_id
select distinct (c.id),
c.case_appli_id, c.identity_type,c.application_organ_id,c.application_organ_name,c.name,c.identity_num,c.contact_telphone,
c.contact_address,c.work_address,c.work_telphone ,c.name_agent,c.identity_num_agent,c.contact_telphone_agent,
c.comp_legal_person,c.comp_legalper_post,c.respon_sex ,c.respon_birth,
c.residen_affili,appli_agent_title,
c.contact_address_agent,c.email, c.send_email,c.track_num,c.applicant_agent_user_id,c.agent_email,s.user_id
from case_affiliate c
left join sys_user s on c.identity_num=s.id_card
<where>
@@ -47,7 +52,12 @@
</where>
</select>
<select id="selectCaseAffiliateByCaseIds" resultMap="CaseAffiliateResult">
select c.*,s.user_id
select (c.id),
c.case_appli_id, c.identity_type,c.application_organ_id,c.application_organ_name,c.name,c.identity_num,c.contact_telphone,
c.contact_address,c.work_address,c.work_telphone ,c.name_agent,c.identity_num_agent,c.contact_telphone_agent,
c.comp_legal_person,c.comp_legalper_post,c.respon_sex ,c.respon_birth,
c.residen_affili,appli_agent_title,
c.contact_address_agent,c.email, c.send_email,c.track_num,c.applicant_agent_user_id,c.agent_email,s.user_id
from case_affiliate c
left join sys_user s on c.identity_num=s.id_card
<where>
@@ -202,25 +202,27 @@
WHERE id = #{id}
</delete>
<delete id="batchDeleteLog">
delete a from case_affiliate_log a
join case_application_log l on l.id=a.case_appli_log_id
where l.id in (
delete from case_application_log l where l.id in
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
);
delete a from case_attach_log a
join case_application_log l on l.id=a.case_appli_log_id
where l.id in (
;
delete from case_affiliate_log l where l.case_appli_log_id in
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
);
delete from case_application_log l where l.id in (
;
delete from case_attach_log l where l.case_appli_log_id in
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
);
;
delete from column_value_log l where l.case_appli_log_id in
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
;
</delete>
@@ -278,6 +280,12 @@
FROM case_application_log
WHERE case_appli_id = #{caseId} and version &lt; #{version} and update_submit_status not in ( 4, 5 ) order by version desc limit 1
</select>
<select id="selectLogsByCaseIds" resultType="java.lang.Long">
select id from case_application_log where case_appli_id in
<foreach collection="ids" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</select>
</mapper>
@@ -62,21 +62,11 @@
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,t1.batch_number
t1.filearbitra_url,t1.lock_status,t1.version,t1.updateSubmitStatus,t1.batch_number,t1.pendingStatus
from(
<trim suffixOverrides="union">
<!--申请人,被申请人,仲裁员,部门长,财务,代理人案件-->
<!--被申请人,仲裁员,部门长,财务,代理人案件-->
<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,
t.arbitrator_id,t.identity_num ,
t.identity_type,t.filearbitra_url,t.lock_status,t.version,t.updateSubmitStatus,t.batch_number
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 '无审理方式'
@@ -99,78 +89,42 @@
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,c.batch_number
updateSubmitStatus,c.batch_number,0 as pendingStatus
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>
<!--根据角色和状态过滤-->
<!--被申请人-->
<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) -->
or (ca.identity_num=#{idCard} AND ca.identity_type=2
and (c.case_status=4 or c.case_status=17)
)
</if>
<!--仲裁员-->
<if test="userId != null and userId != ''">
<!-- or ( t.identity_type=1 and
t.case_status in (7,13,17,18) -->
or (t.identity_type=1
or ( ca.identity_type=1 and
c.case_status in (7,13,17,18)
and
instr (t.arbitrator_id,#{userId})>0)
instr (c.arbitrator_id,#{userId})>0)
</if>
<!--申请人-->
<!-- <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))-->
<!-- </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>)-->
or (ca.identity_type=1)
</if>
<!--财务-->
<if test="financeStatus != null and financeStatus != ''">
or (t.identity_type=1
<!-- and t.case_status =#{financeStatus}-->
or (ca.identity_type=1
and c.case_status =#{financeStatus}
)
</if>
<!--代理人-->
<if test="agentDeptIds != null and agentDeptIds.size()>0">
or (
t.application_organ_id in
ca.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)-->
AND ca.identity_type=1
and c.case_status in (0,9)
)
</if>
@@ -206,30 +160,17 @@
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,c.batch_number
as updateSubmitStatus,c.batch_number,0 as pendingStatus
from case_application c
JOIN case_affiliate ca ON ca.case_appli_id =c.id AND ca.identity_type = 1
<where>
<!--(c.case_status &lt;= 10 or c.case_status=31) AND-->
(c.case_status &lt;= 10 or c.case_status=31) AND
ca.identity_type=1
<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>
@@ -237,7 +178,6 @@
<if test="deptIds != null and deptIds.size() > 0">
<!--秘书主表案件-->
select tt.* from(
SELECT
c.id,
'' AS caseLogId,
@@ -287,7 +227,7 @@
c.filearbitra_url,
c.lock_status,c.version,
null as updateSubmitStatus,
c.batch_number
c.batch_number,0 as pendingStatus
FROM
case_application c
JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type = 1
@@ -302,40 +242,9 @@
)
WHERE
ca.identity_type=1
<!-- and c.case_status in (1,5,8,9,11,14,15,16,17,31)-->
<!-- <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>
<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>) tt
<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>
</where>
and c.case_status in (1,5,8,9,11,14,15,16,17,31)
union
<!--秘书审核案件-->
select tt2.* from(
SELECT
l.case_appli_id id,
l.id AS caseLogId,
@@ -382,7 +291,7 @@
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,l.version,l.update_submit_status as updateSubmitStatus,c.batch_number
c.filearbitra_url,c.lock_status,l.version,l.update_submit_status as updateSubmitStatus,c.batch_number,0 as pendingStatus
FROM
case_application c
JOIN case_application_log l ON c.id = l.case_appli_id
@@ -390,33 +299,7 @@
AND ca.identity_type = 1
WHERE
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>-->
<!-- <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
@@ -425,26 +308,86 @@
case_application_log
WHERE
c.id = case_appli_id)
) tt2
<where>
<if test="caseStatus != null">
AND tt2.case_status = #{caseStatus}
</if>
<if test="caseStatusList != null and caseStatusList.size() > 0">
and tt2.case_status in
<foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
#{caseStatus}
</foreach>
</if>
</where>
union
</if>
<!-- 已办案件 -->
<if test="loginUserName != null and loginUserName != ''">
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 18 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,
c.batch_number,1 as pendingStatus
from case_log_record r
join case_application c on r.case_appli_id=c.id and r.case_node!=c.case_status
JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1
WHERE
r.create_by=#{loginUserName} AND ca.identity_type=1
</if>
</trim>
) t1
<where>
<if test="caseStatus != null">
AND t1.case_status = #{caseStatus}
</if>
<if test="lockStatus != null">
AND t1.lock_status = #{lockStatus}
</if>
<if test="caseNum != null and caseNum != ''">
AND t1.case_num = #{caseNum}
</if>
<if test="nameId != null and nameId != ''">
AND t1.application_organ_id=#{nameId} AND t1.identity_type=1
</if>
</where>
order by t1.case_num desc
order by t1.pendingStatus asc,t1.case_num desc
</select>
@@ -563,15 +506,6 @@
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
@@ -663,14 +597,6 @@
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
@@ -702,37 +628,7 @@
</where>
union
</if>
<!-- <if test="applicationOrganId != null and applicationOrganId != ''">-->
<!-- &lt;!&ndash;申请人案件&ndash;&gt;-->
<!-- 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-->
<!-- <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>-->
<!--秘书案件-->
<if test="deptIds != null and deptIds.size() > 0">
@@ -904,7 +800,7 @@
</select>
<insert id="insertCaseApplication" parameterType="CaseApplication" useGeneratedKeys="true" keyProperty="id">
insert into case_application(
<if test="id != null''">id ,</if>
<if test="id != null">id ,</if>
<if test="caseName != null and caseName != ''">case_name ,</if>
<if test="caseNum != null and caseNum != ''">case_num,</if>
<if test="caseSubjectAmount != null">case_subject_amount,</if>
@@ -938,7 +834,7 @@
batch_number,
create_time
)values(
<if test="id != null''">#{id} ,</if>
<if test="id != null">#{id} ,</if>
<if test="caseName != null and caseName != ''">#{caseName},</if>
<if test="caseNum != null and caseNum != ''">#{caseNum},</if>
<if test="caseSubjectAmount != null">#{caseSubjectAmount},</if>
@@ -1143,7 +1039,22 @@
where id in
<foreach collection="ids" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</foreach>;
delete from case_affiliate
where case_appli_id in
<foreach collection="ids" item="item" open="(" separator="," close=")">
#{item}
</foreach>;
delete from case_attach
where case_appli_id in
<foreach collection="ids" item="item" open="(" separator="," close=")">
#{item}
</foreach>;
delete from column_value
where case_id in
<foreach collection="ids" item="item" open="(" separator="," close=")">
#{item}
</foreach>;
</delete>
<select id="selectCaseApplication" parameterType="CaseApplication" resultMap="CaseApplicationResult">
@@ -42,10 +42,45 @@
</select>
<select id="selectSealSignRecordbyStat" parameterType="SealSignRecord" resultMap="SealSignRecordResult">
SELECT s.id ,s.case_appli_id ,s.file_id ,s.sign_flow_id
from seal_sign_record s
SELECT s.id ,s.case_appli_id ,s.file_id ,s.sign_flow_id,s.sign_flow_status
from seal_sign_record s join case_application c on s.case_appli_id=c.id
where s.sign_flow_status in (1,2)
</select>
<select id="selectSealSigning" resultType="com.ruoyi.wisdomarbitrate.domain.CaseApplication">
SELECT s.sign_flow_id signFlowId,c.id id,c.case_status caseStatus,
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 18 then '待仲裁员审核仲裁文书'
when 31 then '待修改开庭时间'
ELSE '无案件状态'
END caseStatusName,
c.case_subject_amount caseSubjectAmount,c.case_num caseNum,c.hear_date hearDate,
ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName,
c.arbitrat_method arbitratMethod ,
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
ELSE '无审理方式'
END arbitratMethodName,
c.arbitrator_id arbitratorId,
c.arbitrator_name arbitratorName
from seal_sign_record s
join case_application c on s.case_appli_id=c.id
JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
<!-- where s.sign_flow_status in (0,1,2)-->
<where>
<if test="penSonAccount != null and penSonAccount!='' ">
AND s.penson_account = #{penSonAccount}
</if>
<if test="caseStatus != null and caseStatus!='' ">
AND c.case_status = #{caseStatus}
</if>
</where>
order by c.case_num desc
</select>
<update id="updataSealSignRecord" parameterType="SealSignRecord">
update seal_sign_record