You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

185 lines
5.9 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.example.demo.mapper.cash.CashRefundMapper">
  4. <insert id="insert">
  5. INSERT INTO cash_record (
  6. order_type,
  7. jwcode,
  8. name,
  9. market,
  10. activity,
  11. order_code,
  12. bank_code,
  13. goods_name,
  14. good_num,
  15. payment_currency,
  16. payment_amount,
  17. received_currency,
  18. received_amount,
  19. handling_charge,
  20. received_market,
  21. pay_type,
  22. pay_time,
  23. received_time,
  24. status,
  25. submitter_id,
  26. voucher,
  27. remark,
  28. refund_reason,
  29. refund_model,
  30. executor,
  31. refund_channels,
  32. refund_time,
  33. refund_remark,
  34. refund_voucher,
  35. create_time,
  36. update_time
  37. ) VALUES (
  38. #{orderType},
  39. #{jwcode},
  40. #{name},
  41. #{market},
  42. #{activity},
  43. #{orderCode},
  44. #{bankCode},
  45. #{goodsName},
  46. #{goodsNum},
  47. #{paymentCurrency},
  48. #{paymentAmount},
  49. #{receivedCurrency},
  50. #{receivedAmount},
  51. #{handlingCharge},
  52. #{receivedMarket},
  53. #{payType},
  54. #{payTime},
  55. #{receivedTime},
  56. #{submitterId},
  57. #{voucher},
  58. #{remark},
  59. #{status},
  60. #{refundReason},
  61. #{refundModel},
  62. #{executor},
  63. #{refundChannels},
  64. #{refundCurrency},
  65. #{refundAmount},
  66. #{refundTime},
  67. #{refundRemark},
  68. #{refundVoucher},
  69. #{createTime},
  70. #{updateTime},
  71. );
  72. </insert>
  73. <update id="update">
  74. update cash_record
  75. set
  76. status = 10,
  77. refund_model = #{refundModel},
  78. refund_reason = #{refundReason}
  79. where id = #{id}
  80. </update>
  81. <update id="withdraw">
  82. update cash_record set status = 11
  83. where order_type =2 and id = #{id}
  84. </update>
  85. <update id="review">
  86. update cash_record set status = #{status},executor = #{executor},reject_reason = #{rejectReason}
  87. where order_type =2 and id = #{id}
  88. </update>
  89. <update id="executor">
  90. update cash_record set refund_currency = #{refundCurrency},
  91. refund_amount = #{refundAmount},
  92. refund_channels = #{refundChannels},
  93. refund_time = #{refundTime},
  94. refund_remark = #{refundRemark},
  95. refund_voucher = #{refundVoucher},
  96. status = #{status}
  97. where order_type =2 and id = #{id}
  98. </update>
  99. <select id="select" resultType="com.example.demo.domain.vo.cash.CashRecordDone">
  100. select
  101. cr.id,
  102. cr.order_type,
  103. cr.jwcode,
  104. cr.name,
  105. cr.market,
  106. cr.activity,
  107. cr.order_code,
  108. cr.bank_code,
  109. cr.goods_name,
  110. cr.good_num,
  111. cr.payment_currency,
  112. cr.payment_amount,
  113. cr.received_currency,
  114. cr.received_amount,
  115. cr.handling_charge,
  116. cr.pay_type,
  117. cr.received_market,
  118. cr.pay_time,
  119. cr.received_time,
  120. cr.audit_id,
  121. cr.status,
  122. cr.submitter_id,
  123. cr.voucher,
  124. cr.refund_reason,
  125. cr.refund_model,
  126. cr.executor,
  127. cr.refund_channels,
  128. cr.refund_time,
  129. cr.refund_remark,
  130. cr.refund_voucher,
  131. cr.remark,
  132. cr.reject_reason,
  133. cr.create_time,
  134. cr.update_time,
  135. cr.audit_time,
  136. a1.admin_name as submitterName,
  137. a2.admin_name as auditName,
  138. a3.admin_name as executorName,
  139. m.name as marketName
  140. from cash_record cr
  141. left join admin a1 on submitter_id = a1.id
  142. left join admin a2 on audit_id = a2.id
  143. left join admin a3 on executor = a3.account
  144. left join market m on m.id = cr.market
  145. <where>
  146. cr.order_type = 2
  147. <if test="status != null">
  148. and cr.status = #{status}
  149. </if>
  150. <if test="orderCode != null">
  151. and cr.order_code = #{orderCode}
  152. </if>
  153. <if test="name != null and name.length() > 0">
  154. and cr.name = #{name}
  155. </if>
  156. <if test="jwcode != null">
  157. and cr.jwcode = #{jwcode}
  158. </if>
  159. <if test="markets!= null and markets.size > 0">
  160. AND cr.market IN
  161. <foreach collection="markets" item="markets" open="(" separator="," close=")">
  162. #{markets}
  163. </foreach>
  164. </if>
  165. <if test="paymentCurrency!= null and paymentCurrency.length() > 0">
  166. AND cr.payment_currency = #{paymentCurrency}
  167. </if>
  168. <if test="goodsName != null and goodsName.length()>0">
  169. and cr.goods_name = #{goodsName}
  170. </if>
  171. <if test="payType != null and payType.length()>0">
  172. and cr.pay_type = #{payTyoe}
  173. </if>
  174. <if test="refundModel != null and refundModel.length()>0">
  175. and cr.refundModel = #{refundModel}
  176. </if>
  177. <if test="startTime != null and endTime != null">
  178. and cr.`pay_time` BETWEEN #{startTime} AND #{endTime}
  179. </if>
  180. </where>
  181. </select>
  182. </mapper>