智能仲裁后端服务

CaseApplicationMapper.xml 31KB

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