|
|
@@ -58,7 +58,7 @@
|
|
58
|
58
|
t1.filearbitra_url,t1.lock_status,t1.version,t1.updateSubmitStatus
|
|
59
|
59
|
from(
|
|
60
|
60
|
<trim suffixOverrides="union">
|
|
61
|
|
- <!--被申请人,仲裁员,部门长,财务,代理人案件-->
|
|
|
61
|
+ <!--申请人,被申请人,仲裁员,部门长,财务,代理人案件-->
|
|
62
|
62
|
<if test="isOtherRole!=null and isOtherRole==1">
|
|
63
|
63
|
|
|
64
|
64
|
select t.id,t.caseLogId,t.case_num ,t.case_subject_amount ,t.register_date ,t.arbitrat_method,
|
|
|
@@ -125,7 +125,13 @@
|
|
125
|
125
|
and
|
|
126
|
126
|
instr (t.arbitrator_id,#{userId})>0)
|
|
127
|
127
|
</if>
|
|
|
128
|
+ <!--申请人-->
|
|
|
129
|
+ <if test="applicationOrganId != null and applicationOrganId != ''">
|
|
|
130
|
+ or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1
|
|
|
131
|
+ <!--暂时改为可以查询到生成裁决书之前所有的案件状态-->
|
|
|
132
|
+ and (t.case_status <= 10 or t.case_status=31))
|
|
128
|
133
|
|
|
|
134
|
+ </if>
|
|
129
|
135
|
<!--部门长-->
|
|
130
|
136
|
<if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
|
|
131
|
137
|
or (t.identity_type=1 and t.case_status in
|
|
|
@@ -152,61 +158,61 @@
|
|
152
|
158
|
</where>
|
|
153
|
159
|
union
|
|
154
|
160
|
</if>
|
|
155
|
|
- <if test="applicationOrganId != null and applicationOrganId != ''">
|
|
|
161
|
+<!-- <if test="applicationOrganId != null and applicationOrganId != ''">-->
|
|
156
|
162
|
|
|
157
|
163
|
|
|
158
|
|
- <!--申请人案件-->
|
|
159
|
|
- select c.id ,l.id AS caseLogId,c.case_num ,l.case_subject_amount ,c.register_date ,c.arbitrat_method ,
|
|
160
|
|
- CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
|
|
161
|
|
- ELSE '无审理方式'
|
|
162
|
|
- END arbitratMethodName,
|
|
163
|
|
- c.case_status ,
|
|
164
|
|
- CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
|
|
165
|
|
- when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
|
|
166
|
|
- when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
|
|
167
|
|
- when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
|
|
168
|
|
- when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
|
|
169
|
|
- when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
|
|
170
|
|
- when 31 then '待修改开庭时间'
|
|
171
|
|
- ELSE '无案件状态'
|
|
172
|
|
- END caseStatusName,
|
|
173
|
|
- c.hear_date ,l.arbitrat_claims ,
|
|
174
|
|
- l.loan_start_date ,l.loan_end_date ,l.claim_princi_owed ,l.claim_interest_owed ,l.claim_liquid_damag
|
|
175
|
|
- ,l.fee_payable ,
|
|
176
|
|
- c.begin_video_date ,c.online_video_person ,l.contract_number ,c.create_by ,c.create_time ,
|
|
177
|
|
- c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name
|
|
178
|
|
- as
|
|
179
|
|
- applicantName,
|
|
180
|
|
- c.arbitrator_id,ca.identity_num , ca.identity_type,c.filearbitra_url,c.lock_status,l.version,l.update_submit_status as updateSubmitStatus
|
|
181
|
|
- from case_application c
|
|
182
|
|
- JOIN case_application_log l ON c.id = l.case_appli_id
|
|
183
|
|
- JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id AND ca.identity_type = 1
|
|
184
|
|
-
|
|
185
|
|
- <where>
|
|
186
|
|
- (c.case_status <= 10 or c.case_status=31) AND ca.identity_type=1
|
|
187
|
|
- and l.version=(SELECT
|
|
188
|
|
- max( version ) version
|
|
189
|
|
- FROM
|
|
190
|
|
- case_application_log where case_appli_id = c.id and update_submit_status not in(4,5))
|
|
191
|
|
- <if test="applicationOrganId != null and applicationOrganId != ''">
|
|
192
|
|
- AND ca.application_organ_id = #{applicationOrganId}
|
|
193
|
|
- </if>
|
|
194
|
|
- <if test="caseStatus != null">
|
|
195
|
|
- AND c.case_status = #{caseStatus}
|
|
196
|
|
- </if>
|
|
197
|
|
- <if test="caseNum != null and caseNum != ''">
|
|
198
|
|
- AND c.case_num = #{caseNum}
|
|
199
|
|
- </if>
|
|
200
|
|
- <if test="nameId != null and nameId != ''">
|
|
201
|
|
- AND ca.application_organ_id=#{nameId}
|
|
202
|
|
- </if>
|
|
|
164
|
+<!-- <!–申请人案件–>-->
|
|
|
165
|
+<!-- select c.id ,l.id AS caseLogId,c.case_num ,l.case_subject_amount ,c.register_date ,c.arbitrat_method ,-->
|
|
|
166
|
+<!-- CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'-->
|
|
|
167
|
+<!-- ELSE '无审理方式'-->
|
|
|
168
|
+<!-- END arbitratMethodName,-->
|
|
|
169
|
+<!-- c.case_status ,-->
|
|
|
170
|
+<!-- CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'-->
|
|
|
171
|
+<!-- when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'-->
|
|
|
172
|
+<!-- when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'-->
|
|
|
173
|
+<!-- when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'-->
|
|
|
174
|
+<!-- when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'-->
|
|
|
175
|
+<!-- when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'-->
|
|
|
176
|
+<!-- when 31 then '待修改开庭时间'-->
|
|
|
177
|
+<!-- ELSE '无案件状态'-->
|
|
|
178
|
+<!-- END caseStatusName,-->
|
|
|
179
|
+<!-- c.hear_date ,l.arbitrat_claims ,-->
|
|
|
180
|
+<!-- l.loan_start_date ,l.loan_end_date ,l.claim_princi_owed ,l.claim_interest_owed ,l.claim_liquid_damag-->
|
|
|
181
|
+<!-- ,l.fee_payable ,-->
|
|
|
182
|
+<!-- c.begin_video_date ,c.online_video_person ,l.contract_number ,c.create_by ,c.create_time ,-->
|
|
|
183
|
+<!-- c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name-->
|
|
|
184
|
+<!-- as-->
|
|
|
185
|
+<!-- applicantName,-->
|
|
|
186
|
+<!-- c.arbitrator_id,ca.identity_num , ca.identity_type,c.filearbitra_url,c.lock_status,l.version,l.update_submit_status as updateSubmitStatus-->
|
|
|
187
|
+<!-- from case_application c-->
|
|
|
188
|
+<!-- JOIN case_application_log l ON c.id = l.case_appli_id-->
|
|
|
189
|
+<!-- JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id AND ca.identity_type = 1-->
|
|
|
190
|
+
|
|
|
191
|
+<!-- <where>-->
|
|
|
192
|
+<!-- (c.case_status <= 10 or c.case_status=31) AND ca.identity_type=1-->
|
|
|
193
|
+<!-- and l.version=(SELECT-->
|
|
|
194
|
+<!-- max( version ) version-->
|
|
|
195
|
+<!-- FROM-->
|
|
|
196
|
+<!-- case_application_log where case_appli_id = c.id and update_submit_status not in(4,5))-->
|
|
|
197
|
+<!-- <if test="applicationOrganId != null and applicationOrganId != ''">-->
|
|
|
198
|
+<!-- AND ca.application_organ_id = #{applicationOrganId}-->
|
|
|
199
|
+<!-- </if>-->
|
|
|
200
|
+<!-- <if test="caseStatus != null">-->
|
|
|
201
|
+<!-- AND c.case_status = #{caseStatus}-->
|
|
|
202
|
+<!-- </if>-->
|
|
|
203
|
+<!-- <if test="caseNum != null and caseNum != ''">-->
|
|
|
204
|
+<!-- AND c.case_num = #{caseNum}-->
|
|
|
205
|
+<!-- </if>-->
|
|
|
206
|
+<!-- <if test="nameId != null and nameId != ''">-->
|
|
|
207
|
+<!-- AND ca.application_organ_id=#{nameId}-->
|
|
|
208
|
+<!-- </if>-->
|
|
203
|
209
|
|
|
204
|
|
- <if test="lockStatus != null">
|
|
205
|
|
- AND c.lock_status = #{lockStatus}
|
|
206
|
|
- </if>
|
|
207
|
|
- </where>
|
|
208
|
|
- union
|
|
209
|
|
- </if>
|
|
|
210
|
+<!-- <if test="lockStatus != null">-->
|
|
|
211
|
+<!-- AND c.lock_status = #{lockStatus}-->
|
|
|
212
|
+<!-- </if>-->
|
|
|
213
|
+<!-- </where>-->
|
|
|
214
|
+<!-- union-->
|
|
|
215
|
+<!-- </if>-->
|
|
210
|
216
|
<!--秘书案件-->
|
|
211
|
217
|
<if test="deptIds != null and deptIds.size() > 0">
|
|
212
|
218
|
|
|
|
@@ -300,9 +306,15 @@
|
|
300
|
306
|
FROM
|
|
301
|
307
|
case_application_log
|
|
302
|
308
|
WHERE case_appli_id = c.id
|
|
303
|
|
- and update_submit_status not IN ( 1, 2 ))
|
|
|
309
|
+ )
|
|
304
|
310
|
WHERE
|
|
305
|
311
|
ca.identity_type=1 and c.case_status in (1,5,11,15,16,17,31)
|
|
|
312
|
+ <if test="caseStatusList != null and caseStatusList.size() > 0">
|
|
|
313
|
+ and c.case_status in
|
|
|
314
|
+ <foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
|
|
|
315
|
+ #{caseStatus}
|
|
|
316
|
+ </foreach>
|
|
|
317
|
+ </if>
|
|
306
|
318
|
<if test="deptIds != null and deptIds.size() > 0">
|
|
307
|
319
|
and ca.application_organ_id in
|
|
308
|
320
|
<foreach item="item" collection="deptIds" open="(" separator="," close=")">
|
|
|
@@ -435,7 +447,7 @@
|
|
435
|
447
|
FROM
|
|
436
|
448
|
case_application_log
|
|
437
|
449
|
WHERE
|
|
438
|
|
- update_submit_status IN ( 1, 2 ) and c.id = l.case_appli_id)
|
|
|
450
|
+ update_submit_status IN ( 1, 2 ) and c.id = case_appli_id)
|
|
439
|
451
|
</if>
|
|
440
|
452
|
</trim>
|
|
441
|
453
|
) t1
|
|
|
@@ -667,13 +679,13 @@
|
|
667
|
679
|
<!-- </foreach> )-->
|
|
668
|
680
|
<!-- </if>-->
|
|
669
|
681
|
<!--申请人-->
|
|
670
|
|
-<!-- <if test="applicationOrganId != null and applicationOrganId != ''">-->
|
|
671
|
|
-<!-- or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1-->
|
|
672
|
|
-<!-- <!–暂时改为可以查询到生成裁决书之前所有的案件状态–>-->
|
|
673
|
|
-<!-- and (t.case_status <= 10 or t.case_status=31))-->
|
|
674
|
|
-<!-- <!– and t.case_status in (0,2,17))–>-->
|
|
|
682
|
+ <if test="applicationOrganId != null and applicationOrganId != ''">
|
|
|
683
|
+ or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1
|
|
|
684
|
+ <!--暂时改为可以查询到生成裁决书之前所有的案件状态-->
|
|
|
685
|
+ and (t.case_status <= 10 or t.case_status=31))
|
|
|
686
|
+ <!-- and t.case_status in (0,2,17))-->
|
|
675
|
687
|
|
|
676
|
|
-<!-- </if>-->
|
|
|
688
|
+ </if>
|
|
677
|
689
|
<!--部门长-->
|
|
678
|
690
|
<if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
|
|
679
|
691
|
or (t.identity_type=1 and t.case_status in
|
|
|
@@ -699,40 +711,40 @@
|
|
699
|
711
|
</where>
|
|
700
|
712
|
union
|
|
701
|
713
|
</if>
|
|
702
|
|
- <if test="applicationOrganId != null and applicationOrganId != ''">
|
|
703
|
|
- <!--申请人案件-->
|
|
704
|
|
-
|
|
705
|
|
- select l.case_appli_id id ,
|
|
706
|
|
- c.case_status,ca.application_organ_id,
|
|
707
|
|
- c.arbitrator_id,ca.identity_num , ca.identity_type
|
|
708
|
|
- from case_application c
|
|
709
|
|
- JOIN case_application_log l ON c.id = l.case_appli_id
|
|
710
|
|
- JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id AND ca.identity_type = 1
|
|
711
|
|
- <where>
|
|
712
|
|
- (c.case_status <= 10 or c.case_status=31) AND ca.identity_type=1
|
|
713
|
|
- and l.version=(SELECT
|
|
714
|
|
- max( version ) version
|
|
715
|
|
- FROM
|
|
716
|
|
- case_application_log where case_appli_id = c.id and update_submit_status not in(4,5))
|
|
717
|
|
- <if test="applicationOrganId != null and applicationOrganId != ''">
|
|
718
|
|
- AND ca.application_organ_id = #{applicationOrganId}
|
|
719
|
|
- </if>
|
|
720
|
|
- <if test="caseStatus != null">
|
|
721
|
|
- AND c.case_status = #{caseStatus}
|
|
722
|
|
- </if>
|
|
723
|
|
- <if test="caseNum != null and caseNum != ''">
|
|
724
|
|
- AND c.case_num = #{caseNum}
|
|
725
|
|
- </if>
|
|
726
|
|
- <if test="nameId != null and nameId != ''">
|
|
727
|
|
- AND ca.application_organ_id=#{nameId}
|
|
728
|
|
- </if>
|
|
|
714
|
+<!-- <if test="applicationOrganId != null and applicationOrganId != ''">-->
|
|
|
715
|
+<!-- <!–申请人案件–>-->
|
|
|
716
|
+
|
|
|
717
|
+<!-- select l.case_appli_id id ,-->
|
|
|
718
|
+<!-- c.case_status,ca.application_organ_id,-->
|
|
|
719
|
+<!-- c.arbitrator_id,ca.identity_num , ca.identity_type-->
|
|
|
720
|
+<!-- from case_application c-->
|
|
|
721
|
+<!-- JOIN case_application_log l ON c.id = l.case_appli_id-->
|
|
|
722
|
+<!-- JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id AND ca.identity_type = 1-->
|
|
|
723
|
+<!-- <where>-->
|
|
|
724
|
+<!-- (c.case_status <= 10 or c.case_status=31) AND ca.identity_type=1-->
|
|
|
725
|
+<!-- and l.version=(SELECT-->
|
|
|
726
|
+<!-- max( version ) version-->
|
|
|
727
|
+<!-- FROM-->
|
|
|
728
|
+<!-- case_application_log where case_appli_id = c.id and update_submit_status not in(4,5))-->
|
|
|
729
|
+<!-- <if test="applicationOrganId != null and applicationOrganId != ''">-->
|
|
|
730
|
+<!-- AND ca.application_organ_id = #{applicationOrganId}-->
|
|
|
731
|
+<!-- </if>-->
|
|
|
732
|
+<!-- <if test="caseStatus != null">-->
|
|
|
733
|
+<!-- AND c.case_status = #{caseStatus}-->
|
|
|
734
|
+<!-- </if>-->
|
|
|
735
|
+<!-- <if test="caseNum != null and caseNum != ''">-->
|
|
|
736
|
+<!-- AND c.case_num = #{caseNum}-->
|
|
|
737
|
+<!-- </if>-->
|
|
|
738
|
+<!-- <if test="nameId != null and nameId != ''">-->
|
|
|
739
|
+<!-- AND ca.application_organ_id=#{nameId}-->
|
|
|
740
|
+<!-- </if>-->
|
|
729
|
741
|
|
|
730
|
|
- <if test="lockStatus != null">
|
|
731
|
|
- AND c.lock_status = #{lockStatus}
|
|
732
|
|
- </if>
|
|
733
|
|
- </where>
|
|
734
|
|
- union
|
|
735
|
|
- </if>
|
|
|
742
|
+<!-- <if test="lockStatus != null">-->
|
|
|
743
|
+<!-- AND c.lock_status = #{lockStatus}-->
|
|
|
744
|
+<!-- </if>-->
|
|
|
745
|
+<!-- </where>-->
|
|
|
746
|
+<!-- union-->
|
|
|
747
|
+<!-- </if>-->
|
|
736
|
748
|
<!--秘书案件-->
|
|
737
|
749
|
<if test="deptIds != null and deptIds.size() > 0">
|
|
738
|
750
|
|
|
|
@@ -742,14 +754,14 @@
|
|
742
|
754
|
FROM
|
|
743
|
755
|
case_application c
|
|
744
|
756
|
JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type = 1
|
|
745
|
|
- JOIN case_application_log l on l.case_appli_id=c.id and l.update_submit_status not in(1,4) and l.version
|
|
|
757
|
+ JOIN case_application_log l on l.case_appli_id=c.id and l.update_submit_status not in(1,2) and l.version
|
|
746
|
758
|
= (
|
|
747
|
759
|
SELECT
|
|
748
|
760
|
max( version ) version
|
|
749
|
761
|
FROM
|
|
750
|
762
|
case_application_log
|
|
751
|
763
|
WHERE case_appli_id = c.id
|
|
752
|
|
- and update_submit_status not IN ( 1, 4 ))
|
|
|
764
|
+ )
|
|
753
|
765
|
WHERE
|
|
754
|
766
|
ca.identity_type=1 and c.case_status in (1,5,11,15,16,17,31)
|
|
755
|
767
|
<if test="deptIds != null and deptIds.size() > 0">
|
|
|
@@ -807,7 +819,7 @@
|
|
807
|
819
|
FROM
|
|
808
|
820
|
case_application_log
|
|
809
|
821
|
WHERE
|
|
810
|
|
- update_submit_status IN ( 1, 4 ) and c.id = l.case_appli_id)
|
|
|
822
|
+ update_submit_status IN ( 1, 4 ) and c.id = case_appli_id)
|
|
811
|
823
|
|
|
812
|
824
|
</if>
|
|
813
|
825
|
</trim>
|