智能仲裁后端服务

CaseApplicationMapper.xml 34KB

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