瀏覽代碼

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

qtz 2 年之前
父節點
當前提交
c68c91e0b3

+ 25
- 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java 查看文件

@@ -12,6 +12,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
12 12
 import com.ruoyi.common.enums.BusinessType;
13 13
 import com.ruoyi.common.exception.EsignDemoException;
14 14
 import com.ruoyi.common.exception.ServiceException;
15
+import com.ruoyi.common.utils.StringUtils;
15 16
 import com.ruoyi.common.utils.WxAppletNotifyUtils;
16 17
 import com.ruoyi.util.FileUtil;
17 18
 import com.ruoyi.wisdomarbitrate.StringIdsReq;
@@ -60,6 +61,16 @@ public class CaseApplicationController extends BaseController {
60 61
         return getDataTable(list);
61 62
     }
62 63
 
64
+    /**
65
+     * 查询批量管理案件列表
66
+     */
67
+    @GetMapping("/listBatch")
68
+    public TableDataInfo listBatch(CaseApplication caseApplication) {
69
+        startPage();
70
+        List<CaseApplication> list = caseApplicationService.selectCaseApplicationListBatchByRole(caseApplication);
71
+        return getDataTable(list);
72
+    }
73
+
63 74
     /**
64 75
      * 根据角色查询待办数量
65 76
      * @return
@@ -120,6 +131,19 @@ public class CaseApplicationController extends BaseController {
120 131
         return toAjax(caseApplicationService.submitCaseApplication(batchCaseApplication.getIds()));
121 132
     }
122 133
 
134
+    /**
135
+     * 批量提交立案申请
136
+     */
137
+    @Log(title = "批量提交立案申请", businessType = BusinessType.UPDATE)
138
+    @PostMapping("/submitCaseApplicationBatch")
139
+    public AjaxResult submitCaseApplicationBatch(@RequestBody  BatchCaseApplication batchCaseApplication) {
140
+        if(StringUtils.isEmpty(batchCaseApplication.getBatchNumber())){
141
+            return error("参数校验失败");
142
+        }
143
+        return toAjax(caseApplicationService.submitCaseApplicationBatch(batchCaseApplication.getBatchNumber()));
144
+    }
145
+
146
+
123 147
 
124 148
 
125 149
     /**
@@ -354,7 +378,7 @@ public class CaseApplicationController extends BaseController {
354 378
 
355 379
 
356 380
 
357
-    
381
+
358 382
 
359 383
     /**
360 384
      * 发送房间号短信

+ 6
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/BatchCaseApplication.java 查看文件

@@ -22,4 +22,10 @@ public class BatchCaseApplication {
22 22
     private Integer  opinion;
23 23
     /** 驳回原因 */
24 24
     private String caseCheckReject;
25
+    /**
26
+     * 批号
27
+     */
28
+    private String batchNumber;
29
+
30
+
25 31
 }

+ 4
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java 查看文件

@@ -133,4 +133,8 @@ public interface CaseApplicationMapper {
133 133
     int batchSave(@Param("list")List<CaseApplication> caseApplications);
134 134
 
135 135
     int selectCasenum(@Param("userId") String userId);
136
+
137
+    List<CaseApplication> selectAdminCaseApplicationListBatch(CaseApplication caseApplication);
138
+
139
+    List<CaseApplication> listCaseApplicationByBatchNumber(CaseApplication caseApplication);
136 140
 }

+ 3
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java 查看文件

@@ -136,4 +136,7 @@ public interface ICaseApplicationService {
136 136
 
137 137
     CaseAttach downloadCaseZipFile(CaseApplication caseApplication);
138 138
 
139
+    List<CaseApplication> selectCaseApplicationListBatchByRole(CaseApplication caseApplication);
140
+
141
+    int submitCaseApplicationBatch(String batchNumber);
139 142
 }

+ 191
- 9
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java 查看文件

@@ -2540,7 +2540,169 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2540 2540
             return  caseAttach;
2541 2541
         }
2542 2542
 
2543
+    @Override
2544
+    public List<CaseApplication> selectCaseApplicationListBatchByRole(CaseApplication caseApplication) {
2545
+        return caseApplicationMapper.selectAdminCaseApplicationListBatch(caseApplication);
2546
+    }
2543 2547
 
2548
+    @Override
2549
+    @Transactional
2550
+    public int submitCaseApplicationBatch(String batchNumber) {
2551
+        int rows = 0;
2552
+        CaseApplication caseApplicationsel = new CaseApplication();
2553
+        caseApplicationsel.setBatchNumber(batchNumber);
2554
+        caseApplicationsel.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION);
2555
+        List<CaseApplication> caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel);
2556
+        List<Long> ids = caseApplications.stream().map(CaseApplication::getId).collect(Collectors.toList());
2557
+        if(caseApplications!=null&&caseApplications.size()>0){
2558
+            Map<Long, CaseApplication> applicationMap = caseApplications.stream().collect(Collectors.toMap(CaseApplication::getId, Function.identity(), (n1, n2) -> n2));
2559
+            List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliateByCaseIds(ids);
2560
+            // 转换为Map<CaseId,List<CaseAffiliate>>形式
2561
+            Map<Long, List<CaseAffiliate>> caseAffiliateMap = caseAffiliates.stream().collect(Collectors.groupingBy(CaseAffiliate::getCaseAppliId));
2562
+            for (Long id : ids) {
2563
+                // 查询案件信息,做必填校验,校验不通过,提示,不能提交
2564
+                StringBuilder errorMsg = new StringBuilder();
2565
+                // 必填校验
2566
+                CaseApplication caseApplication = applicationMap.get(id);
2567
+                String caseNum = caseApplication.getCaseNum();
2568
+                // 基本字段校验
2569
+                if(caseApplication!=null) {
2570
+                    for (String baseColumn : baseColumns) {
2571
+                        if(StrUtil.isEmpty( ObjectFieldUtils.getValue(caseApplication, baseColumn))){
2572
+                            errorMsg.append(getColumnstr(baseColumn)).append("不能为空,");
2573
+//                            throw new ServiceException("必填字段未填写,请完善案件信息!");
2574
+                        }
2575
+                    }
2576
+                    // 校验人员
2577
+                    if(CollectionUtil.isNotEmpty(caseAffiliates)){
2578
+                        List<CaseAffiliate> affiliateList = caseAffiliateMap.get(id);
2579
+                        if(CollectionUtil.isNotEmpty(affiliateList)){
2580
+                            for (CaseAffiliate caseAffiliate : affiliateList) {
2581
+                                if(caseAffiliate.getIdentityType()==1){
2582
+                                    // 校验申请人
2583
+                                    for (String applicAffiliateColumn : applicAffiliateColumns) {
2584
+                                        if(StrUtil.isEmpty( ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))){
2585
+                                            errorMsg.append(getColumnstr(applicAffiliateColumn)).append("不能为空,");
2586
+//                                            throw new ServiceException("必填字段未填写,请完善案件信息!");
2587
+                                        }
2588
+                                    }
2589
+                                }else {
2590
+                                    // 校验被申请人
2591
+                                    for (String applicAffiliateColumn : dectborAffiliateColumns) {
2592
+                                        if(StrUtil.isEmpty( ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))){
2593
+                                            errorMsg.append(getColumnstr(applicAffiliateColumn)).append("不能为空,");
2594
+//                                            throw new ServiceException("必填字段未填写,请完善案件信息!");
2595
+                                        }
2596
+                                    }
2597
+                                }
2598
+                            }
2599
+                        }
2600
+                    }
2601
+                }
2602
+                if(StringUtils.isNotEmpty(errorMsg.toString())){
2603
+                    throw new ServiceException("案件编号" + caseNum + errorMsg.toString()+"请完善案件信息!");
2604
+                }
2605
+
2606
+                CaseApplication application = new CaseApplication();
2607
+                application.setId(id);
2608
+                //提交立案申请
2609
+                application.setCaseStatus(CaseApplicationConstants.CASE_CHECK);
2610
+                rows += caseApplicationMapper.submitCaseApplication(application);
2611
+                // 新增日志
2612
+                insertCaseLog(application.getId(), CaseApplicationConstants.CASE_CHECK, "");
2613
+            }
2614
+
2615
+        }else{
2616
+            throw new ServiceException("这个批号没有批量提交的案件");
2617
+        }
2618
+
2619
+        return rows;
2620
+    }
2621
+
2622
+    private String getColumnstr(String columnname) {
2623
+        String columnstr  = "";
2624
+        switch (columnname) {
2625
+            case "caseName":
2626
+                columnstr = "案件名称";
2627
+                break;
2628
+            case "caseSubjectAmount":
2629
+                columnstr = "案件标的";
2630
+                break;
2631
+            case "loanStartDate":
2632
+                columnstr = "借款开始日期";
2633
+                break;
2634
+            case "loanEndDate":
2635
+                columnstr = "借款结束日期";
2636
+                break;
2637
+            case "contractNumber":
2638
+                columnstr = "合同编号";
2639
+                break;
2640
+            case "claimInterestOwed":
2641
+                columnstr = "申请人主张欠利息";
2642
+                break;
2643
+            case "claimLiquidDamag":
2644
+                columnstr = "申请人主张违约金";
2645
+                break;
2646
+            case "claimPrinciOwed":
2647
+                columnstr = "申请人主张欠本金";
2648
+                break;
2649
+            case "arbitratClaims":
2650
+                columnstr = "申请人仲裁请求及事实和理由";
2651
+                break;
2652
+            case "name":
2653
+                columnstr = "姓名";
2654
+                break;
2655
+            case "identityNum":
2656
+                columnstr = "身份证号";
2657
+                break;
2658
+            case "contactTelphone":
2659
+                columnstr = "联系电话";
2660
+                break;
2661
+            case "contactAddress":
2662
+                columnstr = "联系地址";
2663
+                break;
2664
+            case "workTelphone":
2665
+                columnstr = "单位电话";
2666
+                break;
2667
+            case "workAddress":
2668
+                columnstr = "单位地址";
2669
+                break;
2670
+            case "residenAffili":
2671
+                columnstr = "住所";
2672
+                break;
2673
+            case "compLegalPerson":
2674
+                columnstr = "法定代表人";
2675
+                break;
2676
+            case "compLegalperPost":
2677
+                columnstr = "法定代表人职位";
2678
+                break;
2679
+            case "email":
2680
+                columnstr = "邮箱";
2681
+                break;
2682
+            case "nameAgent":
2683
+                columnstr = "代理人姓名";
2684
+                break;
2685
+            case "identityNumAgent":
2686
+                columnstr = "代理人身份证号";
2687
+                break;
2688
+            case "contactTelphoneAgent":
2689
+                columnstr = "代理人联系电话";
2690
+                break;
2691
+            case "contactAddressAgent":
2692
+                columnstr = "代理人联系地址";
2693
+                break;
2694
+            case "responSex":
2695
+                columnstr = "被申请人性别";
2696
+                break;
2697
+            case "responBirth":
2698
+                columnstr = "被申请人出生年月日";
2699
+                break;
2700
+            default:
2701
+                columnstr = "";
2702
+        }
2703
+
2704
+        return columnstr;
2705
+    }
2544 2706
 
2545 2707
 
2546 2708
     @Override
@@ -2594,9 +2756,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2594 2756
 
2595 2757
         //发送短信通知 1947342 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。
2596 2758
         SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
2597
-        request.setTemplateId("1947342");
2759
+        request.setTemplateId("2033619");
2598 2760
         // 发送开庭日期通知短信
2599
-        sendHearDateMessage(caseApplication, request, "1947342");
2761
+        sendHearDateMessage(caseApplication, request, "2033619");
2600 2762
         // 新增日志
2601 2763
         insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, "");
2602 2764
 
@@ -2614,9 +2776,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2614 2776
         CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
2615 2777
 
2616 2778
         String caseNum = caseApplicationselect.getCaseNum();
2617
-        //Date hearDate = caseApplicationselect.getHearDate();
2779
+        Date hearDate = caseApplicationselect.getHearDate();
2780
+        String hearDatestr = "";
2618 2781
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
2619
-        String hearDatestr = null;
2782
+        if(hearDate!=null) {
2783
+            hearDatestr = dateFormat.format(hearDate);
2784
+        }
2620 2785
         String arbitratorId = caseApplicationselect.getArbitratorId();
2621 2786
 //        List<Arbitrator> arbitratorList = new ArrayList<>();
2622 2787
         if (StringUtils.isNotEmpty(arbitratorId)) {
@@ -2633,7 +2798,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2633 2798
                     request.setPhone(user.getPhonenumber());
2634 2799
                     // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。
2635 2800
                     String name = user.getNickName();
2636
-                    request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr});
2801
+                    if (templateId.equals("2033619")) {
2802
+                        request.setTemplateParamSet(new String[]{name, caseNum});
2803
+                    }
2804
+                    if (templateId.equals("1975139")) {
2805
+                        request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr});
2806
+                    }
2807
+
2637 2808
                     Boolean aBoolean = SmsUtils.sendSms(request);
2638 2809
                     //保存短信发送记录
2639 2810
                     SmsSendRecord smsSendRecord = new SmsSendRecord();
@@ -2642,8 +2813,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2642 2813
                     smsSendRecord.setPhone(request.getPhone());
2643 2814
                     smsSendRecord.setSendTime(new Date());
2644 2815
                     String content = "";
2645
-                    if (templateId.equals("1947342")) {
2646
-                        content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已确定为" + hearDatestr + ",请知晓,如非本人操作,请忽略本短信。";
2816
+                    if (templateId.equals("2033619")) {
2817
+                        content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,已组庭,请知晓,如非本人操作,请忽略本短信。";
2647 2818
                     }
2648 2819
                     if (templateId.equals("1975139")) {
2649 2820
                         content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已改为" + hearDatestr + ",请知晓,如非本人操作,请忽略本短信。";
@@ -2677,7 +2848,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2677 2848
                 request.setPhone(caseAffiliateselect.getContactTelphone());
2678 2849
                 // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。
2679 2850
                 String name = caseAffiliateselect.getName();
2680
-                request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr});
2851
+                if (templateId.equals("2033619")) {
2852
+                    request.setTemplateParamSet(new String[]{name, caseNum});
2853
+                }
2854
+                if (templateId.equals("1975139")) {
2855
+                    request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr});
2856
+                }
2681 2857
                 Boolean aBoolean = SmsUtils.sendSms(request);
2682 2858
                 //保存短信发送记录
2683 2859
                 SmsSendRecord smsSendRecord = new SmsSendRecord();
@@ -2685,7 +2861,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2685 2861
                 smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum());
2686 2862
                 smsSendRecord.setPhone(request.getPhone());
2687 2863
                 smsSendRecord.setSendTime(new Date());
2688
-                String content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已确定为" + hearDatestr + ",请知晓,如非本人操作,请忽略本短信。";
2864
+                String content = "";
2865
+                if (templateId.equals("2033619")) {
2866
+                    content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,已组庭,请知晓,如非本人操作,请忽略本短信。";
2867
+                }
2868
+                if (templateId.equals("1975139")) {
2869
+                    content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已改为" + hearDatestr + ",请知晓,如非本人操作,请忽略本短信。";
2870
+                }
2689 2871
                 smsSendRecord.setSendContent(content);
2690 2872
                 smsSendRecord.setCreateBy(getUsername());
2691 2873
                 if (aBoolean) {

+ 2
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java 查看文件

@@ -152,12 +152,13 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
152 152
                         }
153 153
                         smsRecordMapper.saveSmsSendRecord(smsSendRecord);
154 154
                     } else {       //被申请人
155
-                        Boolean aBoolean = SmsUtils.sendSms(request);
155
+
156 156
                         request.setPhone(affiliate.getContactTelphone());
157 157
                         request.setTemplateId("1952840");
158 158
                         // 1952840 尊敬的{1}用户,您的{2}案件{3}已成功受理,请点击链接:https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 选择是否应诉。如非本人操作,请忽略本短信
159 159
                         String name = affiliate.getName();
160 160
                         request.setTemplateParamSet(new String[]{name, caseName, caseNum});
161
+                        Boolean aBoolean = SmsUtils.sendSms(request);
161 162
                         //保存短信发送记录
162 163
                         SmsSendRecord smsSendRecord = new SmsSendRecord();
163 164
                         smsSendRecord.setCaseId(caseApplication.getId());

+ 67
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml 查看文件

@@ -53,6 +53,8 @@
53 53
 
54 54
         <result property="batchNumber" column="batch_number"/>
55 55
         <result property="mediationAgreement" column="mediation_agreement"/>
56
+        <result property="identityType" column="identity_type"/>
57
+        <result property="name" column="name"/>
56 58
     </resultMap>
57 59
 
58 60
 
@@ -851,6 +853,32 @@
851 853
         </where>
852 854
         order by c.case_num desc
853 855
     </select>
856
+
857
+    <select id="selectAdminCaseApplicationListBatch" parameterType="CaseApplication" resultMap="CaseApplicationResult">
858
+        SELECT DISTINCT c.batch_number ,c.arbitrat_method ,c.arbitrator_name ,
859
+        c.arbitrator_id  ,c.case_status ,a.identity_type ,a.name ,
860
+        CASE c.case_status  when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
861
+        when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
862
+        when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
863
+        when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
864
+        when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
865
+        when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
866
+        when 18 then '待仲裁员审核仲裁文书'
867
+        when 31 then '待修改开庭时间'
868
+        ELSE '无案件状态'
869
+        END caseStatusName,
870
+        CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
871
+        ELSE '无审理方式'
872
+        END arbitratMethodName
873
+        FROM  case_application c left join case_affiliate a on c.id  = a.case_appli_id
874
+        WHERE c.lock_status = 0 and c.batch_number is not null
875
+        and a.identity_type  = 1
876
+        <if test="batchNumber != null and batchNumber != ''">
877
+            AND c.batch_number = #{batchNumber}
878
+        </if>
879
+        order by  c.batch_number desc
880
+    </select>
881
+
854 882
     <select id="selectAdminCaseToDoCount" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
855 883
         SELECT
856 884
             sum( case when c.case_status=0 then 1 else 0 end) caseApply,
@@ -1286,6 +1314,45 @@
1286 1314
         where  c.id = #{id} and p.payment_status=1 limit 1
1287 1315
 
1288 1316
     </select>
1317
+
1318
+    <select id="listCaseApplicationByBatchNumber" resultMap="CaseApplicationResult">
1319
+        select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,c.case_name,
1320
+        CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
1321
+        ELSE '无审理方式'
1322
+        END arbitratMethodName,
1323
+        c.case_status ,
1324
+        CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
1325
+        when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
1326
+        when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
1327
+        when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
1328
+        when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
1329
+        when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
1330
+        when 18 then '待仲裁员审核仲裁文书'
1331
+        when 31 then '待修改开庭时间'
1332
+        ELSE '无案件状态'
1333
+        END caseStatusName,
1334
+        c.hear_date ,c.arbitrat_claims ,
1335
+        c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag
1336
+        ,c.fee_payable ,
1337
+        c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time
1338
+        ,c.request_rule,c.adjudica_counter,c.proper_preser,
1339
+        c.is_absence ,c.respon_cross_opin ,c.applica_cross_opin ,c.respon_defen_opini ,
1340
+        c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,ca.application_organ_id applicationOrganId
1341
+        ,ca.application_organ_name as applicantName,
1342
+        c.batch_number,
1343
+        c.facts,
1344
+        c.mediation_agreement,c.template_id templateId
1345
+        from case_application c
1346
+        LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
1347
+        WHERE c.lock_status = 0
1348
+        <if test="batchNumber != null and batchNumber != ''">
1349
+            AND c.batch_number = #{batchNumber}
1350
+        </if>
1351
+        <if test="caseStatus != null">
1352
+            AND c.case_status = #{caseStatus}
1353
+        </if>
1354
+    </select>
1355
+
1289 1356
     <select id="selectCaseNumLike" resultType="java.lang.Integer">
1290 1357
         select max(substring(case_num, #{length}+1,12)) as maxCaseNum
1291 1358
         from case_application where case_num like CONCAT(#{caseNum},'%') ;