调解系统修改
This commit is contained in:
+69
-23
@@ -1,27 +1,73 @@
|
||||
<?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.mscase.MsCaseAffiliateMapper">
|
||||
<resultMap id="BaseResultMap" type="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
-->
|
||||
<id column="case_appli_id" jdbcType="BIGINT" property="caseAppliId" />
|
||||
<result column="application_organ_id" jdbcType="VARCHAR" property="applicationOrganId" />
|
||||
<result column="application_organ_name" jdbcType="VARCHAR" property="applicationOrganName" />
|
||||
<result column="credit_code" jdbcType="VARCHAR" property="creditCode" />
|
||||
<result column="comp_legal_person" jdbcType="VARCHAR" property="compLegalPerson" />
|
||||
<result column="applicant_home" jdbcType="VARCHAR" property="applicantHome" />
|
||||
<result column="applicant_address" jdbcType="VARCHAR" property="applicantAddress" />
|
||||
<result column="name_agent" jdbcType="VARCHAR" property="nameAgent" />
|
||||
<result column="contact_telphone_agent" jdbcType="VARCHAR" property="contactTelphoneAgent" />
|
||||
<result column="agent_email" jdbcType="VARCHAR" property="agentEmail" />
|
||||
<result column="applicant_track_num" jdbcType="VARCHAR" property="applicantTrackNum" />
|
||||
<result column="respondent_name" jdbcType="VARCHAR" property="respondentName" />
|
||||
<result column="respondent_identity_num" jdbcType="VARCHAR" property="respondentIdentityNum" />
|
||||
<result column="respondent_sex" jdbcType="VARCHAR" property="respondentSex" />
|
||||
<result column="respondent_birth" jdbcType="TIMESTAMP" property="respondentBirth" />
|
||||
<result column="respondent_home" jdbcType="VARCHAR" property="respondentHome" />
|
||||
<result column="respondent_email" jdbcType="VARCHAR" property="respondentEmail" />
|
||||
<result column="respondent_track_num" jdbcType="VARCHAR" property="respondentTrackNum" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="listGroupConcat" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate">
|
||||
select
|
||||
a.case_appli_id caseAppliId,
|
||||
u.nickName name,
|
||||
u.id_type idType,
|
||||
r.role_name roleName,
|
||||
GROUP_CONCAT( DISTINCT CASE WHEN c.organize_flag = 0 THEN u.nick_name ELSE d.dept_name END ) AS name,
|
||||
(select GROUP_CONCAT( DISTINCT u1.nick_name ) FROM
|
||||
|
||||
ms_case_affiliate a1
|
||||
LEFT JOIN ms_sys_user u1 ON u1.user_id = a1.user_id
|
||||
LEFT JOIN ms_sys_user_role ur1 ON u1.user_id = ur1.user_id
|
||||
LEFT JOIN ms_sys_role r1 ON r1.role_id = ur1.role_id
|
||||
where a.case_appli_id = a1.case_appli_id and (r1.role_name='被申请人' )
|
||||
|
||||
group by a1.case_appli_id) resName
|
||||
|
||||
FROM
|
||||
ms_case_application c
|
||||
JOIN ms_case_affiliate a ON c.id = a.case_appli_id
|
||||
LEFT JOIN ms_sys_user u ON u.user_id = a.user_id
|
||||
LEFT JOIN ms_sys_user_role ur ON u.user_id = ur.user_id
|
||||
LEFT JOIN ms_sys_role r ON r.role_id = ur.role_id
|
||||
LEFT JOIN ms_sys_dept d ON d.dept_id = a.applicant_dept_id
|
||||
<where>
|
||||
(r.role_name='申请人' )
|
||||
<if test="caseIds != null and caseIds.size() > 0">
|
||||
and a.case_appli_id in
|
||||
<foreach item="caseId" index="index" collection="caseIds" open="(" separator="," close=")">
|
||||
#{caseId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
group by a.case_appli_id
|
||||
</select>
|
||||
<select id="selectByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate">
|
||||
select c.id caseAppliId,a.id,a.role_type roleType,a.group_order groupOrder,a.operator_flag operatorFlag,d.code,d.comp_legal_person compLegalPerson,u.nick_name name,u.id_card idCard,u.phonenumber phone,
|
||||
u.email,u.home,u.address,u.sex,u.nationality,u.id_type idType,u.birth,a.user_id userId
|
||||
FROM
|
||||
ms_case_application c
|
||||
JOIN ms_case_affiliate a ON a.case_appli_id=#{id} and c.id = a.case_appli_id
|
||||
LEFT JOIN ms_sys_user u ON u.user_id = a.user_id
|
||||
LEFT JOIN ms_sys_user_role ur ON u.user_id = ur.user_id
|
||||
LEFT JOIN ms_sys_role r ON r.role_id = ur.role_id
|
||||
LEFT JOIN ms_sys_dept d ON d.dept_id = a.applicant_dept_id
|
||||
where c.id = #{id}
|
||||
GROUP BY a.id
|
||||
</select>
|
||||
<select id="selectUserRoleByCaseIds" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate">
|
||||
select c.id caseAppliId,a.id,a.role_type roleType,a.group_order groupOrder,a.operator_flag operatorFlag,d.code,d.comp_legal_person compLegalPerson,u.nick_name name,u.id_card idCard,u.phonenumber phone,
|
||||
u.email,u.home,u.address,u.sex,u.nationality,u.id_type idType,u.birth,r.role_name roleName,d.dept_name applicantOrgName,a.user_id userId
|
||||
FROM
|
||||
ms_case_application c
|
||||
JOIN ms_case_affiliate a ON c.id = a.case_appli_id
|
||||
LEFT JOIN ms_sys_user u ON u.user_id = a.user_id
|
||||
LEFT JOIN ms_sys_user_role ur ON u.user_id = ur.user_id
|
||||
LEFT JOIN ms_sys_role r ON r.role_id = ur.role_id
|
||||
LEFT JOIN ms_sys_dept d ON d.dept_id = a.applicant_dept_id
|
||||
<where>
|
||||
<if test="caseIds != null and caseIds.size() > 0">
|
||||
and a.case_appli_id in
|
||||
<foreach item="caseId" index="index" collection="caseIds" open="(" separator="," close=")">
|
||||
#{caseId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
+109
@@ -34,7 +34,56 @@
|
||||
<result column="mediation_agreement" jdbcType="LONGVARCHAR" property="mediationAgreement" />
|
||||
<result column="is_reconci" jdbcType="INTEGER" property="isReconci" />
|
||||
</resultMap>
|
||||
<sql id="SELECT_LIST_QUERY">
|
||||
FROM
|
||||
ms_case_application c
|
||||
JOIN ms_case_affiliate a ON c.id = a.case_appli_id
|
||||
LEFT JOIN ms_sys_user u ON u.user_id = a.user_id
|
||||
LEFT JOIN ms_sys_user u1 ON u1.user_id = c.mediator_id
|
||||
LEFT JOIN ms_sys_user_role ur ON u.user_id = ur.user_id or u1.user_id = ur.user_id
|
||||
LEFT JOIN ms_sys_role r ON r.role_id = ur.role_id or r.role_id = ur.role_id
|
||||
LEFT JOIN ms_sys_dept d ON d.dept_id = a.applicant_dept_id
|
||||
<where>
|
||||
<!-- 调解员角色和申请人,被申,代理人-->
|
||||
<if test = 'req.mediatorId != null and req.userId!=null'>
|
||||
AND (c.mediator_id = #{req.mediatorId} or a.user_id=#{req.userId})
|
||||
</if>
|
||||
<!-- admin,财务,顾问,部门长查看所有案件,申请人,被申,代理人根据userId查-->
|
||||
<if test = 'req.mediatorId == null and req.userId != null'>
|
||||
AND (a.user_id=#{req.userId} )
|
||||
</if>
|
||||
<!-- 根据角色查询-->
|
||||
<if test='roleIds != null and roleIds.size() > 0 '>
|
||||
and r.role_id in
|
||||
<foreach item='roleId' index='index' collection='roleIds' open='(' separator=',' close=')'>
|
||||
#{roleId}
|
||||
</foreach>
|
||||
</if>
|
||||
<!-- 角色相关的状态-->
|
||||
<if test='caseFlowIds != null and caseFlowIds.size() > 0 '>
|
||||
and c.case_flow_id in
|
||||
<foreach item='flowId' index='index' collection='caseFlowIds' open='(' separator=',' close=')'>
|
||||
#{flowId}
|
||||
</foreach>
|
||||
</if>
|
||||
<!-- 案件状态id条件-->
|
||||
<if test = 'req.caseFlowId != null'>
|
||||
AND c.case_flow_id = #{req.caseFlowId}
|
||||
</if>
|
||||
<!-- 案件编号-->
|
||||
<if test = 'req.caseNum != null and req.caseNum != "" '>
|
||||
AND c.case_num = #{req.caseNum}
|
||||
</if>
|
||||
<!-- 时间-->
|
||||
<if test = 'req.startTime != null and req.startTime != "" '>
|
||||
and c.create_time >= #{req.startTime}
|
||||
</if>
|
||||
<if test = 'req.endTime != null and req.endTime != "" '>
|
||||
and c.create_time <= #{req.endTime}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</sql>
|
||||
<select id="listMediator" resultMap="BaseResultMap">
|
||||
select mediator_id ,id ,case_status_name,case_flow_id from ms_case_application <where>
|
||||
<if test = 'userIds!=null and userIds.size()>0'>
|
||||
@@ -50,4 +99,64 @@
|
||||
</if> -->
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="todoCount" resultType="com.ruoyi.wisdomarbitrate.domain.vo.mscase.CaseToDoCount">
|
||||
SELECT c.case_flow_id caseFlowId,count(DISTINCT c.id) caseCount
|
||||
<include refid="SELECT_LIST_QUERY"/>
|
||||
group by c.case_flow_id
|
||||
</select>
|
||||
<select id="list" resultType="com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO">
|
||||
select t.* from(
|
||||
SELECT
|
||||
c.id,c.media_result mediaResult,c.room_id roomId,0 AS pendingStatus,
|
||||
c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,
|
||||
u1.nick_name mediatorName,c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime,
|
||||
c.mediation_method mediationMethod,
|
||||
CASE c.mediation_method when 1 then '线上调解' when 2 then '线下调解' ELSE '' END mediationMethodName
|
||||
<include refid="SELECT_LIST_QUERY"/>
|
||||
GROUP BY
|
||||
c.id
|
||||
union
|
||||
SELECT
|
||||
c.id,c.media_result mediaResult,c.room_id roomId,1 AS pendingStatus,
|
||||
c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,
|
||||
u1.nick_name mediatorName,c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime,
|
||||
c.mediation_method mediationMethod,
|
||||
CASE c.mediation_method when 1 then '线上调解' when 2 then '线下调解' ELSE '' END mediationMethodName
|
||||
FROM
|
||||
ms_case_log_record r
|
||||
join ms_case_application c on r.case_appli_id=c.id
|
||||
JOIN ms_case_affiliate a ON c.id = a.case_appli_id
|
||||
LEFT JOIN ms_sys_user u ON u.user_id = a.user_id
|
||||
LEFT JOIN ms_sys_user u1 ON u1.user_id = c.mediator_id
|
||||
LEFT JOIN ms_sys_dept d ON d.dept_id = a.applicant_dept_id
|
||||
<where>
|
||||
r.create_by=#{req.userName} and c.id not in ( SELECT c.id
|
||||
<include refid="SELECT_LIST_QUERY"/>
|
||||
)
|
||||
|
||||
<!-- 案件状态id条件-->
|
||||
<if test = 'req.caseFlowId != null'>
|
||||
AND c.case_flow_id = #{req.caseFlowId}
|
||||
</if>
|
||||
<!-- 案件编号-->
|
||||
<if test = 'req.caseNum != null and req.caseNum != "" '>
|
||||
AND c.case_num = #{req.caseNum}
|
||||
</if>
|
||||
<!-- 时间-->
|
||||
<if test = 'req.startTime != null and req.startTime != "" '>
|
||||
and c.create_time >= #{req.startTime}
|
||||
</if>
|
||||
<if test = 'req.endTime != null and req.endTime != "" '>
|
||||
and c.create_time <= #{req.endTime}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
GROUP BY
|
||||
c.id
|
||||
) t ORDER BY t.createTime desc,t.caseNum desc
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -14,6 +14,7 @@
|
||||
<result property="useId" column="use_id" />
|
||||
<result property="useAccount" column="use_account" />
|
||||
<result property="onlyOfficeFileId" column="only_office_file_id" />
|
||||
<result property="otherSysFileId" column="other_sys_file_id" />
|
||||
</resultMap>
|
||||
<insert id="save" useGeneratedKeys="true" keyProperty="annexId">
|
||||
INSERT INTO ms_case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,only_office_file_id)
|
||||
@@ -109,7 +110,9 @@
|
||||
<update id="updateCaseAttach" parameterType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach">
|
||||
update ms_case_attach
|
||||
set
|
||||
<if test="otherSysFileId != null and otherSysFileId != ''"> other_sys_file_id=#{otherSysFileId},</if>
|
||||
case_appli_id= #{caseAppliId}
|
||||
|
||||
where annex_id = #{annexId}
|
||||
</update>
|
||||
<update id="batchUpdate">
|
||||
@@ -125,6 +128,7 @@
|
||||
update ms_case_attach
|
||||
<set>
|
||||
<if test="annexName != null and annexName != ''">annex_name = #{annexName},</if>
|
||||
<if test="otherSysFileId != null and otherSysFileId != ''"> other_sys_file_id=#{otherSysFileId},</if>
|
||||
<if test="annexPath != null and annexPath != ''">annex_path = #{annexPath}</if>
|
||||
</set>
|
||||
<where>
|
||||
|
||||
Reference in New Issue
Block a user