Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev

This commit was merged in pull request #123.
This commit is contained in:
2023-10-18 18:23:25 +08:00
committed by Gitea
3 changed files with 98 additions and 229 deletions
@@ -55,16 +55,9 @@ public interface CaseApplicationMapper {
*/ */
void updatePayType(CaseConfirmPayDTO payDTO); void updatePayType(CaseConfirmPayDTO payDTO);
/**
* 查询部门长案件
* @param caseApplication
* @return
*/
List<CaseApplication> selectDeptHeadCaseApplicationList(@Param("caseApplication") CaseApplication caseApplication, @Param("statusList")List<Integer> caseStatusList);
ToDoCount selectAdminCaseToDoCount(); ToDoCount selectAdminCaseToDoCount();
ToDoCount selectDeptHeadCaseToDoCount( @Param("statusList")List<Integer> caseStatusList);
ToDoCount selectTodoCountByRole(CaseApplication caseApplication); ToDoCount selectTodoCountByRole(CaseApplication caseApplication);
} }
@@ -22,19 +22,13 @@ import com.ruoyi.common.exception.EsignDemoException;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.*; import com.ruoyi.common.utils.*;
import com.ruoyi.common.utils.file.SaaSAPIFileUtils; import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.EsignDemoException;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.system.domain.SysUserRole; import com.ruoyi.system.domain.SysUserRole;
import com.ruoyi.system.mapper.SysRoleMapper; import com.ruoyi.system.mapper.SysRoleMapper;
import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.mapper.SysUserRoleMapper; import com.ruoyi.system.mapper.SysUserRoleMapper;
import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount; import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.system.mapper.SysDeptMapper; import com.ruoyi.system.mapper.SysDeptMapper;
import com.ruoyi.wisdomarbitrate.domain.*; import com.ruoyi.wisdomarbitrate.domain.*;
import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
@@ -44,7 +38,6 @@ import com.ruoyi.wisdomarbitrate.utils.SignAward;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
@@ -71,8 +64,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
@Autowired @Autowired
private CaseAffiliateMapper caseAffiliateMapper; private CaseAffiliateMapper caseAffiliateMapper;
@Autowired
private CasePaymentRecordMapper casePaymentRecordMapper;
@Autowired @Autowired
private ArbitrateRecordMapper arbitrateRecordMapper; private ArbitrateRecordMapper arbitrateRecordMapper;
@Autowired @Autowired
@@ -127,25 +118,25 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
){ ){
return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication); return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication);
} }
// if(role.getRoleName().equals("仲裁委") if(role.getRoleName().equals("仲裁委")
// ||role.getRoleName().equals("部门长")){ ||role.getRoleName().equals("部门长")){
// List<Integer> caseStatusList=new ArrayList<>(); List<Integer> caseStatusList=new ArrayList<>();
// caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
// caseStatusList.add(CaseApplicationConstants.SIGN_ARBITRATION); caseStatusList.add(CaseApplicationConstants.SIGN_ARBITRATION);
// caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL); caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
// caseApplication.setDeptHeadStatus(caseStatusList); caseApplication.setDeptHeadStatus(caseStatusList);
// } }
// if(role.getRoleName().equals("仲裁员")){ if(role.getRoleName().equals("仲裁员")){
// caseApplication.setUserId(String.valueOf(userId)); caseApplication.setUserId(String.valueOf(userId));
// } }
if(role.getRoleName().equals("财务")){ if(role.getRoleName().equals("财务")){
caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
} }
// if(role.getRoleName().equals("法律顾问")){ if(role.getRoleName().equals("法律顾问")){
// // 查询角色有关的用户部门 // 查询角色有关的用户部门
// List<Long> deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId()); List<Long> deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
// caseApplication.setDeptIds(deptIds); caseApplication.setDeptIds(deptIds);
// } }
if(StrUtil.isEmpty(caseApplication.getNameId())&&role.getRoleName().equals("申请人")){ if(StrUtil.isEmpty(caseApplication.getNameId())&&role.getRoleName().equals("申请人")){
// 查询角色有关的用户部门 // 查询角色有关的用户部门
caseApplication.setNameId(String.valueOf(sysUser.getDeptId())); caseApplication.setNameId(String.valueOf(sysUser.getDeptId()));
@@ -243,12 +234,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
List<CaseAffiliate> caseAffiliates = caseApplication.getCaseAffiliates(); List<CaseAffiliate> caseAffiliates = caseApplication.getCaseAffiliates();
Map<String, Long> deptMap =new HashMap<>(); Map<String, Long> deptMap =new HashMap<>();
if (caseAffiliates != null && caseAffiliates.size() > 0) { if (caseAffiliates != null && caseAffiliates.size() > 0) {
// 查询所有的组织机构,组装成map // 查询所有的组织机构,组装成map
List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept()); List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
if (CollectionUtil.isEmpty(deptList)) { if (CollectionUtil.isEmpty(deptList)) {
deptList = new ArrayList<>(); deptList = new ArrayList<>();
} }
deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV)); deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV));
for (CaseAffiliate caseAffiliate : caseAffiliates) { for (CaseAffiliate caseAffiliate : caseAffiliates) {
caseAffiliate.setCaseAppliId(caseApplication.getId()); caseAffiliate.setCaseAppliId(caseApplication.getId());
@@ -307,7 +298,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
String currentDay = DateUtils.dateTime(); String currentDay = DateUtils.dateTime();
String caseNum = "zc"+ currentDay; String caseNum = "zc"+ currentDay;
//查询出当天的案件编号的最大值 //查询出当天的案件编号的最大值
Integer maxCaseNum = caseApplicationMapper.selectCaseNumLike(caseNum,caseNum.length()); Integer maxCaseNum = caseApplicationMapper.selectCaseNumLike(caseNum,caseNum.length());
if(null == maxCaseNum){ if(null == maxCaseNum){
caseNum = caseNum + "001"; caseNum = caseNum + "001";
}else { }else {
@@ -373,7 +364,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
} }
caseAffiliateMapper.updataCaseAffiliate(caseAffiliate); caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
} }
} }
@@ -428,7 +419,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
SmsUtils.sendSms(request); SmsUtils.sendSms(request);
} }
} else if (null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(caseAffiliate.getApplicationOrganId())) { } else if (null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(caseAffiliate.getApplicationOrganId())) {
return "申请机构与申请代理人不匹配"; return "申请机构与申请代理人不匹配";
} else if (null != agentUser.getDeptId() && String.valueOf(agentUser.getDeptId()).equals(caseAffiliate.getApplicationOrganId())){ } else if (null != agentUser.getDeptId() && String.valueOf(agentUser.getDeptId()).equals(caseAffiliate.getApplicationOrganId())){
// 同步用户表和案件关联人表的手机号和名称 // 同步用户表和案件关联人表的手机号和名称
caseAffiliate.setContactTelphoneAgent(agentUser.getPhonenumber()); caseAffiliate.setContactTelphoneAgent(agentUser.getPhonenumber());
@@ -602,47 +593,47 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
//对不重复的立案对象集合的立案对象重新组装对应的案件关联人信息 //对不重复的立案对象集合的立案对象重新组装对应的案件关联人信息
// if(caseApplicationListinsertDiffer!=null&&caseApplicationListinsertDiffer.size()>0){ // if(caseApplicationListinsertDiffer!=null&&caseApplicationListinsertDiffer.size()>0){
List<CaseApplication> caseApplicationNewList = null; List<CaseApplication> caseApplicationNewList = null;
for (int i = 0; i < caseApplicationListinsert.size(); i++){ for (int i = 0; i < caseApplicationListinsert.size(); i++){
caseApplicationNewList = new ArrayList<>(); caseApplicationNewList = new ArrayList<>();
CaseApplication caseApplicationinsertDiffer = caseApplicationListinsert.get(i); CaseApplication caseApplicationinsertDiffer = caseApplicationListinsert.get(i);
// 设置自动编码 // 设置自动编码
caseApplicationinsertDiffer.setCaseNum(generateCaseNum()); caseApplicationinsertDiffer.setCaseNum(generateCaseNum());
List<CaseAffiliate> caseAffiliatesnew = new ArrayList<>(); List<CaseAffiliate> caseAffiliatesnew = new ArrayList<>();
CaseApplication caseApplicationNew = new CaseApplication(); CaseApplication caseApplicationNew = new CaseApplication();
copyCaseApplication(caseApplicationinsertDiffer,caseApplicationNew); copyCaseApplication(caseApplicationinsertDiffer,caseApplicationNew);
if(caseApplicationListinsert!=null&&caseApplicationListinsert.size()>0){ if(caseApplicationListinsert!=null&&caseApplicationListinsert.size()>0){
for (int j = 0; j < caseApplicationListinsert.size(); j++){ for (int j = 0; j < caseApplicationListinsert.size(); j++){
CaseApplication caseApplicationinsert = caseApplicationListinsert.get(j); CaseApplication caseApplicationinsert = caseApplicationListinsert.get(j);
if(StringUtils.isNotEmpty(caseApplicationinsert.getCaseNum())&& if(StringUtils.isNotEmpty(caseApplicationinsert.getCaseNum())&&
caseApplicationinsert.getCaseNum().equals(caseApplicationinsertDiffer.getCaseNum())){ caseApplicationinsert.getCaseNum().equals(caseApplicationinsertDiffer.getCaseNum())){
caseAffiliatesnew.addAll(caseApplicationinsert.getCaseAffiliates()); caseAffiliatesnew.addAll(caseApplicationinsert.getCaseAffiliates());
}
} }
caseApplicationNew.setCaseAffiliates(caseAffiliatesnew); }
caseApplicationNewList.add(caseApplicationNew); caseApplicationNew.setCaseAffiliates(caseAffiliatesnew);
caseApplicationNewList.add(caseApplicationNew);
}
for (int k = 0; k < caseApplicationNewList.size(); k++){
CaseApplication caseApplicationItera = caseApplicationNewList.get(k);
// 新增立案信息
caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION);
caseApplicationItera.setCreateBy(getUsername());
int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera);
List<CaseAffiliate> caseAffiliates = caseApplicationItera.getCaseAffiliates();
if(caseAffiliates!=null&&caseAffiliates.size()>0){
for (CaseAffiliate caseAffiliate : caseAffiliates){
caseAffiliate.setCaseAppliId(caseApplicationItera.getId());
}
caseAffiliateMapper.batchCaseAffiliate(caseAffiliates);
} }
for (int k = 0; k < caseApplicationNewList.size(); k++){ successNum++;
CaseApplication caseApplicationItera = caseApplicationNewList.get(k); successMsg.append("<br/>" + successNum + "、立案编号 " + caseApplicationItera.getCaseNum() + " 导入成功");
// 新增立案信息 }
caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION);
caseApplicationItera.setCreateBy(getUsername());
int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera);
List<CaseAffiliate> caseAffiliates = caseApplicationItera.getCaseAffiliates();
if(caseAffiliates!=null&&caseAffiliates.size()>0){
for (CaseAffiliate caseAffiliate : caseAffiliates){
caseAffiliate.setCaseAppliId(caseApplicationItera.getId());
}
caseAffiliateMapper.batchCaseAffiliate(caseAffiliates);
}
successNum++;
successMsg.append("<br/>" + successNum + "、立案编号 " + caseApplicationItera.getCaseNum() + " 导入成功");
}
// } // }
@@ -653,7 +644,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
}else { }else {
throw new ServiceException("导入立案申请数据不能为空!"); throw new ServiceException("导入立案申请数据不能为空!");
} }
return successMsg.append(failureMsg.toString()).toString(); return successMsg.append(failureMsg.toString()).toString();
} }
@@ -1423,19 +1414,19 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
for(int i = 0;i < idStrList.length;i ++ ){ for(int i = 0;i < idStrList.length;i ++ ){
idList.add(Long.parseLong(idStrList[i])); idList.add(Long.parseLong(idStrList[i]));
} }
// 查询仲裁员电话号 // 查询仲裁员电话号
List<SysUser> userList= sysUserMapper.selectUserListByIds(idList); List<SysUser> userList= sysUserMapper.selectUserListByIds(idList);
if(CollectionUtil.isNotEmpty(userList)) { if(CollectionUtil.isNotEmpty(userList)) {
for (SysUser user : userList) { for (SysUser user : userList) {
//给仲裁员发送短信通知 //给仲裁员发送短信通知
request.setPhone(user.getPhonenumber()); request.setPhone(user.getPhonenumber());
// 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。
String name = user.getNickName(); String name = user.getNickName();
request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr}); request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr});
SmsUtils.sendSms(request); SmsUtils.sendSms(request);
} }
} }
} }
@@ -1448,7 +1439,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(j); CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(j);
int identityType = caseAffiliateselect.getIdentityType(); int identityType = caseAffiliateselect.getIdentityType();
if(identityType==1){ if(identityType==1){
caseAffiliateselect.setName(caseAffiliateselect.getApplicationOrganName()); caseAffiliateselect.setName(caseAffiliateselect.getApplicationOrganName());
} }
//给申请人、被申请人发送短信通知 //给申请人、被申请人发送短信通知
@@ -1501,7 +1492,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
private void assignmentCaseAffiliates(CaseApplication caseApplication, List<CaseAffiliate> caseAffiliatesnew, Map<String, Long> deptMap) { private void assignmentCaseAffiliates(CaseApplication caseApplication, List<CaseAffiliate> caseAffiliatesnew, Map<String, Long> deptMap) {
// 申请人信息 // 申请人信息
CaseAffiliate caseAffiliate = new CaseAffiliate(); CaseAffiliate caseAffiliate = new CaseAffiliate();
// BeanUtils.copyBeanProp(caseApplication,caseAffiliate); // BeanUtils.copyBeanProp(caseApplication,caseAffiliate);
@@ -1516,7 +1507,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
if(StrUtil.isNotEmpty(s)){ if(StrUtil.isNotEmpty(s)){
StringBuilder errorMsg = caseApplication.getErrorMsg(); StringBuilder errorMsg = caseApplication.getErrorMsg();
if(StrUtil.isEmpty(errorMsg)){ if(StrUtil.isEmpty(errorMsg)){
errorMsg=new StringBuilder(); errorMsg=new StringBuilder();
} }
errorMsg.append(s); errorMsg.append(s);
caseApplication.setErrorMsg(errorMsg); caseApplication.setErrorMsg(errorMsg);
@@ -1563,27 +1554,27 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
// 将组织机构id设为申请人名称 // 将组织机构id设为申请人名称
if(deptMap.containsKey(caseApplication.getName())){ if(deptMap.containsKey(caseApplication.getName())){
caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseApplication.getName()))); caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseApplication.getName())));
caseAffiliate.setApplicationOrganName(caseApplication.getName()); caseAffiliate.setApplicationOrganName(caseApplication.getName());
}else { }else {
// 如果不存在则新增 // 如果不存在则新增
SysDept dept = new SysDept(); SysDept dept = new SysDept();
dept.setParentId(0L); dept.setParentId(0L);
dept.setDeptName(caseApplication.getName()); dept.setDeptName(caseApplication.getName());
dept.setAncestors("0"); dept.setAncestors("0");
dept.setOrderNum(1); dept.setOrderNum(1);
dept.setStatus("0"); dept.setStatus("0");
dept.setDelFlag("0"); dept.setDelFlag("0");
dept.setCreateBy(getUsername()); dept.setCreateBy(getUsername());
dept.setUpdateBy(getUsername()); dept.setUpdateBy(getUsername());
sysDeptMapper.insertDept(dept); sysDeptMapper.insertDept(dept);
deptMap.put(dept.getDeptName(),dept.getDeptId()); deptMap.put(dept.getDeptName(),dept.getDeptId());
caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId())); caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId()));
caseAffiliate.setApplicationOrganName(caseApplication.getName()); caseAffiliate.setApplicationOrganName(caseApplication.getName());
} }
} }
@@ -134,14 +134,7 @@
</if> </if>
</where> </where>
) t1 ) t1
<!-- <where>-->
<!-- &lt;!&ndash;申请人&ndash;&gt;-->
<!-- <if test="nameId != null and nameId != ''">-->
<!-- and ( t1.application_organ_id = #{nameId} AND t1.identity_type=1-->
<!-- and t1.case_status in (0,2)-->
<!-- )-->
<!-- </if>-->
<!-- </where>-->
order by t1.create_time desc,t1.case_num desc order by t1.create_time desc,t1.case_num desc
</select> </select>
<select id="selectTodoCountByRole" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount"> <select id="selectTodoCountByRole" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
@@ -226,14 +219,6 @@
</if> </if>
</where> </where>
) t1 ) t1
<!-- <where>
&lt;!&ndash;申请人&ndash;&gt;-->
<!-- <if test="nameId != null and nameId != ''">-->
<!-- and ( t1.application_organ_id = #{nameId} AND t1.identity_type=1-->
<!-- and t1.case_status in (0,2)-->
<!-- )-->
<!-- </if>
</where> -->
</select> </select>
<select id="selectAdminCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult"> <select id="selectAdminCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
@@ -322,106 +307,6 @@
) )
</select> </select>
<select id="selectDeptHeadCaseApplicationList" parameterType="CaseApplication" 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 '待案件归档' when 17 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.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName,c.filearbitra_url
from case_application c
LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1
<where>
c.case_status in
<foreach item="caseStatus" collection="statusList" open="(" separator="," close=")">
#{caseStatus}
</foreach>
<if test="caseApplication.caseStatus != null">
AND c.case_status = #{caseApplication.caseStatus}
</if>
<if test="caseApplication.caseNum != null and caseApplication.caseNum != ''">
AND c.case_num = #{caseApplication.caseNum}
</if>
<if test="caseApplication.nameId != null and caseApplication.nameId != ''">
AND ca.application_organ_id=#{caseApplication.nameId} AND ca.identity_type=1
</if>
<if test="caseApplication.caseStatusList != null and caseApplication.caseStatusList.size() > 0">
and c.case_status in
<foreach item="caseStatus" collection="caseApplication.caseStatusList" open="(" separator="," close=")">
#{caseStatus}
</foreach>
</if>
</where>
order by c.create_time desc,c.case_num desc
</select>
<select id="selectDeptHeadCaseToDoCount" 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,
sum( case when c.case_status=17 then 1 else 0 end) caseApplyArchived
from case_application c
LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1
<where>
<!--部门长-->
<if test="statusList != null and statusList.size() > 0">
or c.case_status in
<foreach item="caseStatus" collection="statusList" open="(" separator="," close=")">
#{caseStatus}
</foreach>
<!--被申请人-->
<if test="idCard != null and idCard != ''">
or (t.identity_num=#{idCard} AND t.identity_type=2 and t.case_status=4)
</if>
<!--仲裁员-->
<if test="userId != null and userId != ''">
or ( t.identity_type=1 and
t.case_status in (7,8,9,12,13,14)
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)
and t.application_organ_id in
<foreach item="item" collection="deptIds" open="(" separator="," close=")">
#{item}
</foreach> )
</if>
<!--申请人-->
<if test="nameId != null and nameId != ''">
or( ( t.application_organ_id = #{nameId} AND t.identity_type=1
and t.case_status in (0,2))
)
</if>
</if>
</where>
</select>
<select id="selectCaseApplicationCount" parameterType="CaseApplication" resultType="int"> <select id="selectCaseApplicationCount" parameterType="CaseApplication" resultType="int">