Files
Arbitrate-Backend/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml
T
2024-05-14 16:54:42 +08:00

90 lines
4.6 KiB
XML

<?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.CaseEvidenceMapper">
<resultMap type="CaseEvidenceVO" id="CaseEvidenceVOResult">
<id property="id" column="id" />
<result property="caseNum" column="case_num" />
<result property="caseStatus" column="case_status" />
<result property="caseStatus" column="case_status" />
<result property="roomId" column="room_id" />
<result property="caseStatusName" column="caseStatusName" />
</resultMap>
<select id="getCaseListByRespondent" resultType="CaseEvidenceVO" resultMap="CaseEvidenceVOResult">
select t.* from(
select c.id id,c.create_time, c.case_num,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,
rc.room_id,rc.schedule_start_time
from case_application as c join case_affiliate as d on c.id = d.case_appli_id
left join reserved_conference rc on rc.case_id=c.id
where c.id = d.case_appli_id
<if test="identityNum != null and identityNum != ''">
and d.identity_num = #{identityNum}
</if>
<if test="identityType != null ">
and d.identity_type = #{identityType}
</if>
<if test="phone != null and phone != ''">
and (d.contact_telphone = #{phone} or d.contact_telphone_agent=#{phone})
</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>
union
<!-- 已办案件 -->
select c.id id, c.create_time,c.case_num,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,
rc.room_id,rc.schedule_start_time
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
left join reserved_conference rc on rc.case_id=c.id
WHERE
r.create_by=#{loginUserName} AND ca.identity_type=2
and c.id not in(
select c.id
from case_application c
JOIN case_affiliate ca ON ca.case_appli_id = c.id
where c.id = ca.case_appli_id
<if test="identityNum != null and identityNum != ''">
and ca.identity_num = #{identityNum}
</if>
<if test="identityType != null ">
and ca.identity_type = #{identityType}
</if>
<if test="phone != null and phone != ''">
and (ca.contact_telphone = #{phone} or ca.contact_telphone_agent=#{phone})
</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>
)
) t order by t.create_time desc
</select>
</mapper>