|
|
@@ -39,7 +39,13 @@
|
|
39
|
39
|
|
|
40
|
40
|
<select id="selectCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
|
|
41
|
41
|
select t1.* from(
|
|
42
|
|
- select t.* from(
|
|
|
42
|
+ select DISTINCT(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.applicantName,
|
|
|
47
|
+ t.arbitrator_id,t.identity_num , t.identity_type,t.filearbitra_url
|
|
|
48
|
+ from(
|
|
43
|
49
|
select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
|
|
44
|
50
|
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
|
|
45
|
51
|
ELSE '无审理方式'
|
|
|
@@ -99,20 +105,129 @@
|
|
99
|
105
|
</foreach> )
|
|
100
|
106
|
</if>
|
|
101
|
107
|
|
|
|
108
|
+ <!--申请人-->
|
|
|
109
|
+ <if test="nameId != null and nameId != ''">
|
|
|
110
|
+ or ( t.application_organ_id = #{nameId} AND t.identity_type=1
|
|
|
111
|
+ and t.case_status in (0,2))
|
|
|
112
|
+
|
|
|
113
|
+ </if>
|
|
|
114
|
+ <!--部门长-->
|
|
|
115
|
+ <if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
|
|
|
116
|
+ or (t.identity_type=1 and t.case_status in
|
|
|
117
|
+ <foreach item="caseStatus" collection="deptHeadStatus" open="(" separator="," close=")">#{caseStatus}
|
|
|
118
|
+ </foreach>)
|
|
|
119
|
+ </if>
|
|
|
120
|
+ <!--财务-->
|
|
|
121
|
+ <if test="financeStatus != null and financeStatus != ''">
|
|
|
122
|
+ or(t.identity_type=1 and t.case_status =#{financeStatus})
|
|
|
123
|
+
|
|
|
124
|
+ </if>
|
|
102
|
125
|
</where>
|
|
103
|
126
|
) t1
|
|
|
127
|
+<!-- <where>-->
|
|
|
128
|
+<!-- <!–申请人–>-->
|
|
|
129
|
+<!-- <if test="nameId != null and nameId != ''">-->
|
|
|
130
|
+<!-- and ( t1.application_organ_id = #{nameId} AND t1.identity_type=1-->
|
|
|
131
|
+<!-- and t1.case_status in (0,2)-->
|
|
|
132
|
+<!-- )-->
|
|
|
133
|
+<!-- </if>-->
|
|
|
134
|
+<!-- </where>-->
|
|
|
135
|
+ order by t1.create_time desc,t1.case_num desc
|
|
|
136
|
+ </select>
|
|
|
137
|
+ <select id="selectTodoCountByRole" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
|
|
|
138
|
+ select sum( case when t1.case_status=0 then 1 else 0 end) caseApply,
|
|
|
139
|
+ sum( case when t1.case_status=1 then 1 else 0 end) caseApplyCheck,
|
|
|
140
|
+ sum( case when t1.case_status=2 then 1 else 0 end) caseApplyPay,
|
|
|
141
|
+ sum( case when t1.case_status=3 then 1 else 0 end) caseApplyPayCheck,
|
|
|
142
|
+ sum( case when t1.case_status=4 then 1 else 0 end) caseApplyEvidence,
|
|
|
143
|
+ sum( case when t1.case_status=5 then 1 else 0 end) caseApplyGroupCheck,
|
|
|
144
|
+ sum( case when t1.case_status=6 then 1 else 0 end) caseApplyGroupConfirm,
|
|
|
145
|
+ sum( case when t1.case_status=7 then 1 else 0 end) caseApplyArbitrateWay,
|
|
|
146
|
+ sum( case when t1.case_status=8 then 1 else 0 end) caseApplyGroupOnline,
|
|
|
147
|
+ sum( case when t1.case_status=9 then 1 else 0 end) caseApplyGroupOffline,
|
|
|
148
|
+ sum( case when t1.case_status=10 then 1 else 0 end) caseApplyAward,
|
|
|
149
|
+ sum( case when t1.case_status=11 then 1 else 0 end) caseApplyAwardCheck,
|
|
|
150
|
+ sum( case when t1.case_status=12 then 1 else 0 end) caseApplyAwardConfirm,
|
|
|
151
|
+ sum( case when t1.case_status=13 then 1 else 0 end) caseApplyAwardSign,
|
|
|
152
|
+ sum( case when t1.case_status=14 then 1 else 0 end) caseApplyAwardSeal,
|
|
|
153
|
+ sum( case when t1.case_status=15 then 1 else 0 end) caseApplyAwardSend,
|
|
|
154
|
+ sum( case when t1.case_status=16 then 1 else 0 end) caseApplyStored,
|
|
|
155
|
+ sum( case when t1.case_status=17 then 1 else 0 end) caseApplyArchived
|
|
|
156
|
+ from(
|
|
|
157
|
+ select DISTINCT(t.id),t.case_status,t.application_organ_id, t.arbitrator_id,t.identity_num , t.identity_type from(
|
|
|
158
|
+ select c.id ,
|
|
|
159
|
+ c.case_status,ca.application_organ_id,
|
|
|
160
|
+ c.arbitrator_id,ca.identity_num , ca.identity_type
|
|
|
161
|
+ from case_application c
|
|
|
162
|
+ LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id
|
|
104
|
163
|
<where>
|
|
|
164
|
+ <if test="caseStatus != null">
|
|
|
165
|
+ AND c.case_status = #{caseStatus}
|
|
|
166
|
+ </if>
|
|
|
167
|
+ <if test="caseNum != null and caseNum != ''">
|
|
|
168
|
+ AND c.case_num = #{caseNum}
|
|
|
169
|
+ </if>
|
|
|
170
|
+ <if test="caseStatusList != null and caseStatusList.size() > 0">
|
|
|
171
|
+ and c.case_status in
|
|
|
172
|
+ <foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
|
|
|
173
|
+ #{caseStatus}
|
|
|
174
|
+ </foreach>
|
|
|
175
|
+ </if>
|
|
|
176
|
+ </where>
|
|
|
177
|
+ ) t
|
|
|
178
|
+ <where>
|
|
|
179
|
+
|
|
|
180
|
+ <!--被申请人-->
|
|
|
181
|
+ <if test="idCard != null and idCard != ''">
|
|
|
182
|
+ or (t.identity_num=#{idCard} AND t.identity_type=2 and t.case_status=4)
|
|
|
183
|
+ </if>
|
|
|
184
|
+ <!--仲裁员-->
|
|
|
185
|
+ <if test="userId != null and userId != ''">
|
|
|
186
|
+ or ( t.identity_type=1 and
|
|
|
187
|
+ t.case_status in (7,8,9,12,13,14)
|
|
|
188
|
+ and
|
|
|
189
|
+ instr (t.arbitrator_id,#{userId})>0)
|
|
|
190
|
+ </if>
|
|
|
191
|
+ <!--法律顾问-->
|
|
|
192
|
+ <if test="deptIds != null and deptIds.size() > 0">
|
|
|
193
|
+ or (t.identity_type=1 and t.case_status in (1,5,11,15,16)
|
|
|
194
|
+ and t.application_organ_id in
|
|
|
195
|
+ <foreach item="item" collection="deptIds" open="(" separator="," close=")">
|
|
|
196
|
+ #{item}
|
|
|
197
|
+ </foreach> )
|
|
|
198
|
+ </if>
|
|
105
|
199
|
<!--申请人-->
|
|
106
|
200
|
<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)
|
|
109
|
|
- )
|
|
|
201
|
+ or ( t.application_organ_id = #{nameId} AND t.identity_type=1
|
|
|
202
|
+ and t.case_status in (0,2))
|
|
|
203
|
+
|
|
|
204
|
+ </if>
|
|
|
205
|
+ <!--部门长-->
|
|
|
206
|
+ <if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
|
|
|
207
|
+ or (t.identity_type=1 and t.case_status in
|
|
|
208
|
+ <foreach item="caseStatus" collection="deptHeadStatus" open="(" separator="," close=")">
|
|
|
209
|
+ #{caseStatus}
|
|
|
210
|
+ </foreach>)
|
|
|
211
|
+ </if>
|
|
|
212
|
+ <!--财务-->
|
|
|
213
|
+ <if test="financeStatus != null and financeStatus != ''">
|
|
|
214
|
+ or( t.identity_type=1 and t.case_status =#{financeStatus})
|
|
|
215
|
+
|
|
110
|
216
|
</if>
|
|
111
|
217
|
</where>
|
|
112
|
|
- order by t1.create_time desc,t1.case_num desc
|
|
|
218
|
+ ) t1
|
|
|
219
|
+ <!-- <where>
|
|
|
220
|
+ <!–申请人–>-->
|
|
|
221
|
+<!-- <if test="nameId != null and nameId != ''">-->
|
|
|
222
|
+<!-- and ( t1.application_organ_id = #{nameId} AND t1.identity_type=1-->
|
|
|
223
|
+<!-- and t1.case_status in (0,2)-->
|
|
|
224
|
+<!-- )-->
|
|
|
225
|
+<!-- </if>
|
|
|
226
|
+ </where> -->
|
|
113
|
227
|
</select>
|
|
|
228
|
+
|
|
114
|
229
|
<select id="selectAdminCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
|
|
115
|
|
- select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
|
|
|
230
|
+ select DISTINCT(c.id) id,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
|
|
116
|
231
|
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
|
|
117
|
232
|
ELSE '无审理方式'
|
|
118
|
233
|
END arbitratMethodName,
|
|
|
@@ -150,6 +265,53 @@
|
|
150
|
265
|
</where>
|
|
151
|
266
|
order by c.create_time desc,c.case_num desc
|
|
152
|
267
|
</select>
|
|
|
268
|
+ <select id="selectAdminCaseToDoCount" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
|
|
|
269
|
+ SELECT
|
|
|
270
|
+ sum( case when c.case_status=0 then 1 else 0 end) caseApply,
|
|
|
271
|
+ sum( case when c.case_status=1 then 1 else 0 end) caseApplyCheck,
|
|
|
272
|
+ sum( case when c.case_status=2 then 1 else 0 end) caseApplyPay,
|
|
|
273
|
+ sum( case when c.case_status=3 then 1 else 0 end) caseApplyPayCheck,
|
|
|
274
|
+ sum( case when c.case_status=4 then 1 else 0 end) caseApplyEvidence,
|
|
|
275
|
+ sum( case when c.case_status=5 then 1 else 0 end) caseApplyGroupCheck,
|
|
|
276
|
+ sum( case when c.case_status=6 then 1 else 0 end) caseApplyGroupConfirm,
|
|
|
277
|
+ sum( case when c.case_status=7 then 1 else 0 end) caseApplyArbitrateWay,
|
|
|
278
|
+ sum( case when c.case_status=8 then 1 else 0 end) caseApplyGroupOnline,
|
|
|
279
|
+ sum( case when c.case_status=9 then 1 else 0 end) caseApplyGroupOffline,
|
|
|
280
|
+ sum( case when c.case_status=10 then 1 else 0 end) caseApplyAward,
|
|
|
281
|
+ sum( case when c.case_status=11 then 1 else 0 end) caseApplyAwardCheck,
|
|
|
282
|
+ sum( case when c.case_status=12 then 1 else 0 end) caseApplyAwardConfirm,
|
|
|
283
|
+ sum( case when c.case_status=13 then 1 else 0 end) caseApplyAwardSign,
|
|
|
284
|
+ sum( case when c.case_status=14 then 1 else 0 end) caseApplyAwardSeal,
|
|
|
285
|
+ sum( case when c.case_status=15 then 1 else 0 end) caseApplyAwardSend,
|
|
|
286
|
+ sum( case when c.case_status=16 then 1 else 0 end) caseApplyStored,
|
|
|
287
|
+ sum( case when c.case_status=17 then 1 else 0 end) caseApplyArchived
|
|
|
288
|
+ FROM
|
|
|
289
|
+ case_application c
|
|
|
290
|
+ JOIN case_affiliate ca ON ca.case_appli_id = c.id
|
|
|
291
|
+ AND ca.identity_type = 1
|
|
|
292
|
+ WHERE
|
|
|
293
|
+ c.case_status IN (
|
|
|
294
|
+ 0,
|
|
|
295
|
+ 1,
|
|
|
296
|
+ 2,
|
|
|
297
|
+ 3,
|
|
|
298
|
+ 4,
|
|
|
299
|
+ 5,
|
|
|
300
|
+ 6,
|
|
|
301
|
+ 7,
|
|
|
302
|
+ 8,
|
|
|
303
|
+ 9,
|
|
|
304
|
+ 10,
|
|
|
305
|
+ 11,
|
|
|
306
|
+ 12,
|
|
|
307
|
+ 13,
|
|
|
308
|
+ 14,
|
|
|
309
|
+ 15,
|
|
|
310
|
+ 16,
|
|
|
311
|
+ 17
|
|
|
312
|
+ )
|
|
|
313
|
+
|
|
|
314
|
+ </select>
|
|
153
|
315
|
<select id="selectDeptHeadCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
|
|
154
|
316
|
select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
|
|
155
|
317
|
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
|
|
|
@@ -193,6 +355,63 @@
|
|
193
|
355
|
</where>
|
|
194
|
356
|
order by c.create_time desc,c.case_num desc
|
|
195
|
357
|
</select>
|
|
|
358
|
+ <select id="selectDeptHeadCaseToDoCount" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
|
|
|
359
|
+ select sum( case when c.case_status=0 then 1 else 0 end) caseApply,
|
|
|
360
|
+ sum( case when c.case_status=1 then 1 else 0 end) caseApplyCheck,
|
|
|
361
|
+ sum( case when c.case_status=2 then 1 else 0 end) caseApplyPay,
|
|
|
362
|
+ sum( case when c.case_status=3 then 1 else 0 end) caseApplyPayCheck,
|
|
|
363
|
+ sum( case when c.case_status=4 then 1 else 0 end) caseApplyEvidence,
|
|
|
364
|
+ sum( case when c.case_status=5 then 1 else 0 end) caseApplyGroupCheck,
|
|
|
365
|
+ sum( case when c.case_status=6 then 1 else 0 end) caseApplyGroupConfirm,
|
|
|
366
|
+ sum( case when c.case_status=7 then 1 else 0 end) caseApplyArbitrateWay,
|
|
|
367
|
+ sum( case when c.case_status=8 then 1 else 0 end) caseApplyGroupOnline,
|
|
|
368
|
+ sum( case when c.case_status=9 then 1 else 0 end) caseApplyGroupOffline,
|
|
|
369
|
+ sum( case when c.case_status=10 then 1 else 0 end) caseApplyAward,
|
|
|
370
|
+ sum( case when c.case_status=11 then 1 else 0 end) caseApplyAwardCheck,
|
|
|
371
|
+ sum( case when c.case_status=12 then 1 else 0 end) caseApplyAwardConfirm,
|
|
|
372
|
+ sum( case when c.case_status=13 then 1 else 0 end) caseApplyAwardSign,
|
|
|
373
|
+ sum( case when c.case_status=14 then 1 else 0 end) caseApplyAwardSeal,
|
|
|
374
|
+ sum( case when c.case_status=15 then 1 else 0 end) caseApplyAwardSend,
|
|
|
375
|
+ sum( case when c.case_status=16 then 1 else 0 end) caseApplyStored,
|
|
|
376
|
+ sum( case when c.case_status=17 then 1 else 0 end) caseApplyArchived
|
|
|
377
|
+ from case_application c
|
|
|
378
|
+ LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1
|
|
|
379
|
+ <where>
|
|
|
380
|
+ <!--部门长-->
|
|
|
381
|
+ <if test="statusList != null and statusList.size() > 0">
|
|
|
382
|
+ or c.case_status in
|
|
|
383
|
+ <foreach item="caseStatus" collection="statusList" open="(" separator="," close=")">
|
|
|
384
|
+ #{caseStatus}
|
|
|
385
|
+ </foreach>
|
|
|
386
|
+ <!--被申请人-->
|
|
|
387
|
+ <if test="idCard != null and idCard != ''">
|
|
|
388
|
+ or (t.identity_num=#{idCard} AND t.identity_type=2 and t.case_status=4)
|
|
|
389
|
+ </if>
|
|
|
390
|
+ <!--仲裁员-->
|
|
|
391
|
+ <if test="userId != null and userId != ''">
|
|
|
392
|
+ or ( t.identity_type=1 and
|
|
|
393
|
+ t.case_status in (7,8,9,12,13,14)
|
|
|
394
|
+ and
|
|
|
395
|
+ instr (t.arbitrator_id,#{userId})>0)
|
|
|
396
|
+ </if>
|
|
|
397
|
+ <!--法律顾问-->
|
|
|
398
|
+ <if test="deptIds != null and deptIds.size() > 0">
|
|
|
399
|
+ or (t.identity_type=1 and t.case_status in (1,5,11,15,16)
|
|
|
400
|
+ and t.application_organ_id in
|
|
|
401
|
+ <foreach item="item" collection="deptIds" open="(" separator="," close=")">
|
|
|
402
|
+ #{item}
|
|
|
403
|
+ </foreach> )
|
|
|
404
|
+ </if>
|
|
|
405
|
+ <!--申请人-->
|
|
|
406
|
+ <if test="nameId != null and nameId != ''">
|
|
|
407
|
+ or( ( t.application_organ_id = #{nameId} AND t.identity_type=1
|
|
|
408
|
+ and t.case_status in (0,2))
|
|
|
409
|
+ )
|
|
|
410
|
+ </if>
|
|
|
411
|
+ </if>
|
|
|
412
|
+ </where>
|
|
|
413
|
+
|
|
|
414
|
+ </select>
|
|
196
|
415
|
|
|
197
|
416
|
|
|
198
|
417
|
<select id="selectCaseApplicationCount" parameterType="CaseApplication" resultType="int">
|