智能仲裁后端服务

CaseApplicationMapper.xml 76KB

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