智能仲裁后端服务

CaseApplicationMapper.xml 72KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper">
  6. <resultMap type="com.ruoyi.wisdomarbitrate.domain.CaseApplication" id="CaseApplicationResult">
  7. <id property="id" column="id"/>
  8. <result property="caseNum" column="case_num"/>
  9. <result property="caseName" column="case_name"/>
  10. <result property="caseSubjectAmount" column="case_subject_amount"/>
  11. <result property="registerDate" column="register_date"/>
  12. <result property="arbitratMethod" column="arbitrat_method"/>
  13. <result property="caseStatus" column="case_status"/>
  14. <result property="hearDate" column="hear_date"/>
  15. <result property="arbitratClaims" column="arbitrat_claims"/>
  16. <result property="loanStartDate" column="loan_start_date"/>
  17. <result property="loanEndDate" column="loan_end_date"/>
  18. <result property="claimPrinciOwed" column="claim_princi_owed"/>
  19. <result property="claimInterestOwed" column="claim_interest_owed"/>
  20. <result property="claimLiquidDamag" column="claim_liquid_damag"/>
  21. <result property="feePayable" column="fee_payable"/>
  22. <result property="beginVideoDate" column="begin_video_date"/>
  23. <result property="onlineVideoPerson" column="online_video_person"/>
  24. <result property="contractNumber" column="contract_number"/>
  25. <result property="caseStatusName" column="caseStatusName"/>
  26. <result property="createBy" column="create_by"/>
  27. <result property="createTime" column="create_time"/>
  28. <result property="updateBy" column="update_by"/>
  29. <result property="updateTime" column="update_time"/>
  30. <result property="arbitratMethodName" column="arbitratMethodName"/>
  31. <result property="applicantIsWrittenHear" column="appli_iswrit_hear"/>
  32. <result property="respondentIsWrittenHear" column="respon_isWrit_hear"/>
  33. <result property="isAbsence" column="is_absence"/>
  34. <result property="responCrossOpin" column="respon_cross_opin"/>
  35. <result property="applicaCrossOpin" column="applica_cross_opin"/>
  36. <result property="responDefenOpini" column="respon_defen_opini"/>
  37. <result property="arbitratorId" column="arbitrator_id"/>
  38. <result property="arbitratorName" column="arbitrator_name"/>
  39. <result property="paymentStatus" column="payment_status"/>
  40. <result property="paymentStatusName" column="paymentStatusName"/>
  41. <result property="filearbitraUrl" column="filearbitra_url"/>
  42. <result property="requestRule" column="request_rule"/>
  43. <result property="properPreser" column="proper_preser"/>
  44. <result property="adjudicaCounter" column="adjudica_counter"/>
  45. <result property="lockStatus" column="lock_status"/>
  46. <result property="facts" column="facts"/>
  47. <result property="batchNumber" column="batch_number"/>
  48. <result property="mediationAgreement" column="mediation_agreement"/>
  49. <result property="identityType" column="identity_type"/>
  50. <result property="name" column="name"/>
  51. </resultMap>
  52. <select id="selectCaseApplicationList" parameterType="com.ruoyi.wisdomarbitrate.domain.CaseApplication" resultMap="CaseApplicationResult">
  53. select DISTINCT(t1.id),t1.caseLogId,t1.case_num,t1.case_subject_amount,t1.register_date,t1.arbitrat_method,
  54. t1.arbitratMethodName,t1.case_status,t1.caseStatusName,t1.hear_date,t1.arbitrat_claims,
  55. t1.loan_start_date,t1.loan_end_date,t1.claim_princi_owed,t1.claim_interest_owed,t1.claim_liquid_damag,t1.fee_payable,
  56. t1.begin_video_date,t1.online_video_person,t1.contract_number,t1.create_by,t1.create_time,t1.appli_iswrit_hear,t1.respon_isWrit_hear,t1.update_by,t1.update_time,
  57. t1.arbitrator_name,t1.name,t1.application_organ_id,t1.applicantName,t1.arbitrator_id,t1.identity_num,t1.identity_type,
  58. t1.filearbitra_url,t1.lock_status,t1.version,t1.updateSubmitStatus,t1.batch_number,t1.pendingStatus
  59. from(
  60. <trim suffixOverrides="union">
  61. <!--被申请人,仲裁员,部门长,财务,代理人案件-->
  62. <if test="isOtherRole!=null and isOtherRole==1">
  63. select c.id ,'' AS caseLogId,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
  64. CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
  65. ELSE '无审理方式'
  66. END arbitratMethodName,
  67. c.case_status ,
  68. CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
  69. when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
  70. when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
  71. when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书'
  72. when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印'
  73. when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档'
  74. when 18 then '待仲裁员审核裁决书'
  75. when 31 then '待修改开庭时间'
  76. ELSE '无案件状态'
  77. END caseStatusName,
  78. c.hear_date ,c.arbitrat_claims ,
  79. c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag
  80. ,c.fee_payable ,c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by
  81. ,c.create_time,c.appli_iswrit_hear,c.respon_isWrit_hear,
  82. c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name
  83. as applicantName,
  84. c.arbitrator_id,ca.identity_num ,ca.identity_type,c.filearbitra_url,c.lock_status,c.version,null as
  85. updateSubmitStatus,c.batch_number,0 as pendingStatus
  86. from case_application c
  87. JOIN case_affiliate ca ON ca.case_appli_id = c.id
  88. <where>
  89. <!--根据角色和状态过滤-->
  90. <!--被申请人-->
  91. <if test="idCard != null and idCard != ''">
  92. or (ca.identity_num=#{idCard} AND ca.identity_type=2
  93. and (c.case_status=4 or c.case_status=17)
  94. )
  95. </if>
  96. <!--仲裁员-->
  97. <if test="userId != null and userId != ''">
  98. or ( ca.identity_type=1 and
  99. c.case_status in (7,13,17,18)
  100. and
  101. instr (c.arbitrator_id,#{userId})>0)
  102. </if>
  103. <!--部门长-->
  104. <if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
  105. or (ca.identity_type=1)
  106. </if>
  107. <!--财务-->
  108. <if test="financeStatus != null and financeStatus != ''">
  109. or (ca.identity_type=1
  110. and c.case_status =#{financeStatus}
  111. )
  112. </if>
  113. <!--代理人-->
  114. <if test="agentDeptIds != null and agentDeptIds.size()>0">
  115. or (
  116. ca.application_organ_id in
  117. <foreach item="deptId" collection="agentDeptIds" open="(" separator="," close=")">#{deptId}
  118. </foreach>
  119. AND ca.identity_type=1
  120. and c.case_status in (0,9)
  121. )
  122. </if>
  123. </where>
  124. union
  125. </if>
  126. <if test="applicationOrganId != null and applicationOrganId != ''">
  127. <!--申请人案件-->
  128. select c.id ,'' AS caseLogId,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
  129. CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
  130. ELSE '无审理方式'
  131. END arbitratMethodName,
  132. c.case_status ,
  133. CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
  134. when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
  135. when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
  136. when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书'
  137. when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印'
  138. when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档'
  139. when 18 then '待仲裁员审核裁决书'
  140. when 31 then '待修改开庭时间'
  141. ELSE '无案件状态'
  142. END caseStatusName,
  143. c.hear_date ,c.arbitrat_claims ,
  144. c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag
  145. ,c.fee_payable ,
  146. c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,c.appli_iswrit_hear,c.respon_isWrit_hear,
  147. c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name
  148. as
  149. applicantName,
  150. c.arbitrator_id,ca.identity_num , ca.identity_type,c.filearbitra_url,c.lock_status,(select version from
  151. case_application_log where case_appli_id=c.id order by version desc limit 1) as version,(select
  152. update_submit_status from case_application_log where case_appli_id=c.id order by version desc limit 1)
  153. as updateSubmitStatus,c.batch_number,0 as pendingStatus
  154. from case_application c
  155. JOIN case_affiliate ca ON ca.case_appli_id =c.id AND ca.identity_type = 1
  156. <where>
  157. (c.case_status &lt;= 10 or c.case_status=31) AND
  158. ca.identity_type=1
  159. <if test="applicationOrganId != null and applicationOrganId != ''">
  160. AND ca.application_organ_id = #{applicationOrganId}
  161. </if>
  162. </where>
  163. union
  164. </if>
  165. <!--秘书案件-->
  166. <if test="deptIds != null and deptIds.size() > 0">
  167. <!--秘书主表案件-->
  168. SELECT
  169. c.id,
  170. '' AS caseLogId,
  171. c.case_num,
  172. c.case_subject_amount,
  173. c.register_date,
  174. c.arbitrat_method,
  175. CASE
  176. c.arbitrat_method
  177. WHEN 1 THEN
  178. '开庭审理'
  179. WHEN 2 THEN
  180. '书面审理' ELSE '无审理方式'
  181. END arbitratMethodName,
  182. c.case_status,
  183. CASE
  184. c.case_status
  185. when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
  186. when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
  187. when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
  188. when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书'
  189. when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印'
  190. when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档'
  191. when 18 then '待仲裁员审核裁决书'
  192. when 31 then '待修改开庭时间' ELSE '无案件状态'
  193. END caseStatusName,
  194. c.hear_date,
  195. c.arbitrat_claims,
  196. c.loan_start_date,
  197. c.loan_end_date,
  198. c.claim_princi_owed,
  199. c.claim_interest_owed,
  200. c.claim_liquid_damag,
  201. c.fee_payable,
  202. c.begin_video_date,
  203. c.online_video_person,
  204. c.contract_number,
  205. c.create_by,
  206. c.create_time,c.appli_iswrit_hear,c.respon_isWrit_hear,
  207. c.update_by,
  208. c.update_time,
  209. c.arbitrator_name,
  210. ca.name,
  211. ca.application_organ_id ,
  212. ca.application_organ_name AS applicantName,
  213. c.arbitrator_id,ca.identity_num ,ca.identity_type,
  214. c.filearbitra_url,
  215. c.lock_status,c.version,
  216. null as updateSubmitStatus,
  217. c.batch_number,0 as pendingStatus
  218. FROM
  219. case_application c
  220. JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type = 1
  221. JOIN case_application_log l on l.case_appli_id=c.id and l.update_submit_status not in(1, 2) and
  222. l.version
  223. = (
  224. SELECT
  225. max( version ) version
  226. FROM
  227. case_application_log
  228. WHERE case_appli_id = c.id
  229. )
  230. WHERE
  231. ca.identity_type=1
  232. and c.case_status in (1,5,8,9,11,14,15,16,17,31)
  233. union
  234. <!--秘书审核案件-->
  235. SELECT
  236. l.case_appli_id id,
  237. l.id AS caseLogId,
  238. c.case_num,
  239. c.case_subject_amount,
  240. c.register_date,
  241. c.arbitrat_method,
  242. CASE
  243. c.arbitrat_method
  244. WHEN 1 THEN
  245. '开庭审理'
  246. WHEN 2 THEN
  247. '书面审理' ELSE '无审理方式'
  248. END arbitratMethodName,
  249. c.case_status,
  250. CASE
  251. c.case_status
  252. when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
  253. when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
  254. when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
  255. when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书'
  256. when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印'
  257. when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档'
  258. when 18 then '待仲裁员审核裁决书'
  259. when 31 then '待修改开庭时间' ELSE '无案件状态'
  260. END caseStatusName,
  261. c.hear_date,
  262. c.arbitrat_claims,
  263. c.loan_start_date,
  264. c.loan_end_date,
  265. c.claim_princi_owed,
  266. c.claim_interest_owed,
  267. c.claim_liquid_damag,
  268. c.fee_payable,
  269. c.begin_video_date,
  270. c.online_video_person,
  271. c.contract_number,
  272. c.create_by,
  273. c.create_time,c.appli_iswrit_hear,c.respon_isWrit_hear,
  274. c.update_by,
  275. c.update_time,
  276. c.arbitrator_name,
  277. ca.name,
  278. ca.application_organ_id ,
  279. ca.application_organ_name AS applicantName,
  280. c.arbitrator_id,ca.identity_num ,ca.identity_type,
  281. c.filearbitra_url,c.lock_status,l.version,l.update_submit_status as updateSubmitStatus,c.batch_number,0 as pendingStatus
  282. FROM
  283. case_application c
  284. JOIN case_application_log l ON c.id = l.case_appli_id
  285. JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id
  286. AND ca.identity_type = 1
  287. WHERE
  288. l.update_submit_status IN ( 1, 2 ) and ca.identity_type=1
  289. <!-- 查询该案件的最新记录 -->
  290. AND l.version = (
  291. SELECT
  292. max( version ) version
  293. FROM
  294. case_application_log
  295. WHERE
  296. c.id = case_appli_id)
  297. union
  298. </if>
  299. <!-- 已办案件 -->
  300. <if test="loginUserName != null and loginUserName != ''">
  301. SELECT
  302. c.id,
  303. '' AS caseLogId,
  304. c.case_num,
  305. c.case_subject_amount,
  306. c.register_date,
  307. c.arbitrat_method,
  308. CASE
  309. c.arbitrat_method
  310. WHEN 1 THEN
  311. '开庭审理'
  312. WHEN 2 THEN
  313. '书面审理' ELSE '无审理方式'
  314. END arbitratMethodName,
  315. c.case_status,
  316. CASE
  317. c.case_status
  318. when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
  319. when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
  320. when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
  321. when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书'
  322. when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印'
  323. when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档'
  324. when 18 then '待仲裁员审核裁决书'
  325. when 31 then '待修改开庭时间' ELSE '无案件状态'
  326. END caseStatusName,
  327. c.hear_date,
  328. c.arbitrat_claims,
  329. c.loan_start_date,
  330. c.loan_end_date,
  331. c.claim_princi_owed,
  332. c.claim_interest_owed,
  333. c.claim_liquid_damag,
  334. c.fee_payable,
  335. c.begin_video_date,
  336. c.online_video_person,
  337. c.contract_number,
  338. c.create_by,
  339. c.create_time,c.appli_iswrit_hear,c.respon_isWrit_hear,
  340. c.update_by,
  341. c.update_time,
  342. c.arbitrator_name,
  343. ca.name,
  344. ca.application_organ_id ,
  345. ca.application_organ_name AS applicantName,
  346. c.arbitrator_id,ca.identity_num ,ca.identity_type,
  347. c.filearbitra_url,
  348. c.lock_status,c.version,
  349. null as updateSubmitStatus,
  350. c.batch_number,1 as pendingStatus
  351. from case_log_record r
  352. join case_application c on r.case_appli_id=c.id and r.case_node!=c.case_status
  353. JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1
  354. WHERE
  355. r.create_by=#{loginUserName} AND ca.identity_type=1
  356. and c.id not in(
  357. <trim suffixOverrides="union">
  358. <!--被申请人,仲裁员,部门长,财务,代理人案件-->
  359. <if test="isOtherRole!=null and isOtherRole==1">
  360. select c.id
  361. from case_application c
  362. JOIN case_affiliate ca ON ca.case_appli_id = c.id
  363. <where>
  364. <!--根据角色和状态过滤-->
  365. <!--被申请人-->
  366. <if test="idCard != null and idCard != ''">
  367. or (ca.identity_num=#{idCard} AND ca.identity_type=2
  368. and (c.case_status=4 or c.case_status=17)
  369. )
  370. </if>
  371. <!--仲裁员-->
  372. <if test="userId != null and userId != ''">
  373. or ( ca.identity_type=1 and
  374. c.case_status in (7,13,17,18)
  375. and
  376. instr (c.arbitrator_id,#{userId})>0)
  377. </if>
  378. <!--部门长-->
  379. <if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
  380. or (ca.identity_type=1)
  381. </if>
  382. <!--财务-->
  383. <if test="financeStatus != null and financeStatus != ''">
  384. or (ca.identity_type=1
  385. and c.case_status =#{financeStatus}
  386. )
  387. </if>
  388. <!--代理人-->
  389. <if test="agentDeptIds != null and agentDeptIds.size()>0">
  390. or (
  391. ca.application_organ_id in
  392. <foreach item="deptId" collection="agentDeptIds" open="(" separator="," close=")">#{deptId}
  393. </foreach>
  394. AND ca.identity_type=1
  395. and c.case_status in (0,9)
  396. )
  397. </if>
  398. </where>
  399. union
  400. </if>
  401. <if test="applicationOrganId != null and applicationOrganId != ''">
  402. <!--申请人案件-->
  403. select c.id
  404. from case_application c
  405. JOIN case_affiliate ca ON ca.case_appli_id =c.id AND ca.identity_type = 1
  406. <where>
  407. (c.case_status &lt;= 10 or c.case_status=31) AND
  408. ca.identity_type=1
  409. <if test="applicationOrganId != null and applicationOrganId != ''">
  410. AND ca.application_organ_id = #{applicationOrganId}
  411. </if>
  412. </where>
  413. union
  414. </if>
  415. <!--秘书案件-->
  416. <if test="deptIds != null and deptIds.size() > 0">
  417. <!--秘书主表案件-->
  418. SELECT
  419. c.id
  420. FROM
  421. case_application c
  422. JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type = 1
  423. JOIN case_application_log l on l.case_appli_id=c.id and l.update_submit_status not in(1, 2) and
  424. l.version
  425. = (
  426. SELECT
  427. max( version ) version
  428. FROM
  429. case_application_log
  430. WHERE case_appli_id = c.id
  431. )
  432. WHERE
  433. ca.identity_type=1
  434. and c.case_status in (1,5,8,9,11,14,15,16,17,31)
  435. union
  436. <!--秘书审核案件-->
  437. SELECT
  438. l.case_appli_id id
  439. FROM
  440. case_application c
  441. JOIN case_application_log l ON c.id = l.case_appli_id
  442. JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id
  443. AND ca.identity_type = 1
  444. WHERE
  445. l.update_submit_status IN ( 1, 2 ) and ca.identity_type=1
  446. <!-- 查询该案件的最新记录 -->
  447. AND l.version = (
  448. SELECT
  449. max( version ) version
  450. FROM
  451. case_application_log
  452. WHERE
  453. c.id = case_appli_id)
  454. </if>
  455. </trim>
  456. )
  457. </if>
  458. </trim>
  459. ) t1
  460. <where>
  461. <if test="caseStatus != null">
  462. AND t1.case_status = #{caseStatus}
  463. </if>
  464. <if test="lockStatus != null">
  465. AND t1.lock_status = #{lockStatus}
  466. </if>
  467. <if test="caseNum != null and caseNum != ''">
  468. AND t1.case_num = #{caseNum}
  469. </if>
  470. <if test="batchNumber != null">
  471. AND t1.batch_number = #{batchNumber}
  472. </if>
  473. <if test="nameId != null and nameId != ''">
  474. AND t1.application_organ_id=#{nameId} AND t1.identity_type=1
  475. </if>
  476. </where>
  477. order by t1.pendingStatus asc,t1.case_num desc
  478. </select>
  479. <select id="selectHandledCase" resultMap="CaseApplicationResult">
  480. select DISTINCT(c.id) id,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
  481. CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
  482. ELSE '无审理方式'
  483. END arbitratMethodName,
  484. c.case_status ,
  485. CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
  486. when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
  487. when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
  488. when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书'
  489. when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印'
  490. when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档'
  491. when 18 then '待仲裁员审核裁决书'
  492. when 31 then '待修改开庭时间'
  493. ELSE '无案件状态'
  494. END caseStatusName,
  495. c.hear_date ,c.arbitrat_claims ,
  496. c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag
  497. ,c.fee_payable ,
  498. c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,c.lock_status,
  499. c.update_by ,c.update_time , c.arbitrator_name,ca.application_organ_id applicationOrganId
  500. ,ca.application_organ_name as applicantName,c.filearbitra_url,c.version
  501. from case_log_record r
  502. join case_application c on r.case_appli_id=c.id
  503. JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1
  504. <where>
  505. <if test="lockStatus != null">
  506. AND c.lock_status = #{lockStatus}
  507. </if>
  508. <if test="caseNum != null and caseNum != ''">
  509. AND c.case_num = #{caseNum}
  510. </if>
  511. <if test="nameId != null and nameId != ''">
  512. AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
  513. </if>
  514. <if test="loginUserName != null and loginUserName != ''">
  515. AND r.create_by=#{loginUserName} AND ca.identity_type=1
  516. </if>
  517. </where>
  518. order by c.create_time desc,c.case_num desc
  519. </select>
  520. <select id="selectTodoCountByRole" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
  521. select sum( case when t1.case_status=0 then 1 else 0 end) caseApply,
  522. sum( case when t1.case_status=1 then 1 else 0 end) caseApplyCheck,
  523. sum( case when t1.case_status=2 then 1 else 0 end) caseApplyPay,
  524. sum( case when t1.case_status=3 then 1 else 0 end) caseApplyPayCheck,
  525. sum( case when t1.case_status=4 then 1 else 0 end) caseApplyEvidence,
  526. sum( case when t1.case_status=5 then 1 else 0 end) caseApplyGroupCheck,
  527. sum( case when t1.case_status=6 then 1 else 0 end) caseApplyGroupConfirm,
  528. sum( case when t1.case_status=7 then 1 else 0 end) caseApplyArbitrateWay,
  529. sum( case when t1.case_status=8 then 1 else 0 end) caseApplyGroupOnline,
  530. sum( case when t1.case_status=9 then 1 else 0 end) caseApplyGroupOffline,
  531. sum( case when t1.case_status=10 then 1 else 0 end) caseApplyAward,
  532. sum( case when t1.case_status=11 then 1 else 0 end) caseApplyAwardCheck,
  533. sum( case when t1.case_status=12 then 1 else 0 end) caseApplyAwardConfirm,
  534. sum( case when t1.case_status=13 then 1 else 0 end) caseApplyAwardSign,
  535. sum( case when t1.case_status=14 then 1 else 0 end) caseApplyAwardSeal,
  536. sum( case when t1.case_status=15 then 1 else 0 end) caseApplyAwardSend,
  537. sum( case when t1.case_status=16 then 1 else 0 end) caseApplyStored,
  538. sum( case when t1.case_status=17 then 1 else 0 end) caseApplyArchived,
  539. sum( case when t1.case_status=18 then 1 else 0 end) arbitratorApplyAwardConfirm,
  540. sum( case when t1.case_status=31 then 1 else 0 end) updateOnlineHearDate
  541. from(
  542. select c.id,c.case_status
  543. from case_application c
  544. JOIN case_affiliate ca ON ca.case_appli_id = c.id
  545. <include refid="SELECT_LIST_QUERY"/>
  546. ) t1
  547. </select>
  548. <select id="selectAdminCaseApplicationList" parameterType="com.ruoyi.wisdomarbitrate.domain.CaseApplication" resultMap="CaseApplicationResult">
  549. select DISTINCT(c.id) id,0 as pendingStatus,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
  550. CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
  551. ELSE '无审理方式'
  552. END arbitratMethodName,
  553. c.case_status ,
  554. CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
  555. when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
  556. when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
  557. when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书'
  558. when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印'
  559. when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档'
  560. when 18 then '待仲裁员审核裁决书'
  561. when 31 then '待修改开庭时间'
  562. ELSE '无案件状态'
  563. END caseStatusName,
  564. c.hear_date ,c.arbitrat_claims ,
  565. c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag
  566. ,c.fee_payable ,
  567. c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,c.appli_iswrit_hear,c.respon_isWrit_hear,c.lock_status,
  568. c.update_by ,c.update_time , c.arbitrator_name,ca.application_organ_id applicationOrganId
  569. ,ca.application_organ_name as applicantName,c.filearbitra_url,(select version from
  570. case_application_log where case_appli_id=c.id order by version desc limit 1) as version,(select
  571. update_submit_status from case_application_log where case_appli_id=c.id order by version desc limit 1)
  572. as updateSubmitStatus,c.batch_number
  573. from case_application c
  574. JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1
  575. JOIN case_application_log l ON c.id = l.case_appli_id and c.version=l.version
  576. <where>
  577. <if test="caseStatus != null">
  578. AND c.case_status = #{caseStatus}
  579. </if>
  580. <if test="lockStatus != null">
  581. AND c.lock_status = #{lockStatus}
  582. </if>
  583. <if test="caseNum != null and caseNum != ''">
  584. AND c.case_num = #{caseNum}
  585. </if>
  586. <if test="batchNumber != null">
  587. AND c.batch_number = #{batchNumber}
  588. </if>
  589. <if test="nameId != null and nameId != ''">
  590. AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
  591. </if>
  592. <if test="caseStatusList != null and caseStatusList.size() > 0">
  593. and c.case_status in
  594. <foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
  595. #{caseStatus}
  596. </foreach>
  597. </if>
  598. </where>
  599. order by c.case_num desc
  600. </select>
  601. <select id="selectAdminCaseApplicationListBatch" parameterType="com.ruoyi.wisdomarbitrate.domain.CaseApplication" resultMap="CaseApplicationResult">
  602. SELECT DISTINCT c.batch_number ,c.arbitrat_method ,c.arbitrator_name ,
  603. c.arbitrator_id ,a.identity_type ,a.name ,a.application_organ_id as applicationOrganId,
  604. a.application_organ_name as applicantName,
  605. CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
  606. ELSE '无审理方式'
  607. END arbitratMethodName
  608. FROM case_application c left join case_affiliate a on c.id = a.case_appli_id
  609. WHERE c.lock_status = 0 and c.batch_number is not null
  610. and a.identity_type = 1
  611. <if test="batchNumber != null and batchNumber != ''">
  612. AND c.batch_number = #{batchNumber}
  613. </if>
  614. <if test="nameId != null and nameId != ''">
  615. AND a.application_organ_id=#{nameId}
  616. </if>
  617. order by c.batch_number desc
  618. </select>
  619. <select id="selectAdminCaseApplicationListBatch1" parameterType="com.ruoyi.wisdomarbitrate.domain.CaseApplication" resultMap="CaseApplicationResult">
  620. SELECT DISTINCT t1.batch_number ,t1.arbitrat_method ,t1.arbitrator_name ,
  621. t1.arbitrator_id ,t1.identity_type ,t1.name ,t1.applicationOrganId ,
  622. t1.applicantName,t1.arbitratMethodName
  623. FROM(
  624. <trim suffixOverrides="union">
  625. <!--被申请人,仲裁员,部门长,财务,代理人案件-->
  626. <if test="isOtherRole!=null and isOtherRole==1">
  627. SELECT c.batch_number ,c.arbitrat_method ,c.arbitrator_name ,
  628. c.arbitrator_id ,ca.identity_type ,ca.name ,ca.application_organ_id as applicationOrganId,
  629. ca.application_organ_name as applicantName, c.lock_status,
  630. CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
  631. ELSE '无审理方式'
  632. END arbitratMethodName
  633. FROM case_application c left join case_affiliate ca on c.id = ca.case_appli_id
  634. <where>
  635. <!--根据角色和状态过滤-->
  636. <!--被申请人-->
  637. <if test="idCard != null and idCard != ''">
  638. or (ca.identity_num=#{idCard} AND ca.identity_type=2
  639. and (c.case_status=4 or c.case_status=17)
  640. )
  641. </if>
  642. <!--仲裁员-->
  643. <if test="userId != null and userId != ''">
  644. or ( ca.identity_type=1 and
  645. c.case_status in (7,13,17,18)
  646. and
  647. instr (c.arbitrator_id,#{userId})>0 )
  648. </if>
  649. <!--部门长-->
  650. <if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
  651. or (ca.identity_type=1)
  652. </if>
  653. <!--财务-->
  654. <if test="financeStatus != null and financeStatus != ''">
  655. or (ca.identity_type=1
  656. and c.case_status =#{financeStatus}
  657. )
  658. </if>
  659. <!--代理人-->
  660. <if test="agentDeptIds != null and agentDeptIds.size()>0">
  661. or (
  662. ca.application_organ_id in
  663. <foreach item="deptId" collection="agentDeptIds" open="(" separator="," close=")">#{deptId}
  664. </foreach>
  665. AND ca.identity_type=1
  666. and c.case_status in (0,9)
  667. )
  668. </if>
  669. </where>
  670. union
  671. </if>
  672. <!--申请人案件-->
  673. <if test="applicationOrganId != null and applicationOrganId != ''">
  674. SELECT c.batch_number ,c.arbitrat_method ,c.arbitrator_name ,
  675. c.arbitrator_id ,ca.identity_type ,ca.name ,ca.application_organ_id as applicationOrganId,
  676. ca.application_organ_name as applicantName, c.lock_status,
  677. CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
  678. ELSE '无审理方式'
  679. END arbitratMethodName
  680. FROM case_application c left join case_affiliate ca on c.id = ca.case_appli_id
  681. <where>
  682. (c.case_status &lt;= 10 or c.case_status=31) AND
  683. ca.identity_type=1
  684. <if test="applicationOrganId != null and applicationOrganId != ''">
  685. AND ca.application_organ_id = #{applicationOrganId}
  686. </if>
  687. </where>
  688. union
  689. </if>
  690. <!--秘书案件-->
  691. <if test="deptIds != null and deptIds.size() > 0">
  692. SELECT c.batch_number ,c.arbitrat_method ,c.arbitrator_name ,
  693. c.arbitrator_id ,ca.identity_type ,ca.name ,ca.application_organ_id as applicationOrganId,
  694. ca.application_organ_name as applicantName, c.lock_status,
  695. CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
  696. ELSE '无审理方式'
  697. END arbitratMethodName
  698. FROM case_application c left join case_affiliate ca on c.id = ca.case_appli_id
  699. WHERE ca.identity_type=1
  700. and c.case_status in (1,5,8,9,11,14,15,16,17,31)
  701. union
  702. </if>
  703. </trim>
  704. ) t1
  705. WHERE t1.lock_status = 0 and t1.batch_number is not null
  706. and t1.identity_type = 1
  707. <if test="batchNumber != null and batchNumber != ''">
  708. AND t1.batch_number = #{batchNumber}
  709. </if>
  710. <if test="nameId != null and nameId != ''">
  711. AND t1.application_organ_id=#{nameId}
  712. </if>
  713. order by t1.batch_number desc
  714. </select>
  715. <select id="selectAdminCaseToDoCount" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
  716. SELECT
  717. sum( case when c.case_status=0 then 1 else 0 end) caseApply,
  718. sum( case when c.case_status=1 then 1 else 0 end) caseApplyCheck,
  719. sum( case when c.case_status=2 then 1 else 0 end) caseApplyPay,
  720. sum( case when c.case_status=3 then 1 else 0 end) caseApplyPayCheck,
  721. sum( case when c.case_status=4 then 1 else 0 end) caseApplyEvidence,
  722. sum( case when c.case_status=5 then 1 else 0 end) caseApplyGroupCheck,
  723. sum( case when c.case_status=6 then 1 else 0 end) caseApplyGroupConfirm,
  724. sum( case when c.case_status=7 then 1 else 0 end) caseApplyArbitrateWay,
  725. sum( case when c.case_status=8 then 1 else 0 end) caseApplyGroupOnline,
  726. sum( case when c.case_status=9 then 1 else 0 end) caseApplyGroupOffline,
  727. sum( case when c.case_status=10 then 1 else 0 end) caseApplyAward,
  728. sum( case when c.case_status=11 then 1 else 0 end) caseApplyAwardCheck,
  729. sum( case when c.case_status=12 then 1 else 0 end) caseApplyAwardConfirm,
  730. sum( case when c.case_status=13 then 1 else 0 end) caseApplyAwardSign,
  731. sum( case when c.case_status=14 then 1 else 0 end) caseApplyAwardSeal,
  732. sum( case when c.case_status=15 then 1 else 0 end) caseApplyAwardSend,
  733. sum( case when c.case_status=16 then 1 else 0 end) caseApplyStored,
  734. sum( case when c.case_status=17 then 1 else 0 end) caseApplyArchived,
  735. sum( case when c.case_status=18 then 1 else 0 end) arbitratorApplyAwardConfirm,
  736. sum( case when c.case_status=31 then 1 else 0 end) updateOnlineHearDate
  737. FROM
  738. case_application c
  739. JOIN case_affiliate ca ON ca.case_appli_id = c.id
  740. AND ca.identity_type = 1
  741. WHERE
  742. c.case_status IN (
  743. 0,
  744. 1,
  745. 2,
  746. 3,
  747. 4,
  748. 5,
  749. 6,
  750. 7,
  751. 8,
  752. 9,
  753. 10,
  754. 11,
  755. 12,
  756. 13,
  757. 14,
  758. 15,
  759. 16,
  760. 17,
  761. 18,
  762. 31
  763. )
  764. </select>
  765. <select id="selectCaseApplicationCount" parameterType="com.ruoyi.wisdomarbitrate.domain.CaseApplication" resultType="int">
  766. select count(1) from case_application c
  767. <where>
  768. <if test="caseNum != null and caseNum != ''">
  769. AND c.case_num = #{caseNum}
  770. </if>
  771. </where>
  772. </select>
  773. <insert id="insertCaseApplication" parameterType="com.ruoyi.wisdomarbitrate.domain.CaseApplication" useGeneratedKeys="true" keyProperty="id">
  774. insert into case_application(
  775. <if test="id != null">id ,</if>
  776. <if test="caseName != null and caseName != ''">case_name ,</if>
  777. <if test="caseNum != null and caseNum != ''">case_num,</if>
  778. <if test="caseSubjectAmount != null">case_subject_amount,</if>
  779. register_date,
  780. <if test="arbitratMethod != null and arbitratMethod != ''">arbitrat_method,</if>
  781. <if test="caseStatus != null ">case_status,</if>
  782. <if test="hearDate != null ">hear_date,</if>
  783. <if test="arbitratClaims != null and arbitratClaims != ''">arbitrat_claims,</if>
  784. <if test="requestRule != null and requestRule != ''">request_rule,</if>
  785. <if test="loanStartDate != null ">loan_start_date,</if>
  786. <if test="loanEndDate != null ">loan_end_date,</if>
  787. <if test="claimPrinciOwed != null ">claim_princi_owed,</if>
  788. <if test="claimInterestOwed != null ">claim_interest_owed,</if>
  789. <if test="claimLiquidDamag != null ">claim_liquid_damag,</if>
  790. <if test="feePayable != null ">fee_payable,</if>
  791. <if test="beginVideoDate != null ">begin_video_date,</if>
  792. <if test="onlineVideoPerson != null and onlineVideoPerson != ''">online_video_person,</if>
  793. <if test="contractNumber != null and contractNumber != ''">contract_number,</if>
  794. <if test="adjudicaCounter != null ">adjudica_counter,</if>
  795. <if test="properPreser != null ">proper_preser,</if>
  796. <if test="createBy != null and createBy != ''">create_by,</if>
  797. <if test="importFlag != null ">import_flag,</if>
  798. <if test="version != null ">version,</if>
  799. <if test="templateId != null ">template_id,</if>
  800. facts,
  801. mediation_agreement,
  802. batch_number,
  803. create_time
  804. )values(
  805. <if test="id != null">#{id} ,</if>
  806. <if test="caseName != null and caseName != ''">#{caseName},</if>
  807. <if test="caseNum != null and caseNum != ''">#{caseNum},</if>
  808. <if test="caseSubjectAmount != null">#{caseSubjectAmount},</if>
  809. sysdate(),
  810. <if test="arbitratMethod != null and arbitratMethod != ''">#{arbitratMethod},</if>
  811. <if test="caseStatus != null ">#{caseStatus},</if>
  812. <if test="hearDate != null ">#{hearDate},</if>
  813. <if test="arbitratClaims != null and arbitratClaims != ''">#{arbitratClaims},</if>
  814. <if test="requestRule != null and requestRule != ''">#{requestRule},</if>
  815. <if test="loanStartDate != null ">#{loanStartDate},</if>
  816. <if test="loanEndDate != null ">#{loanEndDate},</if>
  817. <if test="claimPrinciOwed != null ">#{claimPrinciOwed},</if>
  818. <if test="claimInterestOwed != null ">#{claimInterestOwed},</if>
  819. <if test="claimLiquidDamag != null ">#{claimLiquidDamag},</if>
  820. <if test="feePayable != null ">#{feePayable},</if>
  821. <if test="beginVideoDate != null ">#{beginVideoDate},</if>
  822. <if test="onlineVideoPerson != null and onlineVideoPerson != ''">#{onlineVideoPerson},</if>
  823. <if test="contractNumber != null and contractNumber != ''">#{contractNumber},</if>
  824. <if test="adjudicaCounter != null ">#{adjudicaCounter},</if>
  825. <if test="properPreser != null ">#{properPreser},</if>
  826. <if test="createBy != null and createBy != ''">#{createBy},</if>
  827. <if test="importFlag != null ">#{importFlag},</if>
  828. <if test="version != null ">#{version},</if>
  829. <if test="templateId != null ">#{templateId},</if>
  830. #{facts},
  831. #{mediationAgreement},
  832. #{batchNumber},
  833. sysdate()
  834. )
  835. </insert>
  836. <insert id="batchSave">
  837. insert into case_application(
  838. id,
  839. case_name ,
  840. case_num,
  841. case_subject_amount,
  842. register_date,
  843. arbitrat_method,
  844. case_status,
  845. hear_date,
  846. arbitrat_claims,
  847. request_rule,
  848. loan_start_date,
  849. loan_end_date,
  850. claim_princi_owed,
  851. claim_interest_owed,
  852. claim_liquid_damag,
  853. fee_payable,
  854. begin_video_date,
  855. online_video_person,
  856. contract_number,
  857. adjudica_counter,
  858. proper_preser,
  859. create_by,
  860. import_flag,
  861. version,
  862. template_id,
  863. facts,
  864. mediation_agreement,
  865. batch_number,
  866. create_time
  867. )values
  868. <foreach item="item" index="index" collection="list" separator=",">
  869. (
  870. #{item.id},
  871. #{item.caseName},
  872. #{item.caseNum},
  873. #{item.caseSubjectAmount},
  874. sysdate(),
  875. #{item.arbitratMethod},
  876. #{item.caseStatus},
  877. #{item.hearDate},
  878. #{item.arbitratClaims},
  879. #{item.requestRule},
  880. #{item.loanStartDate},
  881. #{item.loanEndDate},
  882. #{item.claimPrinciOwed},
  883. #{item.claimInterestOwed},
  884. #{item.claimLiquidDamag},
  885. #{item.feePayable},
  886. #{item.beginVideoDate},
  887. #{item.onlineVideoPerson},
  888. #{item.contractNumber},
  889. #{item.adjudicaCounter},
  890. #{item.properPreser},
  891. #{item.createBy},
  892. #{item.importFlag},
  893. #{item.version},
  894. #{item.templateId},
  895. #{item.facts},
  896. #{item.mediationAgreement},
  897. #{item.batchNumber},
  898. sysdate()
  899. )
  900. </foreach>;
  901. </insert>
  902. <update id="updataCaseApplication" parameterType="com.ruoyi.wisdomarbitrate.domain.CaseApplication">
  903. update case_application
  904. <set>
  905. <if test="caseSubjectAmount != null">case_subject_amount = #{caseSubjectAmount},</if>
  906. <if test="registerDate != null">register_date = #{registerDate},</if>
  907. <if test="arbitratMethod != null">arbitrat_method = #{arbitratMethod},</if>
  908. <if test="hearDate != null ">hear_date = #{hearDate},</if>
  909. <if test="arbitratClaims != null and arbitratClaims != ''">arbitrat_claims = #{arbitratClaims},</if>
  910. <if test="requestRule != null and requestRule != ''">request_rule = #{requestRule},</if>
  911. <if test="loanStartDate != null ">loan_start_date = #{loanStartDate},</if>
  912. <if test="loanEndDate != null ">loan_end_date = #{loanEndDate},</if>
  913. <if test="loanEndDate != null ">claim_princi_owed = #{claimPrinciOwed},</if>
  914. <if test="claimInterestOwed != null ">claim_interest_owed = #{claimInterestOwed},</if>
  915. <if test="claimLiquidDamag != null ">claim_liquid_damag = #{claimLiquidDamag},</if>
  916. <if test="feePayable != null ">fee_payable = #{feePayable},</if>
  917. <if test="beginVideoDate != null ">begin_video_date = #{beginVideoDate},</if>
  918. <if test="onlineVideoPerson != null and onlineVideoPerson != ''">online_video_person =
  919. #{onlineVideoPerson},
  920. </if>
  921. <if test="contractNumber != null and contractNumber != ''">contract_number = #{contractNumber},</if>
  922. <if test="caseName != null and caseName != ''">case_name = #{caseName},</if>
  923. <if test="caseDescribe != null and caseDescribe != ''">case_describe = #{caseDescribe},</if>
  924. <if test="caseResult != null and caseResult != ''">case_result = #{caseResult},</if>
  925. <if test="caseStatus != null">case_status = #{caseStatus},</if>
  926. <if test="properPreser != null">proper_preser = #{properPreser},</if>
  927. <if test="applicantIsWrittenHear != null">appli_iswrit_hear = #{applicantIsWrittenHear},</if>
  928. <if test="respondentIsWrittenHear != null">respon_isWrit_hear = #{respondentIsWrittenHear},</if>
  929. <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  930. <if test="caseNum != null and caseNum != ''">case_num = #{caseNum},</if>
  931. <if test="version != null ">version = #{version},</if>
  932. <if test="facts != null and facts != ''">facts = #{facts},</if>
  933. <if test="mediationAgreement != null and mediationAgreement != ''"> mediation_agreement = #{mediationAgreement} </if>
  934. update_time = sysdate()
  935. </set>
  936. where id = #{id}
  937. </update>
  938. <update id="submitCaseApplication" parameterType="com.ruoyi.wisdomarbitrate.domain.CaseApplication">
  939. update case_application
  940. <set>
  941. <if test="caseStatus != null">case_status = #{caseStatus},</if>
  942. <if test="arbitratorId != null and arbitratorId != ''">arbitrator_id = #{arbitratorId},</if>
  943. <if test="arbitratorName != null and arbitratorName != ''">arbitrator_name = #{arbitratorName},</if>
  944. <if test="pendingAppointArbotrar != null ">pending_appoint_arbotrar = #{pendingAppointArbotrar},</if>
  945. <if test="arbitratMethod != null ">arbitrat_method = #{arbitratMethod},</if>
  946. <if test="caseName != null and caseName != ''">case_name = #{caseName},</if>
  947. <if test="caseDescribe != null and caseDescribe != ''">case_describe = #{caseDescribe},</if>
  948. <if test="caseResult != null and caseResult != ''">case_result = #{caseResult},</if>
  949. <if test="isAgreePendTral != null">is_agree_pend_tral = #{isAgreePendTral},</if>
  950. <if test="adjudicaCounter != null">adjudica_counter = #{adjudicaCounter},</if>
  951. <if test="objectiJuris != null">objecti_juris = #{objectiJuris},</if>
  952. <if test="isAbsence != null">is_absence = #{isAbsence},</if>
  953. <if test="lockStatus != null">lock_status = #{lockStatus},</if>
  954. <if test="appliIsAbsen != null">appli_is_absen = #{appliIsAbsen},</if>
  955. <if test="responCrossOpin != null and responCrossOpin != ''">respon_cross_opin = #{responCrossOpin},</if>
  956. <if test="applicaCrossOpin != null and applicaCrossOpin != ''">applica_cross_opin = #{applicaCrossOpin},
  957. </if>
  958. <if test="responDefenOpini != null and responDefenOpini != ''">respon_defen_opini = #{responDefenOpini},
  959. </if>
  960. <if test="objectionAddEviden != null">objection_add_eviden = #{objectionAddEviden},</if>
  961. <if test="openCourtHear != null">open_court_hear = #{openCourtHear},</if>
  962. <if test="respondentIsWrittenHear != null">respon_isWrit_hear = #{respondentIsWrittenHear},</if>
  963. <if test="hearDate != null">hear_date = #{hearDate},</if>
  964. <if test="filearbitraUrl != null and filearbitraUrl != ''">filearbitra_url = #{filearbitraUrl},</if>
  965. <if test="adjudicaCounterReason != null and adjudicaCounterReason != ''">adjudica_counter_reason =
  966. #{adjudicaCounterReason},
  967. </if>
  968. </set>
  969. where id = #{id}
  970. </update>
  971. <update id="updatePayType">
  972. update case_application set pay_type=#{payType} where id in
  973. <foreach item="caseId" collection="caseIds" open="(" separator="," close=")">
  974. #{caseId}
  975. </foreach>
  976. </update>
  977. <update id="updateCaseLockStatus">
  978. update case_application set lock_status=#{lockStatus} where id = #{id}
  979. </update>
  980. <update id="bindCaseId">
  981. update case_application set room_id=#{roomId} where id = #{caseId}
  982. <!-- update case_application set room_id= CONCAT(room_id,',',#{roomId}) where id =#{caseId} -->
  983. </update>
  984. <update id="updateVersionById">
  985. update case_application set version = #{version} where id = #{id}
  986. </update>
  987. <delete id="deletecaseApplication" parameterType="com.ruoyi.wisdomarbitrate.domain.CaseApplication">
  988. delete from case_application where id = #{id}
  989. </delete>
  990. <delete id="batchDeletecaseApplication">
  991. delete from case_application
  992. where id in
  993. <foreach collection="ids" item="item" open="(" separator="," close=")">
  994. #{item}
  995. </foreach>;
  996. delete from case_affiliate
  997. where case_appli_id in
  998. <foreach collection="ids" item="item" open="(" separator="," close=")">
  999. #{item}
  1000. </foreach>;
  1001. delete from case_attach
  1002. where case_appli_id in
  1003. <foreach collection="ids" item="item" open="(" separator="," close=")">
  1004. #{item}
  1005. </foreach>;
  1006. delete from column_value
  1007. where case_id in
  1008. <foreach collection="ids" item="item" open="(" separator="," close=")">
  1009. #{item}
  1010. </foreach>;
  1011. </delete>
  1012. <select id="selectCaseApplication" parameterType="com.ruoyi.wisdomarbitrate.domain.CaseApplication" resultMap="CaseApplicationResult">
  1013. select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
  1014. CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
  1015. ELSE '无审理方式'
  1016. END arbitratMethodName,
  1017. c.case_name,
  1018. c.case_status ,
  1019. CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
  1020. when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
  1021. when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
  1022. when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书'
  1023. when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印'
  1024. when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档'
  1025. when 18 then '待仲裁员审核裁决书'
  1026. when 31 then '待修改开庭时间'
  1027. ELSE '无案件状态'
  1028. END caseStatusName,
  1029. c.hear_date ,c.arbitrat_claims ,
  1030. c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag
  1031. ,c.fee_payable ,
  1032. c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time
  1033. ,c.request_rule,c.adjudica_counter,c.proper_preser,
  1034. c.is_absence ,c.respon_cross_opin ,c.applica_cross_opin ,c.respon_defen_opini ,
  1035. c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,ca.application_organ_id applicationOrganId
  1036. ,ca.application_organ_name as applicantName,
  1037. c.batch_number,
  1038. c.facts,
  1039. c.appli_iswrit_hear,c.respon_isWrit_hear,
  1040. c.mediation_agreement,c.template_id templateId,c.appli_iswrit_hear,c.respon_isWrit_hear
  1041. from case_application c
  1042. LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
  1043. <where>
  1044. <if test="id != null ">
  1045. AND c.id = #{id}
  1046. </if>
  1047. <if test="caseNum != null and caseNum!='' ">
  1048. AND c.case_num = #{caseNum}
  1049. </if>
  1050. </where>
  1051. order by c.create_time desc limit 1
  1052. </select>
  1053. <select id="listCaseApplicationByIds" resultMap="CaseApplicationResult">
  1054. select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,c.case_name,
  1055. CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
  1056. ELSE '无审理方式'
  1057. END arbitratMethodName,
  1058. c.case_status ,
  1059. CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
  1060. when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
  1061. when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
  1062. when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书'
  1063. when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印'
  1064. when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档'
  1065. when 18 then '待仲裁员审核裁决书'
  1066. when 31 then '待修改开庭时间'
  1067. ELSE '无案件状态'
  1068. END caseStatusName,
  1069. c.hear_date ,c.arbitrat_claims ,
  1070. c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag
  1071. ,c.fee_payable ,
  1072. c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time
  1073. ,c.request_rule,c.adjudica_counter,c.proper_preser,
  1074. c.is_absence ,c.respon_cross_opin ,c.applica_cross_opin ,c.respon_defen_opini ,
  1075. c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,ca.application_organ_id applicationOrganId
  1076. ,ca.application_organ_name as applicantName,
  1077. c.batch_number,
  1078. c.facts,
  1079. c.mediation_agreement,c.template_id templateId
  1080. from case_application c
  1081. LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
  1082. <where>
  1083. <if test="ids != null and ids.size() > 0 ">
  1084. c.id in
  1085. <foreach item="id" collection="ids" open="(" separator="," close=")">
  1086. #{id}
  1087. </foreach>
  1088. </if>
  1089. </where>
  1090. </select>
  1091. <select id="selectCaseApplicationConfirm" parameterType="com.ruoyi.wisdomarbitrate.domain.CaseApplication" resultMap="CaseApplicationResult">
  1092. select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
  1093. CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
  1094. ELSE '无审理方式'
  1095. END arbitratMethodName,
  1096. c.case_status ,
  1097. CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
  1098. when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
  1099. when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
  1100. when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书'
  1101. when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印'
  1102. when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档'
  1103. when 18 then '待仲裁员审核裁决书'
  1104. when 31 then '待修改开庭时间'
  1105. ELSE '无案件状态'
  1106. END caseStatusName,
  1107. c.hear_date ,c.arbitrat_claims , c.batch_number,c.facts,c.mediation_agreement,c.template_id templateId,
  1108. c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
  1109. c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
  1110. c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,
  1111. p.payment_status ,
  1112. CASE p.payment_status when 1 then '已支付' when 0 then '未支付'
  1113. ELSE '无支付状态'
  1114. END paymentStatusName,c.pay_type,
  1115. CASE c.pay_type when 0 then '线上支付' when 0 then '线下支付' else '' end payTypeName
  1116. from case_application c left join case_payment_record p on c.id = p.case_id
  1117. where c.id = #{id} and p.payment_status=1 limit 1
  1118. </select>
  1119. <select id="listCaseApplicationByBatchNumber" resultMap="CaseApplicationResult">
  1120. select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,c.case_name,
  1121. CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
  1122. ELSE '无审理方式'
  1123. END arbitratMethodName,
  1124. c.case_status ,
  1125. CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
  1126. when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
  1127. when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
  1128. when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书'
  1129. when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印'
  1130. when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档'
  1131. when 18 then '待仲裁员审核裁决书'
  1132. when 31 then '待修改开庭时间'
  1133. ELSE '无案件状态'
  1134. END caseStatusName,
  1135. c.hear_date ,c.arbitrat_claims ,
  1136. c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag
  1137. ,c.fee_payable ,
  1138. c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time
  1139. ,c.request_rule,c.adjudica_counter,c.proper_preser,
  1140. c.is_absence ,c.respon_cross_opin ,c.applica_cross_opin ,c.respon_defen_opini ,
  1141. c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,ca.application_organ_id applicationOrganId
  1142. ,ca.application_organ_name as applicantName,
  1143. c.batch_number,
  1144. c.facts,
  1145. c.mediation_agreement,c.template_id templateId
  1146. from case_application c
  1147. LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
  1148. WHERE c.lock_status = 0
  1149. <if test="batchNumber != null and batchNumber != ''">
  1150. AND c.batch_number = #{batchNumber}
  1151. </if>
  1152. <if test="caseStatus != null">
  1153. AND c.case_status = #{caseStatus}
  1154. </if>
  1155. </select>
  1156. <select id="selectCaseNumLike" resultType="java.lang.Integer">
  1157. select max(substring(case_num, #{length}+1,12)) as maxCaseNum
  1158. from case_application where case_num like CONCAT(#{caseNum},'%') ;
  1159. </select>
  1160. <select id="selectArbitratorList" resultType="java.lang.String">
  1161. select a.arbitrator_id id from case_application a where a.id=#{id}
  1162. </select>
  1163. <select id="selectCasenum" resultType="java.lang.Integer">
  1164. SELECT count(1)
  1165. from case_application c
  1166. where c.arbitrator_id = #{userId}
  1167. and c.case_status!=17
  1168. </select>
  1169. <select id="selectCaseIdByRoomId" resultType="java.lang.Long">
  1170. select id
  1171. from case_application where room_id=#{roomId} limit 1
  1172. </select>
  1173. <select id="selectMaxRoomId" resultType="java.lang.Long">
  1174. select max(room_id+1) as maxRoomId
  1175. from reserved_conference ;
  1176. </select>
  1177. <select id="selectBatchNumberLike" resultType="java.lang.Integer">
  1178. select max(batch_number+0) as maxBatchNumber
  1179. from case_application ;
  1180. </select>
  1181. <sql id="SELECT_LIST_QUERY">
  1182. <where>
  1183. <!-- 案件状态查询-->
  1184. <if test="caseStatusList != null and caseStatusList.size()>0">
  1185. and c.case_status in
  1186. <foreach collection="caseStatusList" item="caseStatus" open="(" separator="," close=")">
  1187. #{caseStatus}
  1188. </foreach>
  1189. </if>
  1190. <if test="caseStatusList == null or caseStatusList.size()==0">
  1191. and ca.identity_type=1
  1192. </if>
  1193. <if test="roleNames != null and roleNames.size()>0 and roleNames.contains('申请人')
  1194. and caseApplication.loginUserPhone != null and caseApplication.loginUserPhone != ''">
  1195. <!-- 申请人,根据电话查询-->
  1196. and ca.identity_type=1
  1197. and ( ca.contact_telphone=#{caseApplication.loginUserPhone}
  1198. or ca.contact_telphone_agent=#{caseApplication.loginUserPhone}
  1199. )
  1200. </if>
  1201. <if test="roleNames != null and roleNames.size()>0 and roleNames.contains('被申请人')
  1202. and caseApplication.loginUserPhone != null and caseApplication.loginUserPhone != ''">
  1203. <!-- 被申请人查询,根据电话查询-->
  1204. and ca.identity_type=2
  1205. and ( ca.contact_telphone=#{caseApplication.loginUserPhone}
  1206. or ca.contact_telphone_agent=#{caseApplication.loginUserPhone}
  1207. )
  1208. </if>
  1209. <if test="caseApplication.arbitratorId !=null and caseApplication.arbitratorId!=''">
  1210. <!-- 仲裁员查询-->
  1211. and c.arbitrator_id=#{caseApplication.arbitratorId}
  1212. </if>
  1213. <if test="caseApplication.isOtherRole !=null and caseApplication.isOtherRole==1">
  1214. and ca.identity_type=1
  1215. </if>
  1216. </where>
  1217. </sql>
  1218. <select id="list" resultMap="CaseApplicationResult">
  1219. select DISTINCT(t1.id),t1.caseLogId,t1.case_num,t1.case_subject_amount,t1.register_date,t1.arbitrat_method,
  1220. t1.arbitratMethodName,t1.case_status,t1.caseStatusName,t1.hear_date,t1.arbitrat_claims,
  1221. t1.loan_start_date,t1.loan_end_date,t1.claim_princi_owed,t1.claim_interest_owed,t1.claim_liquid_damag,t1.fee_payable,
  1222. t1.begin_video_date,t1.online_video_person,t1.contract_number,t1.create_by,t1.create_time,t1.appli_iswrit_hear,t1.respon_isWrit_hear,t1.update_by,t1.update_time,
  1223. t1.arbitrator_name,t1.name,t1.application_organ_id,t1.applicantName,t1.arbitrator_id,t1.identity_num,t1.identity_type,
  1224. t1.filearbitra_url,t1.lock_status,t1.version,t1.updateSubmitStatus,t1.batch_number,t1.pendingStatus
  1225. from(
  1226. select c.id ,'' AS caseLogId,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
  1227. CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
  1228. ELSE ''
  1229. END arbitratMethodName,
  1230. c.case_status ,
  1231. CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
  1232. when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
  1233. when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
  1234. when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书'
  1235. when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印'
  1236. when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档'
  1237. when 18 then '待仲裁员审核裁决书'
  1238. when 31 then '待修改开庭时间'
  1239. ELSE ''
  1240. END caseStatusName,
  1241. c.hear_date ,c.arbitrat_claims ,
  1242. c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag
  1243. ,c.fee_payable ,c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by
  1244. ,c.create_time,c.appli_iswrit_hear,c.respon_isWrit_hear,
  1245. c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name
  1246. as applicantName,
  1247. c.arbitrator_id,ca.identity_num ,ca.identity_type,c.filearbitra_url,c.lock_status,c.version,null as
  1248. updateSubmitStatus,c.batch_number,0 as pendingStatus
  1249. from case_application c
  1250. JOIN case_affiliate ca ON ca.case_appli_id = c.id
  1251. <include refid="SELECT_LIST_QUERY"/>
  1252. union
  1253. <!-- 已办案件 -->
  1254. SELECT
  1255. c.id,
  1256. '' AS caseLogId,
  1257. c.case_num,
  1258. c.case_subject_amount,
  1259. c.register_date,
  1260. c.arbitrat_method,
  1261. CASE
  1262. c.arbitrat_method
  1263. WHEN 1 THEN
  1264. '开庭审理'
  1265. WHEN 2 THEN
  1266. '书面审理' ELSE ''
  1267. END arbitratMethodName,
  1268. c.case_status,
  1269. CASE
  1270. c.case_status
  1271. when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
  1272. when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
  1273. when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
  1274. when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书'
  1275. when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印'
  1276. when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档'
  1277. when 18 then '待仲裁员审核裁决书'
  1278. when 31 then '待修改开庭时间' ELSE ''
  1279. END caseStatusName,
  1280. c.hear_date,
  1281. c.arbitrat_claims,
  1282. c.loan_start_date,
  1283. c.loan_end_date,
  1284. c.claim_princi_owed,
  1285. c.claim_interest_owed,
  1286. c.claim_liquid_damag,
  1287. c.fee_payable,
  1288. c.begin_video_date,
  1289. c.online_video_person,
  1290. c.contract_number,
  1291. c.create_by,
  1292. c.create_time,c.appli_iswrit_hear,c.respon_isWrit_hear,
  1293. c.update_by,
  1294. c.update_time,
  1295. c.arbitrator_name,
  1296. ca.name,
  1297. ca.application_organ_id ,
  1298. ca.application_organ_name AS applicantName,
  1299. c.arbitrator_id,ca.identity_num ,ca.identity_type,
  1300. c.filearbitra_url,
  1301. c.lock_status,c.version,
  1302. null as updateSubmitStatus,
  1303. c.batch_number,1 as pendingStatus
  1304. from case_log_record r
  1305. join case_application c on r.case_appli_id=c.id
  1306. JOIN case_affiliate ca ON ca.case_appli_id = c.id
  1307. WHERE
  1308. r.create_by=#{caseApplication.loginUserName} AND ca.identity_type=1
  1309. and c.id not in(
  1310. select c.id
  1311. from case_application c
  1312. JOIN case_affiliate ca ON ca.case_appli_id = c.id
  1313. <include refid="SELECT_LIST_QUERY"/>
  1314. )
  1315. ) t1
  1316. <where>
  1317. <if test="caseApplication.caseStatus != null">
  1318. AND t1.case_status = #{caseApplication.caseStatus}
  1319. </if>
  1320. <if test="caseApplication.lockStatus != null">
  1321. AND t1.lock_status = #{caseApplication.lockStatus}
  1322. </if>
  1323. <if test="caseApplication.caseNum != null and caseApplication.caseNum != ''">
  1324. AND t1.case_num like concat('%',#{caseApplication.caseNum},'%')
  1325. </if>
  1326. <if test="caseApplication.batchNumber != null">
  1327. AND t1.batch_number = #{caseApplication.batchNumber}
  1328. </if>
  1329. <!-- <if test="nameId != null and nameId != ''">-->
  1330. <!-- AND t1.application_organ_id=#{nameId} AND t1.identity_type=1-->
  1331. <!-- </if>-->
  1332. </where>
  1333. order by t1.pendingStatus asc,t1.create_time desc
  1334. </select>
  1335. <select id="selectCaseApplicationCaseStatus" resultType="java.lang.Integer">
  1336. select case_status from case_application where id=#{id}
  1337. </select>
  1338. </mapper>