智能仲裁后端服务

CaseApplicationMapper.xml 34KB

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