智能仲裁后端服务

CaseApplicationMapper.xml 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  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="arbitratorId" column="arbitrator_id" />
  31. <result property="arbitratorName" column="arbitrator_name" />
  32. <result property="paymentStatus" column="payment_status" />
  33. <result property="paymentStatusName" column="paymentStatusName" />
  34. </resultMap>
  35. <select id="selectCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
  36. select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
  37. CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
  38. ELSE '无审理方式'
  39. END arbitratMethodName,
  40. c.case_status ,
  41. CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
  42. when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
  43. when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
  44. when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
  45. when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
  46. when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
  47. ELSE '无案件状态'
  48. END caseStatusName,
  49. c.hear_date ,c.arbitrat_claims ,
  50. c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
  51. c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
  52. c.update_by ,c.update_time , c.arbitrator_name,d.dept_name as applicantName,c.register_date
  53. from case_application c
  54. LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
  55. LEFT JOIN sys_dept d ON ca.NAME = d.dept_id and ca.name=d.dept_id
  56. <where>
  57. <if test="caseStatus != null">
  58. AND c.case_status = #{caseStatus}
  59. </if>
  60. <if test="caseNum != null and caseNum != ''">
  61. AND c.case_num = #{caseNum}
  62. </if>
  63. <if test="nameId != null and nameId != ''">
  64. AND ca.NAME=#{nameId} AND ca.identity_type=1 and ca.name=d.dept_id
  65. </if>
  66. <if test="caseStatusList != null and caseStatusList.size() > 0">
  67. and c.case_status in
  68. <foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
  69. #{caseStatus}
  70. </foreach>
  71. </if>
  72. </where>
  73. order by c.create_time desc,c.case_num desc
  74. </select>
  75. <select id="selectCaseApplicationCount" parameterType="CaseApplication" resultType="int">
  76. select count(1) from case_application c
  77. <where>
  78. <if test="caseNum != null and caseNum != ''">
  79. AND c.case_num = #{caseNum}
  80. </if>
  81. </where>
  82. </select>
  83. <insert id="insertCaseApplication" parameterType="CaseApplication" useGeneratedKeys="true" keyProperty="id">
  84. insert into case_application(
  85. <if test="caseNum != null and caseNum != ''">case_num,</if>
  86. <if test="caseSubjectAmount != null">case_subject_amount,</if>
  87. register_date,
  88. <if test="arbitratMethod != null and arbitratMethod != ''">arbitrat_method,</if>
  89. <if test="caseStatus != null ">case_status,</if>
  90. <if test="hearDate != null ">hear_date,</if>
  91. <if test="arbitratClaims != null and arbitratClaims != ''">arbitrat_claims,</if>
  92. <if test="loanStartDate != null ">loan_start_date,</if>
  93. <if test="loanEndDate != null ">loan_end_date,</if>
  94. <if test="claimPrinciOwed != null ">claim_princi_owed,</if>
  95. <if test="claimInterestOwed != null ">claim_interest_owed,</if>
  96. <if test="claimLiquidDamag != null ">claim_liquid_damag,</if>
  97. <if test="feePayable != null ">fee_payable,</if>
  98. <if test="beginVideoDate != null ">begin_video_date,</if>
  99. <if test="onlineVideoPerson != null and onlineVideoPerson != ''">online_video_person,</if>
  100. <if test="contractNumber != null and contractNumber != ''">contract_number,</if>
  101. <if test="createBy != null and createBy != ''">create_by,</if>
  102. create_time
  103. )values(
  104. <if test="caseNum != null and caseNum != ''">#{caseNum},</if>
  105. <if test="caseSubjectAmount != null">#{caseSubjectAmount},</if>
  106. sysdate(),
  107. <if test="arbitratMethod != null and arbitratMethod != ''">#{arbitratMethod},</if>
  108. <if test="caseStatus != null ">#{caseStatus},</if>
  109. <if test="hearDate != null ">#{hearDate},</if>
  110. <if test="arbitratClaims != null and arbitratClaims != ''">#{arbitratClaims},</if>
  111. <if test="loanStartDate != null ">#{loanStartDate},</if>
  112. <if test="loanEndDate != null ">#{loanEndDate},</if>
  113. <if test="claimPrinciOwed != null ">#{claimPrinciOwed},</if>
  114. <if test="claimInterestOwed != null ">#{claimInterestOwed},</if>
  115. <if test="claimLiquidDamag != null ">#{claimLiquidDamag},</if>
  116. <if test="feePayable != null ">#{feePayable},</if>
  117. <if test="beginVideoDate != null ">#{beginVideoDate},</if>
  118. <if test="onlineVideoPerson != null and onlineVideoPerson != ''">#{onlineVideoPerson},</if>
  119. <if test="contractNumber != null and contractNumber != ''">#{contractNumber},</if>
  120. <if test="createBy != null and createBy != ''">#{createBy},</if>
  121. sysdate()
  122. )
  123. </insert>
  124. <update id="updataCaseApplication" parameterType="CaseApplication">
  125. update case_application
  126. <set>
  127. <if test="caseSubjectAmount != null">case_subject_amount = #{caseSubjectAmount},</if>
  128. <if test="registerDate != null">register_date = #{registerDate},</if>
  129. <if test="arbitratMethod != null and arbitratMethod != ''">arbitrat_method = #{arbitratMethod},</if>
  130. <if test="hearDate != null ">hear_date = #{hearDate},</if>
  131. <if test="arbitratClaims != null and arbitratClaims != ''">arbitrat_claims = #{arbitratClaims},</if>
  132. <if test="loanStartDate != null ">loan_start_date = #{loanStartDate},</if>
  133. <if test="loanEndDate != null ">loan_end_date = #{loanEndDate},</if>
  134. <if test="loanEndDate != null ">claim_princi_owed = #{claimPrinciOwed},</if>
  135. <if test="claimInterestOwed != null ">claim_interest_owed = #{claimInterestOwed},</if>
  136. <if test="claimLiquidDamag != null ">claim_liquid_damag = #{claimLiquidDamag},</if>
  137. <if test="feePayable != null ">fee_payable = #{feePayable},</if>
  138. <if test="beginVideoDate != null ">begin_video_date = #{beginVideoDate},</if>
  139. <if test="onlineVideoPerson != null and onlineVideoPerson != ''">online_video_person = #{onlineVideoPerson},</if>
  140. <if test="contractNumber != null and contractNumber != ''">contract_number = #{contractNumber},</if>
  141. <if test="caseName != null and caseName != ''">case_name = #{caseName},</if>
  142. <if test="caseDescribe != null and caseDescribe != ''">case_describe = #{caseDescribe},</if>
  143. <if test="caseResult != null and caseResult != ''">case_result = #{caseResult},</if>
  144. <if test="caseStatus != null">case_status = #{caseStatus},</if>
  145. <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  146. <if test="caseNum != null and caseNum != ''">case_num = #{caseNum},</if>
  147. update_time = sysdate()
  148. </set>
  149. where id = #{id}
  150. </update>
  151. <update id="submitCaseApplication" parameterType="CaseApplication">
  152. update case_application
  153. <set>
  154. <if test="caseStatus != null">case_status = #{caseStatus},</if>
  155. <if test="arbitratorId != null and arbitratorId != ''">arbitrator_id = #{arbitratorId},</if>
  156. <if test="arbitratorName != null and arbitratorName != ''">arbitrator_name = #{arbitratorName},</if>
  157. <if test="pendingAppointArbotrar != null ">pending_appoint_arbotrar = #{pendingAppointArbotrar},</if>
  158. <if test="arbitratMethod != null ">arbitrat_method = #{arbitratMethod},</if>
  159. <if test="caseName != null and caseName != ''">case_name = #{caseName},</if>
  160. <if test="caseDescribe != null and caseDescribe != ''">case_describe = #{caseDescribe},</if>
  161. <if test="caseResult != null and caseResult != ''">case_result = #{caseResult},</if>
  162. <if test="isAgreePendTral != null">is_agree_pend_tral = #{isAgreePendTral},</if>
  163. <if test="objectionAddEviden != null">objection_add_eviden = #{objectionAddEviden},</if>
  164. <if test="openCourtHear != null">open_court_hear = #{openCourtHear},</if>
  165. <if test="hearDate != null">hear_date = #{hearDate},</if>
  166. </set>
  167. where id = #{id}
  168. </update>
  169. <delete id="deletecaseApplication" parameterType="CaseApplication">
  170. delete from case_application where id = #{id}
  171. </delete>
  172. <select id="selectCaseApplication" parameterType="CaseApplication" resultMap="CaseApplicationResult">
  173. select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
  174. CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
  175. ELSE '无审理方式'
  176. END arbitratMethodName,
  177. c.case_status ,
  178. CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
  179. when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
  180. when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
  181. when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
  182. when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
  183. when 15 then '待仲裁文书送达' when 16 then '待案件归档'
  184. ELSE '无案件状态'
  185. END caseStatusName,
  186. c.hear_date ,c.arbitrat_claims ,
  187. c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
  188. c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
  189. c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,d.dept_name as applicantName
  190. from case_application c
  191. LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
  192. LEFT JOIN sys_dept d ON ca.NAME = d.dept_id and ca.name=d.dept_id
  193. <where>
  194. <if test="id != null ">
  195. AND c.id = #{id}
  196. </if>
  197. </where>
  198. </select>
  199. <select id="selectCaseApplicationConfirm" parameterType="CaseApplication" resultMap="CaseApplicationResult">
  200. select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
  201. CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
  202. ELSE '无审理方式'
  203. END arbitratMethodName,
  204. c.case_status ,
  205. CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
  206. when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
  207. when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
  208. when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
  209. when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
  210. when 15 then '待仲裁文书送达' when 16 then '待案件归档'
  211. ELSE '无案件状态'
  212. END caseStatusName,
  213. c.hear_date ,c.arbitrat_claims ,
  214. c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
  215. c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
  216. c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,
  217. p.payment_status ,
  218. CASE p.payment_status when 1 then '已支付' when 0 then '未支付'
  219. ELSE '无支付状态'
  220. END paymentStatusName
  221. from case_application c left join case_payment_record p on c.id = p.case_id
  222. where c.case_status = 3 and p.payment_status = 1
  223. AND c.id = #{id}
  224. </select>
  225. <select id="selectCaseNumLike" resultType="java.lang.Integer">
  226. select max(substring(case_num, #{length}+1,12)+1) as maxCaseNum
  227. from case_application where case_num like CONCAT(#{caseNum},'%') ;
  228. </select>
  229. <select id="selectArbitratorList" resultType="java.lang.String">
  230. select a.arbitrator_id id from case_application a where a.id=#{id}
  231. </select>
  232. </mapper>