Browse Source

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

wangqiong123 2 years ago
parent
commit
b71228a24a

+ 15
- 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java View File

@@ -12,6 +12,7 @@ import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord;
12 12
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
13 13
 import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
14 14
 import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
15
+import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
15 16
 import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
16 17
 import org.springframework.beans.factory.annotation.Autowired;
17 18
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -38,11 +39,23 @@ public class CaseApplicationController extends BaseController {
38 39
     @GetMapping("/list")
39 40
     public TableDataInfo list(CaseApplication caseApplication) {
40 41
         startPage();
41
-//        List<CaseApplication> list = caseApplicationService.selectCaseApplicationListNew(caseApplication);
42
-        List<CaseApplication> list = caseApplicationService.selectCaseApplicationList(caseApplication);
42
+        List<CaseApplication> list = caseApplicationService.selectCaseApplicationListByRole(caseApplication);
43
+//        List<CaseApplication> list = caseApplicationService.selectCaseApplicationList(caseApplication);
43 44
         return getDataTable(list);
44 45
     }
45 46
 
47
+    /**
48
+     * 根据角色查询待办数量
49
+     * @return
50
+     */
51
+
52
+    @GetMapping("/toDoCount")
53
+    public AjaxResult toDoCount() {
54
+        ToDoCount toDoCount = caseApplicationService.selectToDoCount();
55
+//        List<CaseApplication> list = caseApplicationService.selectCaseApplicationList(caseApplication);
56
+        return success(toDoCount);
57
+    }
58
+
46 59
     /**
47 60
      * 新增立案数据
48 61
      */

+ 88
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ToDoCount.java View File

@@ -0,0 +1,88 @@
1
+package com.ruoyi.wisdomarbitrate.domain.vo;
2
+
3
+import lombok.Data;
4
+
5
+/**
6
+ * @author wangqiong
7
+ * @description 待办数量
8
+ * @date 2023-10-17 09:48
9
+ */
10
+@Data
11
+public class ToDoCount {
12
+    /**
13
+     * 立案申请
14
+     */
15
+    private int caseApply;
16
+    /**
17
+     * 待立案审查
18
+     */
19
+    private int caseApplyCheck;
20
+    /**
21
+     * 待缴费
22
+     */
23
+    private int caseApplyPay;
24
+    /**
25
+     * 待缴费确认
26
+     */
27
+    private int caseApplyPayCheck;
28
+    /**
29
+     * 待案件质证
30
+     */
31
+    private int caseApplyEvidence;
32
+    /**
33
+     * 待组庭审核
34
+     */
35
+    private int caseApplyGroupCheck;
36
+    /**
37
+     * 待组庭确定
38
+     */
39
+    private int caseApplyGroupConfirm;
40
+    /**
41
+     * 待组庭通知
42
+     */
43
+//    private int caseApplyGroupNotice;
44
+    /**
45
+     * 待审核仲裁方式
46
+     */
47
+    private int caseApplyArbitrateWay;
48
+    /**
49
+     * 待开庭审理
50
+     */
51
+    private int caseApplyGroupOnline;
52
+    /**
53
+     * 待书面审理
54
+     */
55
+    private int caseApplyGroupOffline;
56
+    /**
57
+     * 待生成仲裁文书
58
+     */
59
+    private int caseApplyAward;
60
+    /**
61
+     * 待核验仲裁文书
62
+     */
63
+    private int caseApplyAwardCheck;
64
+    /**
65
+     * 待审核仲裁文书
66
+     */
67
+    private int caseApplyAwardConfirm;
68
+    /**
69
+     * 待仲裁文书签名
70
+     */
71
+    private int caseApplyAwardSign;
72
+    /**
73
+     * 待仲裁文书用印
74
+     */
75
+    private int caseApplyAwardSeal;
76
+    /**
77
+     * 待仲裁文书送达
78
+     */
79
+    private int caseApplyAwardSend;
80
+    /**
81
+     * 待案件归档
82
+     */
83
+    private int caseApplyStored;
84
+    /**
85
+     * 已归档
86
+     */
87
+    private int caseApplyArchived;
88
+}

+ 7
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java View File

@@ -4,6 +4,7 @@ import com.ruoyi.wisdomarbitrate.domain.Arbitrator;
4 4
 import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
5 5
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
6 6
 import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO;
7
+import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
7 8
 import org.apache.ibatis.annotations.Param;
8 9
 
9 10
 import java.util.List;
@@ -60,4 +61,10 @@ public interface CaseApplicationMapper {
60 61
      * @return
61 62
      */
62 63
     List<CaseApplication> selectDeptHeadCaseApplicationList(@Param("caseApplication") CaseApplication caseApplication, @Param("statusList")List<Integer> caseStatusList);
64
+
65
+    ToDoCount selectAdminCaseToDoCount();
66
+
67
+    ToDoCount selectDeptHeadCaseToDoCount( @Param("statusList")List<Integer> caseStatusList);
68
+
69
+    ToDoCount selectTodoCountByRole(CaseApplication caseApplication);
63 70
 }

+ 8
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java View File

@@ -6,12 +6,13 @@ import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord;
6 6
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
7 7
 import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
8 8
 import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
9
+import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
9 10
 
10 11
 import java.util.List;
11 12
 
12 13
 public interface ICaseApplicationService {
13 14
     List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication);
14
-    List<CaseApplication> selectCaseApplicationListNew(CaseApplication caseApplication);
15
+    List<CaseApplication> selectCaseApplicationListByRole(CaseApplication caseApplication);
15 16
 
16 17
 
17 18
     int insertcaseApplication(CaseApplication caseApplication);
@@ -53,4 +54,10 @@ public interface ICaseApplicationService {
53 54
     AjaxResult creatTrialRecord(ArbitrateRecord arbitrateRecord);
54 55
 
55 56
     CaseApplication selectSignSealUrl(CaseApplication caseApplication) throws EsignDemoException;
57
+
58
+    /**
59
+     * 查询待办数量
60
+     * @return
61
+     */
62
+    ToDoCount selectToDoCount();
56 63
 }

+ 57
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java View File

@@ -29,6 +29,7 @@ import com.ruoyi.common.core.domain.entity.SysUser;
29 29
 import com.ruoyi.common.exception.EsignDemoException;
30 30
 import com.ruoyi.common.exception.ServiceException;
31 31
 import com.ruoyi.system.mapper.SysUserMapper;
32
+import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
32 33
 import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
33 34
 import com.ruoyi.common.utils.bean.BeanUtils;
34 35
 import com.ruoyi.system.mapper.SysDeptMapper;
@@ -99,7 +100,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
99 100
      * @return
100 101
      */
101 102
 //    @Override
102
-    public List<CaseApplication> selectCaseApplicationListNew(CaseApplication caseApplication) {
103
+    public List<CaseApplication> selectCaseApplicationListByRole(CaseApplication caseApplication) {
103 104
         // 获取登录用户
104 105
         LoginUser loginUser = getLoginUser();
105 106
         SysUser user = loginUser.getUser();
@@ -151,6 +152,59 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
151 152
 
152 153
     }
153 154
     @Override
155
+    public ToDoCount selectToDoCount() {
156
+
157
+        // 获取登录用户
158
+        LoginUser loginUser = getLoginUser();
159
+        SysUser user = loginUser.getUser();
160
+        Long userId = user.getUserId();
161
+
162
+        // 查询登录人身份证号
163
+        SysUser sysUser = sysUserMapper.selectUserById(userId);
164
+        List<SysRole> roles = sysUser.getRoles();
165
+        // 没有角色不能查看案件列表
166
+        if(CollectionUtil.isEmpty(roles)){
167
+            throw new ServiceException("该用户没有角色权限");
168
+        }
169
+        CaseApplication caseApplication = new CaseApplication();
170
+        for (SysRole role : roles) {
171
+            // 超级管理员和仲裁委(部门长)案件,可查看所有案件 √
172
+            if(role.getRoleName().equals("超级管理员")
173
+            ){
174
+                return caseApplicationMapper.selectAdminCaseToDoCount();
175
+            }
176
+            // 查看所有案件
177
+            if(role.getRoleName().equals("仲裁委")
178
+                    ||role.getRoleName().equals("部门长")){
179
+                List<Integer> caseStatusList=new ArrayList<>();
180
+                caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
181
+                caseStatusList.add(CaseApplicationConstants.SIGN_ARBITRATION);
182
+                caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
183
+                return caseApplicationMapper.selectDeptHeadCaseToDoCount(caseStatusList);
184
+            }
185
+            if(role.getRoleName().equals("仲裁员")){
186
+                caseApplication.setUserId(String.valueOf(userId));
187
+            }
188
+            if(role.getRoleName().equals("法律顾问")){
189
+                // 查询角色有关的用户部门
190
+                List<Long> deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
191
+                caseApplication.setDeptIds(deptIds);
192
+            }
193
+            if(StrUtil.isEmpty(caseApplication.getNameId())&&role.getRoleName().equals("申请人")){
194
+                // 查询角色有关的用户部门
195
+                caseApplication.setNameId(String.valueOf(sysUser.getDeptId()));
196
+            }
197
+            if(role.getRoleName().equals("被申请人")){
198
+                //
199
+                caseApplication.setIdCard(String.valueOf(sysUser.getIdCard()));
200
+            }
201
+        }
202
+
203
+
204
+        // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件
205
+        return caseApplicationMapper.selectTodoCountByRole(caseApplication);
206
+    }
207
+    @Override
154 208
     public List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication) {
155 209
         return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication);
156 210
 
@@ -1272,6 +1326,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1272 1326
         return caseApplication;
1273 1327
     }
1274 1328
 
1329
+
1330
+
1275 1331
     @Override
1276 1332
     @Transactional
1277 1333
     public int pendTralSure(CaseApplication caseApplication) {

+ 7
- 4
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/WeChatUserServiceImpl.java View File

@@ -81,7 +81,7 @@ public class WeChatUserServiceImpl implements WeChatUserService {
81 81
      */
82 82
     public static void setCodeCache(String key, String code)
83 83
     {
84
-        SpringUtils.getBean(RedisCache.class).setCacheObject(getVerifyCodeCacheKey(key), code, 5,TimeUnit.MILLISECONDS);
84
+        SpringUtils.getBean(RedisCache.class).setCacheObject(getVerifyCodeCacheKey(key), code, 5,TimeUnit.MINUTES);
85 85
     }
86 86
 
87 87
 
@@ -107,9 +107,12 @@ public class WeChatUserServiceImpl implements WeChatUserService {
107 107
     @Transactional
108 108
     @Override
109 109
     public AjaxResult registerUser(IdentityAuthentication ientityAuthentication) {
110
+        String codeCache = getCodeCache(ientityAuthentication.getPhone());
110 111
         // 校验短信验证码
111
-        if(StrUtil.isEmpty(getCodeCache(ientityAuthentication.getPhone()))){
112
-            return AjaxResult.success("验证码校验失败");
112
+        if(StrUtil.isEmpty(codeCache)){
113
+            return AjaxResult.warn("验证码校验失败");
114
+        }else if(!codeCache.equals(ientityAuthentication.getVerifyCode())){
115
+            return AjaxResult.warn("验证码校验失败");
113 116
         }
114 117
         SysUser sysUserName=sysUserMapper.selectUserByUserName(ientityAuthentication.getUserName());
115 118
         if(sysUserName!=null){
@@ -140,7 +143,7 @@ public class WeChatUserServiceImpl implements WeChatUserService {
140 143
             sysUser.setPassword(SecurityUtils.encryptPassword(ientityAuthentication.getPassWord()));
141 144
             int row = sysUserMapper.insertUser(sysUser);
142 145
             if(row<1) {
143
-                return AjaxResult.error("注册失败");
146
+                return AjaxResult.warn("注册失败");
144 147
             }
145 148
         }
146 149
 

+ 175
- 5
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml View File

@@ -39,7 +39,14 @@
39 39
 
40 40
     <select id="selectCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
41 41
         select t1.* from(
42
-        select t.* from(
42
+        select dinstinct(t.id),t.case_num ,t.case_subject_amount ,t.register_date ,t.arbitrat_method,
43
+             t.arbitratMethodName,t.case_status,t.caseStatusName,t.hear_date ,t.arbitrat_claims ,
44
+        t.loan_start_date ,t.loan_end_date ,t.claim_princi_owed ,t.claim_interest_owed ,t.claim_liquid_damag,t.fee_payable ,
45
+        t.begin_video_date ,t.online_video_person ,t.contract_number ,t.create_by ,t.create_time ,
46
+        t.update_by ,t.update_time , t.arbitrator_name,t.name,t.application_organ_id,t.application_organ_name as
47
+        applicantName,
48
+        t.arbitrator_id,t.identity_num , t.identity_type,t.filearbitra_url
49
+        from(
43 50
         select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
44 51
         CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
45 52
         ELSE '无审理方式'
@@ -98,19 +105,106 @@
98 105
                     #{item}
99 106
                 </foreach> )
100 107
             </if>
101
-
108
+            <where>
109
+                <!--申请人-->
110
+                <if test="nameId != null and nameId != ''">
111
+                    or( ( t.application_organ_id = #{nameId} AND t.identity_type=1
112
+                    and t.case_status in (0,2))
113
+                    )
114
+                </if>
115
+            </where>
102 116
         </where>
103 117
         ) t1
118
+<!--        <where>-->
119
+<!--            &lt;!&ndash;申请人&ndash;&gt;-->
120
+<!--            <if test="nameId != null and nameId != ''">-->
121
+<!--                and ( t1.application_organ_id = #{nameId} AND t1.identity_type=1-->
122
+<!--                    and t1.case_status in (0,2)-->
123
+<!--                )-->
124
+<!--            </if>-->
125
+<!--        </where>-->
126
+        order by t1.create_time desc,t1.case_num desc
127
+    </select>
128
+    <select id="selectTodoCountByRole" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
129
+        select sum( case when t1.case_status=0 then 1 else 0 end) caseApply,
130
+        sum( case when t1.case_status=1 then 1 else 0 end) caseApplyCheck,
131
+        sum( case when t1.case_status=2 then 1 else 0 end) caseApplyPay,
132
+        sum( case when t1.case_status=3 then 1 else 0 end) caseApplyPayCheck,
133
+        sum( case when t1.case_status=4 then 1 else 0 end) caseApplyEvidence,
134
+        sum( case when t1.case_status=5 then 1 else 0 end) caseApplyGroupCheck,
135
+        sum( case when t1.case_status=6 then 1 else 0 end) caseApplyGroupConfirm,
136
+        sum( case when t1.case_status=7 then 1 else 0 end) caseApplyArbitrateWay,
137
+        sum( case when t1.case_status=8 then 1 else 0 end) caseApplyGroupOnline,
138
+        sum( case when t1.case_status=9 then 1 else 0 end) caseApplyGroupOffline,
139
+        sum( case when t1.case_status=10 then 1 else 0 end) caseApplyAward,
140
+        sum( case when t1.case_status=11 then 1 else 0 end) caseApplyAwardCheck,
141
+        sum( case when t1.case_status=12 then 1 else 0 end) caseApplyAwardConfirm,
142
+        sum( case when t1.case_status=13 then 1 else 0 end) caseApplyAwardSign,
143
+        sum( case when t1.case_status=14 then 1 else 0 end) caseApplyAwardSeal,
144
+        sum( case when t1.case_status=15 then 1 else 0 end) caseApplyAwardSend,
145
+        sum( case when t1.case_status=16 then 1 else 0 end) caseApplyStored,
146
+        sum( case when t1.case_status=17 then 1 else 0 end) caseApplyArchived
147
+        from(
148
+        select  DISTINCT(t.id),t.case_status,t.application_organ_id, t.arbitrator_id,t.identity_num , t.identity_type from(
149
+        select c.id ,
150
+         c.case_status,ca.application_organ_id,
151
+        c.arbitrator_id,ca.identity_num , ca.identity_type
152
+        from case_application c
153
+        LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id
154
+        <where>
155
+            <if test="caseStatus != null">
156
+                AND c.case_status = #{caseStatus}
157
+            </if>
158
+            <if test="caseNum != null and caseNum != ''">
159
+                AND c.case_num = #{caseNum}
160
+            </if>
161
+            <if test="caseStatusList != null and caseStatusList.size() > 0">
162
+                and c.case_status in
163
+                <foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
164
+                    #{caseStatus}
165
+                </foreach>
166
+            </if>
167
+        </where>
168
+        ) t
104 169
         <where>
170
+
171
+            <!--被申请人-->
172
+            <if test="idCard != null and idCard != ''">
173
+                or (t.identity_num=#{idCard} AND t.identity_type=2 and t.case_status=4)
174
+            </if>
175
+            <!--仲裁员-->
176
+            <if test="userId != null and userId != ''">
177
+                or ( t.identity_type=1 and
178
+                t.case_status in (7,8,9,12,13,14)
179
+                and
180
+                instr (t.arbitrator_id,#{userId})>0)
181
+            </if>
182
+            <!--法律顾问-->
183
+            <if test="deptIds != null and deptIds.size() > 0">
184
+                or (t.identity_type=1 and t.case_status in (1,5,11,15,16)
185
+                and t.application_organ_id in
186
+                <foreach item="item" collection="deptIds" open="(" separator="," close=")">
187
+                    #{item}
188
+                </foreach> )
189
+            </if>
105 190
             <!--申请人-->
106 191
             <if test="nameId != null and nameId != ''">
107
-                and ( t1.application_organ_id = #{nameId} AND t1.identity_type=1
108
-                    and t1.case_status in (0,2)
192
+                or( ( t.application_organ_id = #{nameId} AND t.identity_type=1
193
+                and t.case_status in (0,2))
109 194
                 )
110 195
             </if>
111 196
         </where>
112
-        order by t1.create_time desc,t1.case_num desc
197
+        ) t1
198
+--         <where>
199
+<!--            &lt;!&ndash;申请人&ndash;&gt;-->
200
+<!--            <if test="nameId != null and nameId != ''">-->
201
+<!--                and ( t1.application_organ_id = #{nameId} AND t1.identity_type=1-->
202
+<!--                and t1.case_status in (0,2)-->
203
+<!--                )-->
204
+<!--            </if>-->
205
+--         </where>
113 206
     </select>
207
+
114 208
     <select id="selectAdminCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
115 209
         select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
116 210
         CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
@@ -150,6 +244,53 @@
150 244
         </where>
151 245
         order by c.create_time desc,c.case_num desc
152 246
     </select>
247
+    <select id="selectAdminCaseToDoCount" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
248
+        SELECT
249
+            sum( case when c.case_status=0 then 1 else 0 end) caseApply,
250
+            sum( case when c.case_status=1 then 1 else 0 end) caseApplyCheck,
251
+            sum( case when c.case_status=2 then 1 else 0 end) caseApplyPay,
252
+            sum( case when c.case_status=3 then 1 else 0 end) caseApplyPayCheck,
253
+            sum( case when c.case_status=4 then 1 else 0 end) caseApplyEvidence,
254
+            sum( case when c.case_status=5 then 1 else 0 end) caseApplyGroupCheck,
255
+            sum( case when c.case_status=6 then 1 else 0 end) caseApplyGroupConfirm,
256
+            sum( case when c.case_status=7 then 1 else 0 end) caseApplyArbitrateWay,
257
+            sum( case when c.case_status=8 then 1 else 0 end) caseApplyGroupOnline,
258
+            sum( case when c.case_status=9 then 1 else 0 end) caseApplyGroupOffline,
259
+            sum( case when c.case_status=10 then 1 else 0 end) caseApplyAward,
260
+            sum( case when c.case_status=11 then 1 else 0 end) caseApplyAwardCheck,
261
+            sum( case when c.case_status=12 then 1 else 0 end) caseApplyAwardConfirm,
262
+            sum( case when c.case_status=13 then 1 else 0 end) caseApplyAwardSign,
263
+            sum( case when c.case_status=14 then 1 else 0 end) caseApplyAwardSeal,
264
+            sum( case when c.case_status=15 then 1 else 0 end) caseApplyAwardSend,
265
+            sum( case when c.case_status=16 then 1 else 0 end) caseApplyStored,
266
+            sum( case when c.case_status=17 then 1 else 0 end) caseApplyArchived
267
+        FROM
268
+            case_application c
269
+                LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id
270
+                AND ca.identity_type = 1
271
+        WHERE
272
+                c.case_status IN (
273
+                                  0,
274
+                                  1,
275
+                                  2,
276
+                                  3,
277
+                                  4,
278
+                                  5,
279
+                                  6,
280
+                                  7,
281
+                                  8,
282
+                                  9,
283
+                                  10,
284
+                                  11,
285
+                                  12,
286
+                                  13,
287
+                                  14,
288
+                                  15,
289
+                                  16,
290
+                                  17
291
+                )
292
+
293
+    </select>
153 294
     <select id="selectDeptHeadCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
154 295
         select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
155 296
         CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
@@ -193,6 +334,35 @@
193 334
         </where>
194 335
         order by c.create_time desc,c.case_num desc
195 336
     </select>
337
+    <select id="selectDeptHeadCaseToDoCount" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
338
+        select  sum( case when c.case_status=0 then 1 else 0 end) caseApply,
339
+        sum( case when c.case_status=1 then 1 else 0 end) caseApplyCheck,
340
+        sum( case when c.case_status=2 then 1 else 0 end) caseApplyPay,
341
+        sum( case when c.case_status=3 then 1 else 0 end) caseApplyPayCheck,
342
+        sum( case when c.case_status=4 then 1 else 0 end) caseApplyEvidence,
343
+        sum( case when c.case_status=5 then 1 else 0 end) caseApplyGroupCheck,
344
+        sum( case when c.case_status=6 then 1 else 0 end) caseApplyGroupConfirm,
345
+        sum( case when c.case_status=7 then 1 else 0 end) caseApplyArbitrateWay,
346
+        sum( case when c.case_status=8 then 1 else 0 end) caseApplyGroupOnline,
347
+        sum( case when c.case_status=9 then 1 else 0 end) caseApplyGroupOffline,
348
+        sum( case when c.case_status=10 then 1 else 0 end) caseApplyAward,
349
+        sum( case when c.case_status=11 then 1 else 0 end) caseApplyAwardCheck,
350
+        sum( case when c.case_status=12 then 1 else 0 end) caseApplyAwardConfirm,
351
+        sum( case when c.case_status=13 then 1 else 0 end) caseApplyAwardSign,
352
+        sum( case when c.case_status=14 then 1 else 0 end) caseApplyAwardSeal,
353
+        sum( case when c.case_status=15 then 1 else 0 end) caseApplyAwardSend,
354
+        sum( case when c.case_status=16 then 1 else 0 end) caseApplyStored,
355
+        sum( case when c.case_status=17 then 1 else 0 end) caseApplyArchived
356
+        from case_application c
357
+        LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1
358
+        <where>
359
+            c.case_status in
360
+            <foreach item="caseStatus" collection="statusList" open="(" separator="," close=")">
361
+                #{caseStatus}
362
+            </foreach>
363
+        </where>
364
+
365
+    </select>
196 366
 
197 367
 
198 368
     <select id="selectCaseApplicationCount" parameterType="CaseApplication" resultType="int">