智能仲裁后端服务

CaseApplicationMapper.xml 75KB

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