|
|
@@ -67,7 +67,8 @@
|
|
67
|
67
|
,t.claim_liquid_damag,t.fee_payable ,
|
|
68
|
68
|
t.begin_video_date ,t.online_video_person ,t.contract_number ,t.create_by ,t.create_time ,
|
|
69
|
69
|
t.update_by ,t.update_time , t.arbitrator_name,t.name,t.application_organ_id,t.applicantName,
|
|
70
|
|
- t.arbitrator_id,t.identity_num , t.identity_type,t.filearbitra_url,t.lock_status,t.version,t.updateSubmitStatus
|
|
|
70
|
+ t.arbitrator_id,t.identity_num ,
|
|
|
71
|
+ t.identity_type,t.filearbitra_url,t.lock_status,t.version,t.updateSubmitStatus
|
|
71
|
72
|
from(
|
|
72
|
73
|
select c.id ,'' AS caseLogId,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
|
|
73
|
74
|
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
|
|
|
@@ -85,9 +86,12 @@
|
|
85
|
86
|
END caseStatusName,
|
|
86
|
87
|
c.hear_date ,c.arbitrat_claims ,
|
|
87
|
88
|
c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag
|
|
88
|
|
- ,c.fee_payable ,c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time,
|
|
89
|
|
- c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name as applicantName,
|
|
90
|
|
- c.arbitrator_id,ca.identity_num ,ca.identity_type,c.filearbitra_url,c.lock_status,c.version,null as updateSubmitStatus
|
|
|
89
|
+ ,c.fee_payable ,c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by
|
|
|
90
|
+ ,c.create_time,
|
|
|
91
|
+ c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name
|
|
|
92
|
+ as applicantName,
|
|
|
93
|
+ c.arbitrator_id,ca.identity_num ,ca.identity_type,c.filearbitra_url,c.lock_status,c.version,null as
|
|
|
94
|
+ updateSubmitStatus
|
|
91
|
95
|
from case_application c
|
|
92
|
96
|
JOIN case_affiliate ca ON ca.case_appli_id = c.id
|
|
93
|
97
|
<!--查询条件-->
|
|
|
@@ -121,7 +125,7 @@
|
|
121
|
125
|
<!--仲裁员-->
|
|
122
|
126
|
<if test="userId != null and userId != ''">
|
|
123
|
127
|
or ( t.identity_type=1 and
|
|
124
|
|
- t.case_status in (7,8,9,12,13,17)
|
|
|
128
|
+ t.case_status in (7,8,9,11,13,17)
|
|
125
|
129
|
and
|
|
126
|
130
|
instr (t.arbitrator_id,#{userId})>0)
|
|
127
|
131
|
</if>
|
|
|
@@ -183,7 +187,10 @@
|
|
183
|
187
|
c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name
|
|
184
|
188
|
as
|
|
185
|
189
|
applicantName,
|
|
186
|
|
- c.arbitrator_id,ca.identity_num , ca.identity_type,c.filearbitra_url,c.lock_status,(select version from case_application_log where case_appli_id=c.id order by version desc limit 1) as version,(select update_submit_status from case_application_log where case_appli_id=c.id order by version desc limit 1) as updateSubmitStatus
|
|
|
190
|
+ c.arbitrator_id,ca.identity_num , ca.identity_type,c.filearbitra_url,c.lock_status,(select version from
|
|
|
191
|
+ case_application_log where case_appli_id=c.id order by version desc limit 1) as version,(select
|
|
|
192
|
+ update_submit_status from case_application_log where case_appli_id=c.id order by version desc limit 1)
|
|
|
193
|
+ as updateSubmitStatus
|
|
187
|
194
|
from case_application c
|
|
188
|
195
|
JOIN case_application_log l ON c.id = l.case_appli_id and c.version=l.version
|
|
189
|
196
|
JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id AND ca.identity_type = 1
|
|
|
@@ -214,6 +221,7 @@
|
|
214
|
221
|
<if test="deptIds != null and deptIds.size() > 0">
|
|
215
|
222
|
|
|
216
|
223
|
<!--秘书主表案件-->
|
|
|
224
|
+ select tt.* from(
|
|
217
|
225
|
SELECT
|
|
218
|
226
|
c.id,
|
|
219
|
227
|
'' AS caseLogId,
|
|
|
@@ -296,40 +304,48 @@
|
|
296
|
304
|
FROM
|
|
297
|
305
|
case_application c
|
|
298
|
306
|
JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type = 1
|
|
299
|
|
- JOIN case_application_log l on l.case_appli_id=c.id and l.update_submit_status not in(1, 2) and l.version
|
|
|
307
|
+ JOIN case_application_log l on l.case_appli_id=c.id and l.update_submit_status not in(1, 2) and
|
|
|
308
|
+ l.version
|
|
300
|
309
|
= (
|
|
301
|
310
|
SELECT
|
|
302
|
311
|
max( version ) version
|
|
303
|
312
|
FROM
|
|
304
|
313
|
case_application_log
|
|
305
|
314
|
WHERE case_appli_id = c.id
|
|
306
|
|
- )
|
|
|
315
|
+ )
|
|
307
|
316
|
WHERE
|
|
308
|
|
- ca.identity_type=1 and c.case_status in (1,5,11,14,15,16,17,31)
|
|
309
|
|
- <if test="caseStatusList != null and caseStatusList.size() > 0">
|
|
310
|
|
- and c.case_status in
|
|
311
|
|
- <foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
|
|
312
|
|
- #{caseStatus}
|
|
313
|
|
- </foreach>
|
|
314
|
|
- </if>
|
|
|
317
|
+ ca.identity_type=1
|
|
|
318
|
+
|
|
|
319
|
+ and c.case_status in (1,5,14,15,16,17,31)
|
|
|
320
|
+
|
|
315
|
321
|
<if test="deptIds != null and deptIds.size() > 0">
|
|
316
|
322
|
and ca.application_organ_id in
|
|
317
|
323
|
<foreach item="item" collection="deptIds" open="(" separator="," close=")">
|
|
318
|
324
|
#{item}
|
|
319
|
325
|
</foreach>
|
|
320
|
326
|
</if>
|
|
321
|
|
- <if test="caseStatus != null">
|
|
322
|
|
- AND c.case_status = #{caseStatus}
|
|
323
|
|
- </if>
|
|
324
|
327
|
<if test="lockStatus != null">
|
|
325
|
328
|
AND c.lock_status = #{lockStatus}
|
|
326
|
329
|
</if>
|
|
|
330
|
+
|
|
327
|
331
|
<if test="caseNum != null and caseNum != ''">
|
|
328
|
332
|
AND c.case_num = #{caseNum}
|
|
329
|
333
|
</if>
|
|
330
|
334
|
<if test="nameId != null and nameId != ''">
|
|
331
|
335
|
AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
|
|
332
|
|
- </if>
|
|
|
336
|
+ </if>) tt
|
|
|
337
|
+ <where>
|
|
|
338
|
+ <if test="caseStatusList != null and caseStatusList.size() > 0">
|
|
|
339
|
+ and tt.case_status in
|
|
|
340
|
+ <foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
|
|
|
341
|
+ #{caseStatus}
|
|
|
342
|
+ </foreach>
|
|
|
343
|
+ </if>
|
|
|
344
|
+ <if test="caseStatus != null">
|
|
|
345
|
+ AND tt.case_status = #{caseStatus}
|
|
|
346
|
+ </if>
|
|
|
347
|
+
|
|
|
348
|
+ </where>
|
|
333
|
349
|
union
|
|
334
|
350
|
<!--秘书审核案件-->
|
|
335
|
351
|
SELECT
|
|
|
@@ -415,7 +431,13 @@
|
|
415
|
431
|
JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id
|
|
416
|
432
|
AND ca.identity_type = 1
|
|
417
|
433
|
WHERE
|
|
418
|
|
- l.update_submit_status IN ( 1, 2 ) and ca.identity_type=1
|
|
|
434
|
+ l.update_submit_status IN ( 1, 2 ) and ca.identity_type=1 and c.case_status >10
|
|
|
435
|
+ <if test="caseStatusList != null and caseStatusList.size() > 0">
|
|
|
436
|
+ and c.case_status in
|
|
|
437
|
+ <foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
|
|
|
438
|
+ #{caseStatus}
|
|
|
439
|
+ </foreach>
|
|
|
440
|
+ </if>
|
|
419
|
441
|
<if test="deptIds != null and deptIds.size() > 0">
|
|
420
|
442
|
and ca.application_organ_id in
|
|
421
|
443
|
<foreach item="item" collection="deptIds" open="(" separator="," close=")">
|
|
|
@@ -663,7 +685,7 @@
|
|
663
|
685
|
<!--仲裁员-->
|
|
664
|
686
|
<if test="userId != null and userId != ''">
|
|
665
|
687
|
or ( t.identity_type=1 and
|
|
666
|
|
- t.case_status in (7,8,9,12,13,17)
|
|
|
688
|
+ t.case_status in (7,8,9,11,13,17)
|
|
667
|
689
|
and
|
|
668
|
690
|
instr (t.arbitrator_id,#{userId})>0)
|
|
669
|
691
|
</if>
|
|
|
@@ -755,7 +777,7 @@
|
|
755
|
777
|
WHERE case_appli_id = c.id
|
|
756
|
778
|
)
|
|
757
|
779
|
WHERE
|
|
758
|
|
- ca.identity_type=1 and c.case_status in (1,5,11,14,15,16,17,31)
|
|
|
780
|
+ ca.identity_type=1 and c.case_status in (1,5,14,15,16,17,31)
|
|
759
|
781
|
<if test="deptIds != null and deptIds.size() > 0">
|
|
760
|
782
|
and ca.application_organ_id in
|
|
761
|
783
|
<foreach item="item" collection="deptIds" open="(" separator="," close=")">
|
|
|
@@ -774,44 +796,7 @@
|
|
774
|
796
|
<if test="nameId != null and nameId != ''">
|
|
775
|
797
|
AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
|
|
776
|
798
|
</if>
|
|
777
|
|
- union
|
|
778
|
|
- <!--秘书审核案件-->
|
|
779
|
799
|
|
|
780
|
|
- select l.case_appli_id id ,
|
|
781
|
|
- c.case_status,ca.application_organ_id,
|
|
782
|
|
- c.arbitrator_id,ca.identity_num , ca.identity_type
|
|
783
|
|
- FROM
|
|
784
|
|
- case_application c
|
|
785
|
|
- JOIN case_application_log l ON c.id = l.case_appli_id
|
|
786
|
|
- JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id
|
|
787
|
|
- AND ca.identity_type = 1
|
|
788
|
|
- WHERE
|
|
789
|
|
- l.update_submit_status IN ( 1, 2 ) and ca.identity_type=1
|
|
790
|
|
- <if test="deptIds != null and deptIds.size() > 0">
|
|
791
|
|
- and ca.application_organ_id in
|
|
792
|
|
- <foreach item="item" collection="deptIds" open="(" separator="," close=")">
|
|
793
|
|
- #{item}
|
|
794
|
|
- </foreach>
|
|
795
|
|
- </if>
|
|
796
|
|
- <if test="caseStatus != null">
|
|
797
|
|
- AND c.case_status = #{caseStatus}
|
|
798
|
|
- </if>
|
|
799
|
|
- <if test="lockStatus != null">
|
|
800
|
|
- AND c.lock_status = #{lockStatus}
|
|
801
|
|
- </if>
|
|
802
|
|
- <if test="caseNum != null and caseNum != ''">
|
|
803
|
|
- AND c.case_num = #{caseNum}
|
|
804
|
|
- </if>
|
|
805
|
|
- <if test="nameId != null and nameId != ''">
|
|
806
|
|
- AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
|
|
807
|
|
- </if>
|
|
808
|
|
- AND l.version = (
|
|
809
|
|
- SELECT
|
|
810
|
|
- max( version ) version
|
|
811
|
|
- FROM
|
|
812
|
|
- case_application_log
|
|
813
|
|
- WHERE
|
|
814
|
|
- c.id = case_appli_id)
|
|
815
|
800
|
|
|
816
|
801
|
</if>
|
|
817
|
802
|
</trim>
|