仲裁系统bug修复
This commit is contained in:
+161
-129
@@ -570,129 +570,10 @@
|
||||
sum( case when t1.case_status=18 then 1 else 0 end) arbitratorApplyAwardConfirm,
|
||||
sum( case when t1.case_status=31 then 1 else 0 end) updateOnlineHearDate
|
||||
from(
|
||||
<trim suffixOverrides="union">
|
||||
<!--被申请人,仲裁员,部门长,财务,代理人案件-->
|
||||
<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>
|
||||
|
||||
<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,13,17,18)
|
||||
and
|
||||
instr (t.arbitrator_id,#{userId})>0)
|
||||
</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
|
||||
</if>
|
||||
|
||||
<!--秘书案件-->
|
||||
<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
|
||||
JOIN case_application_log l on l.case_appli_id=c.id and l.update_submit_status not in(1, 2) and
|
||||
l.version
|
||||
= (
|
||||
SELECT
|
||||
max( version ) version
|
||||
FROM
|
||||
case_application_log
|
||||
WHERE case_appli_id = c.id
|
||||
)
|
||||
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="caseStatus != null">
|
||||
AND c.case_status = #{caseStatus}
|
||||
</if>
|
||||
|
||||
<if test="nameId != null and nameId != ''">
|
||||
AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
|
||||
</if>
|
||||
union
|
||||
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_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
|
||||
AND l.version = (
|
||||
SELECT
|
||||
max( version ) version
|
||||
FROM
|
||||
case_application_log
|
||||
WHERE
|
||||
c.id = case_appli_id)
|
||||
</if>
|
||||
</trim>
|
||||
select c.id,c.case_status
|
||||
from case_application c
|
||||
JOIN case_affiliate ca ON ca.case_appli_id = c.id
|
||||
<include refid="SELECT_LIST_QUERY"/>
|
||||
|
||||
) t1
|
||||
</select>
|
||||
@@ -1114,17 +995,13 @@
|
||||
<if test="caseResult != null and caseResult != ''">case_result = #{caseResult},</if>
|
||||
<if test="caseStatus != null">case_status = #{caseStatus},</if>
|
||||
<if test="properPreser != null">proper_preser = #{properPreser},</if>
|
||||
|
||||
<if test="applicantIsWrittenHear != null">appli_iswrit_hear = #{applicantIsWrittenHear},</if>
|
||||
<if test="respondentIsWrittenHear != null">respon_isWrit_hear = #{respondentIsWrittenHear},</if>
|
||||
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="caseNum != null and caseNum != ''">case_num = #{caseNum},</if>
|
||||
<if test="version != null ">version = #{version},</if>
|
||||
<if test="facts != null and facts != ''">facts = #{facts},</if>
|
||||
<if test="mediationAgreement != null and mediationAgreement != ''">mediation_agreement =
|
||||
#{mediationAgreement},
|
||||
</if>
|
||||
<if test="mediationAgreement != null and mediationAgreement != ''"> mediation_agreement = #{mediationAgreement} </if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where id = #{id}
|
||||
@@ -1366,7 +1243,7 @@
|
||||
SELECT count(1)
|
||||
from case_application c
|
||||
where c.arbitrator_id = #{userId}
|
||||
and c.case_status in(8,9)
|
||||
and c.case_status!=17
|
||||
</select>
|
||||
|
||||
<select id="selectCaseIdByRoomId" resultType="java.lang.Long">
|
||||
@@ -1382,6 +1259,161 @@
|
||||
select max(batch_number+0) as maxBatchNumber
|
||||
from case_application ;
|
||||
</select>
|
||||
<sql id="SELECT_LIST_QUERY">
|
||||
<where>
|
||||
<!-- 案件状态查询-->
|
||||
<if test="caseStatusList != null and caseStatusList.size()>0">
|
||||
and c.case_status in
|
||||
<foreach collection="caseStatusList" item="caseStatus" open="(" separator="," close=")">
|
||||
#{caseStatus}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="caseStatusList == null or caseStatusList.size()==0">
|
||||
and ca.identity_type=1
|
||||
</if>
|
||||
<if test="roleNames != null and roleNames.size()>0 and roleNames.contains('申请人')
|
||||
and caseApplication.loginUserPhone != null and caseApplication.loginUserPhone != ''">
|
||||
<!-- 申请人,根据电话查询-->
|
||||
and ca.identity_type=1
|
||||
and ( ca.contact_telphone=#{caseApplication.loginUserPhone}
|
||||
or ca.contact_telphone_agent=#{caseApplication.loginUserPhone}
|
||||
)
|
||||
</if>
|
||||
<if test="roleNames != null and roleNames.size()>0 and roleNames.contains('被申请人')
|
||||
and caseApplication.loginUserPhone != null and caseApplication.loginUserPhone != ''">
|
||||
<!-- 被申请人查询,根据电话查询-->
|
||||
and ca.identity_type=2
|
||||
and ( ca.contact_telphone=#{caseApplication.loginUserPhone}
|
||||
or ca.contact_telphone_agent=#{caseApplication.loginUserPhone}
|
||||
)
|
||||
</if>
|
||||
<if test="caseApplication.arbitratorId !=null and caseApplication.arbitratorId!=''">
|
||||
<!-- 仲裁员查询-->
|
||||
and c.arbitrator_id=#{caseApplication.arbitratorId}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
<select id="list" 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.appli_iswrit_hear,t1.respon_isWrit_hear,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.pendingStatus
|
||||
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 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.appli_iswrit_hear,c.respon_isWrit_hear,
|
||||
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,0 as pendingStatus
|
||||
from case_application c
|
||||
JOIN case_affiliate ca ON ca.case_appli_id = c.id
|
||||
<include refid="SELECT_LIST_QUERY"/>
|
||||
union
|
||||
|
||||
<!-- 已办案件 -->
|
||||
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.appli_iswrit_hear,c.respon_isWrit_hear,
|
||||
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
|
||||
JOIN case_affiliate ca ON ca.case_appli_id = c.id
|
||||
WHERE
|
||||
r.create_by=#{caseApplication.loginUserName} AND ca.identity_type=1
|
||||
and c.id not in(
|
||||
select c.id
|
||||
from case_application c
|
||||
JOIN case_affiliate ca ON ca.case_appli_id = c.id
|
||||
<include refid="SELECT_LIST_QUERY"/>
|
||||
)
|
||||
|
||||
|
||||
|
||||
) t1
|
||||
<where>
|
||||
<if test="caseApplication.caseStatus != null">
|
||||
AND t1.case_status = #{caseApplication.caseStatus}
|
||||
</if>
|
||||
<if test="caseApplication.lockStatus != null">
|
||||
AND t1.lock_status = #{caseApplication.lockStatus}
|
||||
</if>
|
||||
<if test="caseApplication.caseNum != null and caseApplication.caseNum != ''">
|
||||
AND t1.case_num = #{caseApplication.caseNum}
|
||||
</if>
|
||||
<if test="caseApplication.batchNumber != null">
|
||||
AND t1.batch_number = #{caseApplication.batchNumber}
|
||||
</if>
|
||||
<!-- <if test="nameId != null and nameId != ''">-->
|
||||
<!-- AND t1.application_organ_id=#{nameId} AND t1.identity_type=1-->
|
||||
<!-- </if>-->
|
||||
</where>
|
||||
|
||||
order by t1.pendingStatus asc,t1.create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user