智能仲裁后端服务

CaseApplicationMapper.xml 31KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  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="caseSubjectAmount" column="case_subject_amount" />
  10. <result property="registerDate" column="register_date" />
  11. <result property="arbitratMethod" column="arbitrat_method" />
  12. <result property="caseStatus" column="case_status" />
  13. <result property="hearDate" column="hear_date" />
  14. <result property="arbitratClaims" column="arbitrat_claims" />
  15. <result property="loanStartDate" column="loan_start_date" />
  16. <result property="loanEndDate" column="loan_end_date" />
  17. <result property="claimPrinciOwed" column="claim_princi_owed" />
  18. <result property="claimInterestOwed" column="claim_interest_owed" />
  19. <result property="claimLiquidDamag" column="claim_liquid_damag" />
  20. <result property="feePayable" column="fee_payable" />
  21. <result property="beginVideoDate" column="begin_video_date" />
  22. <result property="onlineVideoPerson" column="online_video_person" />
  23. <result property="contractNumber" column="contract_number" />
  24. <result property="caseStatusName" column="caseStatusName" />
  25. <result property="createBy" column="create_by" />
  26. <result property="createTime" column="create_time" />
  27. <result property="updateBy" column="update_by" />
  28. <result property="updateTime" column="update_time" />
  29. <result property="arbitratMethodName" column="arbitratMethodName" />
  30. <result property="isAbsence" column="is_absence" />
  31. <result property="responCrossOpin" column="respon_cross_opin" />
  32. <result property="applicaCrossOpin" column="applica_cross_opin" />
  33. <result property="responDefenOpini" column="respon_defen_opini" />
  34. <result property="arbitratorId" column="arbitrator_id" />
  35. <result property="arbitratorName" column="arbitrator_name" />
  36. <result property="paymentStatus" column="payment_status" />
  37. <result property="paymentStatusName" column="paymentStatusName" />
  38. <result property="filearbitraUrl" column="filearbitra_url" />
  39. <result property="requestRule" column="request_rule" />
  40. <result property="properPreser" column="proper_preser" />
  41. <result property="adjudicaCounter" column="adjudica_counter" />
  42. <result property="lockStatus" column="lock_status" />
  43. </resultMap>
  44. <select id="selectCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
  45. select t1.* from(
  46. select DISTINCT(t.id),t.case_num ,t.case_subject_amount ,t.register_date ,t.arbitrat_method,
  47. t.arbitratMethodName,t.case_status,t.caseStatusName,t.hear_date ,t.arbitrat_claims ,
  48. t.loan_start_date ,t.loan_end_date ,t.claim_princi_owed ,t.claim_interest_owed ,t.claim_liquid_damag,t.fee_payable ,
  49. t.begin_video_date ,t.online_video_person ,t.contract_number ,t.create_by ,t.create_time ,
  50. t.update_by ,t.update_time , t.arbitrator_name,t.name,t.application_organ_id,t.applicantName,
  51. t.arbitrator_id,t.identity_num , t.identity_type,t.filearbitra_url,t.lock_status
  52. from(
  53. select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
  54. CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
  55. ELSE '无审理方式'
  56. END arbitratMethodName,
  57. c.case_status ,
  58. CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
  59. when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
  60. when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
  61. when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
  62. when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
  63. when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
  64. when 31 then '待修改开庭时间'
  65. ELSE '无案件状态'
  66. END caseStatusName,
  67. c.hear_date ,c.arbitrat_claims ,
  68. c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag
  69. ,c.fee_payable ,
  70. c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
  71. c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name as
  72. applicantName,
  73. c.arbitrator_id,ca.identity_num , ca.identity_type,c.filearbitra_url,c.lock_status
  74. from case_application c
  75. LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id
  76. <where>
  77. <if test="caseStatus != null">
  78. AND c.case_status = #{caseStatus}
  79. </if>
  80. <if test="caseNum != null and caseNum != ''">
  81. AND c.case_num = #{caseNum}
  82. </if>
  83. <if test="caseStatusList != null and caseStatusList.size() > 0">
  84. and c.case_status in
  85. <foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
  86. #{caseStatus}
  87. </foreach>
  88. </if>
  89. <if test="lockStatus != null">
  90. AND c.lock_status = #{lockStatus}
  91. </if>
  92. </where>
  93. ) t
  94. <where>
  95. <!--被申请人-->
  96. <if test="idCard != null and idCard != ''">
  97. or (t.identity_num=#{idCard} AND t.identity_type=2 and (t.case_status=4 or t.case_status=17))
  98. </if>
  99. <!--仲裁员-->
  100. <if test="userId != null and userId != ''">
  101. or ( t.identity_type=1 and
  102. t.case_status in (7,8,9,12,13,14,17)
  103. and
  104. instr (t.arbitrator_id,#{userId})>0)
  105. </if>
  106. <!--法律顾问-->
  107. <if test="deptIds != null and deptIds.size() > 0">
  108. or (t.identity_type=1 and t.case_status in (1,5,11,15,16,17,31)
  109. and t.application_organ_id in
  110. <foreach item="item" collection="deptIds" open="(" separator="," close=")">
  111. #{item}
  112. </foreach> )
  113. </if>
  114. <!--申请人-->
  115. <if test="nameId != null and nameId != ''">
  116. or ( t.application_organ_id = #{nameId} AND t.identity_type=1
  117. and t.case_status in (0,2,17))
  118. </if>
  119. <!--部门长-->
  120. <if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
  121. or (t.identity_type=1 and t.case_status in
  122. <foreach item="caseStatus" collection="deptHeadStatus" open="(" separator="," close=")">#{caseStatus}
  123. </foreach>)
  124. </if>
  125. <!--财务-->
  126. <if test="financeStatus != null and financeStatus != ''">
  127. or (t.identity_type=1 and t.case_status =#{financeStatus})
  128. </if>
  129. </where>
  130. ) t1
  131. order by t1.create_time desc,t1.case_num desc
  132. </select>
  133. <select id="selectTodoCountByRole" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
  134. select sum( case when t1.case_status=0 then 1 else 0 end) caseApply,
  135. sum( case when t1.case_status=1 then 1 else 0 end) caseApplyCheck,
  136. sum( case when t1.case_status=2 then 1 else 0 end) caseApplyPay,
  137. sum( case when t1.case_status=3 then 1 else 0 end) caseApplyPayCheck,
  138. sum( case when t1.case_status=4 then 1 else 0 end) caseApplyEvidence,
  139. sum( case when t1.case_status=5 then 1 else 0 end) caseApplyGroupCheck,
  140. sum( case when t1.case_status=6 then 1 else 0 end) caseApplyGroupConfirm,
  141. sum( case when t1.case_status=7 then 1 else 0 end) caseApplyArbitrateWay,
  142. sum( case when t1.case_status=8 then 1 else 0 end) caseApplyGroupOnline,
  143. sum( case when t1.case_status=9 then 1 else 0 end) caseApplyGroupOffline,
  144. sum( case when t1.case_status=10 then 1 else 0 end) caseApplyAward,
  145. sum( case when t1.case_status=11 then 1 else 0 end) caseApplyAwardCheck,
  146. sum( case when t1.case_status=12 then 1 else 0 end) caseApplyAwardConfirm,
  147. sum( case when t1.case_status=13 then 1 else 0 end) caseApplyAwardSign,
  148. sum( case when t1.case_status=14 then 1 else 0 end) caseApplyAwardSeal,
  149. sum( case when t1.case_status=15 then 1 else 0 end) caseApplyAwardSend,
  150. sum( case when t1.case_status=16 then 1 else 0 end) caseApplyStored,
  151. sum( case when t1.case_status=17 then 1 else 0 end) caseApplyArchived,
  152. sum( case when t1.case_status=31 then 1 else 0 end) updateOnlineHearDate
  153. from(
  154. select DISTINCT(t.id),t.case_status,t.application_organ_id, t.arbitrator_id,t.identity_num , t.identity_type from(
  155. select c.id ,
  156. c.case_status,ca.application_organ_id,
  157. c.arbitrator_id,ca.identity_num , ca.identity_type
  158. from case_application c
  159. LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id
  160. <where>
  161. <if test="caseStatus != null">
  162. AND c.case_status = #{caseStatus}
  163. </if>
  164. <if test="caseNum != null and caseNum != ''">
  165. AND c.case_num = #{caseNum}
  166. </if>
  167. <if test="caseStatusList != null and caseStatusList.size() > 0">
  168. and c.case_status in
  169. <foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
  170. #{caseStatus}
  171. </foreach>
  172. </if>
  173. </where>
  174. ) t
  175. <where>
  176. <!--被申请人-->
  177. <if test="idCard != null and idCard != ''">
  178. or (t.identity_num=#{idCard} AND t.identity_type=2 and (t.case_status=4 or t.case_status=17))
  179. </if>
  180. <!--仲裁员-->
  181. <if test="userId != null and userId != ''">
  182. or ( t.identity_type=1 and
  183. t.case_status in (7,8,9,12,13,14,17)
  184. and
  185. instr (t.arbitrator_id,#{userId})>0)
  186. </if>
  187. <!--法律顾问-->
  188. <if test="deptIds != null and deptIds.size() > 0">
  189. or (t.identity_type=1 and t.case_status in (1,5,11,15,16,17,31)
  190. and t.application_organ_id in
  191. <foreach item="item" collection="deptIds" open="(" separator="," close=")">
  192. #{item}
  193. </foreach> )
  194. </if>
  195. <!--申请人-->
  196. <if test="nameId != null and nameId != ''">
  197. or ( t.application_organ_id = #{nameId} AND t.identity_type=1
  198. and t.case_status in (0,2,17))
  199. </if>
  200. <!--部门长-->
  201. <if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
  202. or (t.identity_type=1 and t.case_status in
  203. <foreach item="caseStatus" collection="deptHeadStatus" open="(" separator="," close=")">
  204. #{caseStatus}
  205. </foreach>)
  206. </if>
  207. <!--财务-->
  208. <if test="financeStatus != null and financeStatus != ''">
  209. or ( t.identity_type=1 and t.case_status =#{financeStatus})
  210. </if>
  211. </where>
  212. ) t1
  213. </select>
  214. <select id="selectAdminCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
  215. select DISTINCT(c.id) id,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
  216. CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
  217. ELSE '无审理方式'
  218. END arbitratMethodName,
  219. c.case_status ,
  220. CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
  221. when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
  222. when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
  223. when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
  224. when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
  225. when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
  226. when 31 then '待修改开庭时间'
  227. ELSE '无案件状态'
  228. END caseStatusName,
  229. c.hear_date ,c.arbitrat_claims ,
  230. c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
  231. c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,c.lock_status,
  232. c.update_by ,c.update_time , c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName,c.filearbitra_url
  233. from case_application c
  234. LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1
  235. <where>
  236. <if test="caseStatus != null">
  237. AND c.case_status = #{caseStatus}
  238. </if>
  239. <if test="lockStatus != null">
  240. AND c.lock_status = #{lockStatus}
  241. </if>
  242. <if test="caseNum != null and caseNum != ''">
  243. AND c.case_num = #{caseNum}
  244. </if>
  245. <if test="nameId != null and nameId != ''">
  246. AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
  247. </if>
  248. <if test="caseStatusList != null and caseStatusList.size() > 0">
  249. and c.case_status in
  250. <foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
  251. #{caseStatus}
  252. </foreach>
  253. </if>
  254. </where>
  255. order by c.create_time desc,c.case_num desc
  256. </select>
  257. <select id="selectAdminCaseToDoCount" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
  258. SELECT
  259. sum( case when c.case_status=0 then 1 else 0 end) caseApply,
  260. sum( case when c.case_status=1 then 1 else 0 end) caseApplyCheck,
  261. sum( case when c.case_status=2 then 1 else 0 end) caseApplyPay,
  262. sum( case when c.case_status=3 then 1 else 0 end) caseApplyPayCheck,
  263. sum( case when c.case_status=4 then 1 else 0 end) caseApplyEvidence,
  264. sum( case when c.case_status=5 then 1 else 0 end) caseApplyGroupCheck,
  265. sum( case when c.case_status=6 then 1 else 0 end) caseApplyGroupConfirm,
  266. sum( case when c.case_status=7 then 1 else 0 end) caseApplyArbitrateWay,
  267. sum( case when c.case_status=8 then 1 else 0 end) caseApplyGroupOnline,
  268. sum( case when c.case_status=9 then 1 else 0 end) caseApplyGroupOffline,
  269. sum( case when c.case_status=10 then 1 else 0 end) caseApplyAward,
  270. sum( case when c.case_status=11 then 1 else 0 end) caseApplyAwardCheck,
  271. sum( case when c.case_status=12 then 1 else 0 end) caseApplyAwardConfirm,
  272. sum( case when c.case_status=13 then 1 else 0 end) caseApplyAwardSign,
  273. sum( case when c.case_status=14 then 1 else 0 end) caseApplyAwardSeal,
  274. sum( case when c.case_status=15 then 1 else 0 end) caseApplyAwardSend,
  275. sum( case when c.case_status=16 then 1 else 0 end) caseApplyStored,
  276. sum( case when c.case_status=17 then 1 else 0 end) caseApplyArchived,
  277. sum( case when c.case_status=31 then 1 else 0 end) updateOnlineHearDate
  278. FROM
  279. case_application c
  280. JOIN case_affiliate ca ON ca.case_appli_id = c.id
  281. AND ca.identity_type = 1
  282. WHERE
  283. c.case_status IN (
  284. 0,
  285. 1,
  286. 2,
  287. 3,
  288. 4,
  289. 5,
  290. 6,
  291. 7,
  292. 8,
  293. 9,
  294. 10,
  295. 11,
  296. 12,
  297. 13,
  298. 14,
  299. 15,
  300. 16,
  301. 17,
  302. 31
  303. )
  304. </select>
  305. <select id="selectCaseApplicationCount" parameterType="CaseApplication" resultType="int">
  306. select count(1) from case_application c
  307. <where>
  308. <if test="caseNum != null and caseNum != ''">
  309. AND c.case_num = #{caseNum}
  310. </if>
  311. </where>
  312. </select>
  313. <insert id="insertCaseApplication" parameterType="CaseApplication" useGeneratedKeys="true" keyProperty="id">
  314. insert into case_application(
  315. <if test="caseNum != null and caseNum != ''">case_num,</if>
  316. <if test="caseSubjectAmount != null">case_subject_amount,</if>
  317. register_date,
  318. <if test="arbitratMethod != null and arbitratMethod != ''">arbitrat_method,</if>
  319. <if test="caseStatus != null ">case_status,</if>
  320. <if test="hearDate != null ">hear_date,</if>
  321. <if test="arbitratClaims != null and arbitratClaims != ''">arbitrat_claims,</if>
  322. <if test="requestRule != null and requestRule != ''">request_rule,</if>
  323. <if test="loanStartDate != null ">loan_start_date,</if>
  324. <if test="loanEndDate != null ">loan_end_date,</if>
  325. <if test="claimPrinciOwed != null ">claim_princi_owed,</if>
  326. <if test="claimInterestOwed != null ">claim_interest_owed,</if>
  327. <if test="claimLiquidDamag != null ">claim_liquid_damag,</if>
  328. <if test="feePayable != null ">fee_payable,</if>
  329. <if test="beginVideoDate != null ">begin_video_date,</if>
  330. <if test="onlineVideoPerson != null and onlineVideoPerson != ''">online_video_person,</if>
  331. <if test="contractNumber != null and contractNumber != ''">contract_number,</if>
  332. <if test="adjudicaCounter != null ">adjudica_counter,</if>
  333. <if test="properPreser != null ">proper_preser,</if>
  334. <if test="createBy != null and createBy != ''">create_by,</if>
  335. create_time
  336. )values(
  337. <if test="caseNum != null and caseNum != ''">#{caseNum},</if>
  338. <if test="caseSubjectAmount != null">#{caseSubjectAmount},</if>
  339. sysdate(),
  340. <if test="arbitratMethod != null and arbitratMethod != ''">#{arbitratMethod},</if>
  341. <if test="caseStatus != null ">#{caseStatus},</if>
  342. <if test="hearDate != null ">#{hearDate},</if>
  343. <if test="arbitratClaims != null and arbitratClaims != ''">#{arbitratClaims},</if>
  344. <if test="requestRule != null and requestRule != ''">#{requestRule},</if>
  345. <if test="loanStartDate != null ">#{loanStartDate},</if>
  346. <if test="loanEndDate != null ">#{loanEndDate},</if>
  347. <if test="claimPrinciOwed != null ">#{claimPrinciOwed},</if>
  348. <if test="claimInterestOwed != null ">#{claimInterestOwed},</if>
  349. <if test="claimLiquidDamag != null ">#{claimLiquidDamag},</if>
  350. <if test="feePayable != null ">#{feePayable},</if>
  351. <if test="beginVideoDate != null ">#{beginVideoDate},</if>
  352. <if test="onlineVideoPerson != null and onlineVideoPerson != ''">#{onlineVideoPerson},</if>
  353. <if test="contractNumber != null and contractNumber != ''">#{contractNumber},</if>
  354. <if test="adjudicaCounter != null ">#{adjudicaCounter},</if>
  355. <if test="properPreser != null ">#{properPreser},</if>
  356. <if test="createBy != null and createBy != ''">#{createBy},</if>
  357. sysdate()
  358. )
  359. </insert>
  360. <update id="updataCaseApplication" parameterType="CaseApplication">
  361. update case_application
  362. <set>
  363. <if test="caseSubjectAmount != null">case_subject_amount = #{caseSubjectAmount},</if>
  364. <if test="registerDate != null">register_date = #{registerDate},</if>
  365. <if test="arbitratMethod != null and arbitratMethod != ''">arbitrat_method = #{arbitratMethod},</if>
  366. <if test="hearDate != null ">hear_date = #{hearDate},</if>
  367. <if test="arbitratClaims != null and arbitratClaims != ''">arbitrat_claims = #{arbitratClaims},</if>
  368. <if test="requestRule != null and requestRule != ''">request_rule = #{requestRule},</if>
  369. <if test="loanStartDate != null ">loan_start_date = #{loanStartDate},</if>
  370. <if test="loanEndDate != null ">loan_end_date = #{loanEndDate},</if>
  371. <if test="loanEndDate != null ">claim_princi_owed = #{claimPrinciOwed},</if>
  372. <if test="claimInterestOwed != null ">claim_interest_owed = #{claimInterestOwed},</if>
  373. <if test="claimLiquidDamag != null ">claim_liquid_damag = #{claimLiquidDamag},</if>
  374. <if test="feePayable != null ">fee_payable = #{feePayable},</if>
  375. <if test="beginVideoDate != null ">begin_video_date = #{beginVideoDate},</if>
  376. <if test="onlineVideoPerson != null and onlineVideoPerson != ''">online_video_person = #{onlineVideoPerson},</if>
  377. <if test="contractNumber != null and contractNumber != ''">contract_number = #{contractNumber},</if>
  378. <if test="caseName != null and caseName != ''">case_name = #{caseName},</if>
  379. <if test="caseDescribe != null and caseDescribe != ''">case_describe = #{caseDescribe},</if>
  380. <if test="caseResult != null and caseResult != ''">case_result = #{caseResult},</if>
  381. <if test="caseStatus != null">case_status = #{caseStatus},</if>
  382. <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  383. <if test="caseNum != null and caseNum != ''">case_num = #{caseNum},</if>
  384. update_time = sysdate()
  385. </set>
  386. where id = #{id}
  387. </update>
  388. <update id="submitCaseApplication" parameterType="CaseApplication">
  389. update case_application
  390. <set>
  391. <if test="caseStatus != null">case_status = #{caseStatus},</if>
  392. <if test="arbitratorId != null and arbitratorId != ''">arbitrator_id = #{arbitratorId},</if>
  393. <if test="arbitratorName != null and arbitratorName != ''">arbitrator_name = #{arbitratorName},</if>
  394. <if test="pendingAppointArbotrar != null ">pending_appoint_arbotrar = #{pendingAppointArbotrar},</if>
  395. <if test="arbitratMethod != null ">arbitrat_method = #{arbitratMethod},</if>
  396. <if test="caseName != null and caseName != ''">case_name = #{caseName},</if>
  397. <if test="caseDescribe != null and caseDescribe != ''">case_describe = #{caseDescribe},</if>
  398. <if test="caseResult != null and caseResult != ''">case_result = #{caseResult},</if>
  399. <if test="isAgreePendTral != null">is_agree_pend_tral = #{isAgreePendTral},</if>
  400. <if test="adjudicaCounter != null">adjudica_counter = #{adjudicaCounter},</if>
  401. <if test="objectiJuris != null">objecti_juris = #{objectiJuris},</if>
  402. <if test="isAbsence != null">is_absence = #{isAbsence},</if>
  403. <if test="appliIsAbsen != null">appli_is_absen = #{appliIsAbsen},</if>
  404. <if test="responCrossOpin != null and responCrossOpin != ''">respon_cross_opin = #{responCrossOpin},</if>
  405. <if test="applicaCrossOpin != null and applicaCrossOpin != ''">applica_cross_opin = #{applicaCrossOpin},</if>
  406. <if test="responDefenOpini != null and responDefenOpini != ''">respon_defen_opini = #{responDefenOpini},</if>
  407. <if test="objectionAddEviden != null">objection_add_eviden = #{objectionAddEviden},</if>
  408. <if test="openCourtHear != null">open_court_hear = #{openCourtHear},</if>
  409. <if test="hearDate != null">hear_date = #{hearDate},</if>
  410. <if test="filearbitraUrl != null and filearbitraUrl != ''">filearbitra_url = #{filearbitraUrl},</if>
  411. </set>
  412. where id = #{id}
  413. </update>
  414. <update id="updatePayType">
  415. update case_application set pay_type=#{payType} where id = #{caseId}
  416. </update>
  417. <update id="updateCaseLockStatus">
  418. update case_application set lock_status=#{lockStatus} where id = #{id}
  419. </update>
  420. <delete id="deletecaseApplication" parameterType="CaseApplication">
  421. delete from case_application where id = #{id}
  422. </delete>
  423. <delete id="batchDeletecaseApplication">
  424. delete from case_application
  425. where id in
  426. <foreach collection="ids" item="item" open="(" separator="," close=")">
  427. #{item}
  428. </foreach>
  429. </delete>
  430. <select id="selectCaseApplication" parameterType="CaseApplication" resultMap="CaseApplicationResult">
  431. select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
  432. CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
  433. ELSE '无审理方式'
  434. END arbitratMethodName,
  435. c.case_status ,
  436. CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
  437. when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
  438. when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
  439. when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
  440. when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
  441. when 15 then '待仲裁文书送达' when 16 then '待案件归档'
  442. ELSE '无案件状态'
  443. END caseStatusName,
  444. c.hear_date ,c.arbitrat_claims ,
  445. c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
  446. 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,
  447. c.is_absence ,c.respon_cross_opin ,c.applica_cross_opin ,c.respon_defen_opini ,
  448. c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName
  449. from case_application c
  450. LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
  451. <where>
  452. <if test="id != null ">
  453. AND c.id = #{id}
  454. </if>
  455. </where>
  456. </select>
  457. <select id="listCaseApplicationByIds" resultMap="CaseApplicationResult">
  458. select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
  459. CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
  460. ELSE '无审理方式'
  461. END arbitratMethodName,
  462. c.case_status ,
  463. CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
  464. when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
  465. when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
  466. when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
  467. when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
  468. when 15 then '待仲裁文书送达' when 16 then '待案件归档'
  469. ELSE '无案件状态'
  470. END caseStatusName,
  471. c.hear_date ,c.arbitrat_claims ,
  472. c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
  473. 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,
  474. c.is_absence ,c.respon_cross_opin ,c.applica_cross_opin ,c.respon_defen_opini ,
  475. c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName
  476. from case_application c
  477. LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
  478. <where>
  479. <if test="ids != null and ids.size() > 0 ">
  480. c.id in
  481. <foreach item="id" collection="ids" open="(" separator="," close=")">
  482. #{id}
  483. </foreach>
  484. </if>
  485. </where>
  486. </select>
  487. <select id="selectCaseApplicationConfirm" parameterType="CaseApplication" resultMap="CaseApplicationResult">
  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 '待案件归档'
  499. ELSE '无案件状态'
  500. END caseStatusName,
  501. c.hear_date ,c.arbitrat_claims ,
  502. c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
  503. c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
  504. c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,
  505. p.payment_status ,
  506. CASE p.payment_status when 1 then '已支付' when 0 then '未支付'
  507. ELSE '无支付状态'
  508. END paymentStatusName,c.pay_type,
  509. CASE c.pay_type when 0 then '线上支付' when 0 then '线下支付' else '' end payTypeName
  510. from case_application c left join case_payment_record p on c.id = p.case_id
  511. where c.case_status = 3
  512. AND c.id = #{id}
  513. </select>
  514. <select id="selectCaseNumLike" resultType="java.lang.Integer">
  515. select max(substring(case_num, #{length}+1,12)+1) as maxCaseNum
  516. from case_application where case_num like CONCAT(#{caseNum},'%') ;
  517. </select>
  518. <select id="selectArbitratorList" resultType="java.lang.String">
  519. select a.arbitrator_id id from case_application a where a.id=#{id}
  520. </select>
  521. </mapper>