RefundInfoMapper.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  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.xingxi.business.RefundInfo.mapper.RefundInfoMapper">
  6. <resultMap type="RefundInfo" id="RefundInfoResult">
  7. <result property="id" column="id" />
  8. <result property="delFlag" column="delFlag" />
  9. <result property="createUser" column="createUser" />
  10. <result property="createTime" column="createTime" />
  11. <result property="updateUser" column="updateUser" />
  12. <result property="updateTime" column="updateTime" />
  13. <result property="transactionId" column="transactionId" />
  14. <result property="outTradeNo" column="outTradeNo" />
  15. <result property="outRefundNo" column="outRefundNo" />
  16. <result property="reason" column="reason" />
  17. <result property="notifyUrl" column="notifyUrl" />
  18. <result property="amountRefund" column="amountRefund" />
  19. <result property="amountTotal" column="amountTotal" />
  20. <result property="refundId" column="refundId" />
  21. <result property="channel" column="channel" />
  22. <result property="userReceivedAccount" column="userReceivedAccount" />
  23. <result property="successTime" column="successTime" />
  24. <result property="refundTime" column="refundTime" />
  25. <result property="status" column="status" />
  26. <result property="fundsAccount" column="fundsAccount" />
  27. <result property="payerTotal" column="payerTotal" />
  28. <result property="payerRefund" column="payerRefund" />
  29. <result property="settlementRefund" column="settlementRefund" />
  30. <result property="settlementTotal" column="settlementTotal" />
  31. <result property="discountRefund" column="discountRefund" />
  32. </resultMap>
  33. <sql id="selectRefundInfoVo">
  34. select id, delFlag, createUser, createTime, updateUser, updateTime, transactionId, outTradeNo, outRefundNo, reason, notifyUrl, amountRefund, amountTotal, refundId, channel, userReceivedAccount, successTime, refundTime, status, fundsAccount, payerTotal, payerRefund, settlementRefund, settlementTotal, discountRefund from t_refund_info
  35. </sql>
  36. <select id="selectRefundInfoList" parameterType="RefundInfo" resultMap="RefundInfoResult">
  37. <include refid="selectRefundInfoVo"/>
  38. <where>
  39. <if test="delFlag != null and delFlag != ''"> and delFlag = #{delFlag}</if>
  40. <if test="createUser != null and createUser != ''"> and createUser = #{createUser}</if>
  41. <if test="createTime != null "> and createTime = #{createTime}</if>
  42. <if test="updateUser != null and updateUser != ''"> and updateUser = #{updateUser}</if>
  43. <if test="updateTime != null "> and updateTime = #{updateTime}</if>
  44. <if test="transactionId != null and transactionId != ''"> and transactionId = #{transactionId}</if>
  45. <if test="outTradeNo != null and outTradeNo != ''"> and outTradeNo = #{outTradeNo}</if>
  46. <if test="outRefundNo != null and outRefundNo != ''"> and outRefundNo = #{outRefundNo}</if>
  47. <if test="reason != null and reason != ''"> and reason = #{reason}</if>
  48. <if test="notifyUrl != null and notifyUrl != ''"> and notifyUrl = #{notifyUrl}</if>
  49. <if test="amountRefund != null "> and amountRefund = #{amountRefund}</if>
  50. <if test="amountTotal != null "> and amountTotal = #{amountTotal}</if>
  51. <if test="refundId != null and refundId != ''"> and refundId = #{refundId}</if>
  52. <if test="channel != null and channel != ''"> and channel = #{channel}</if>
  53. <if test="userReceivedAccount != null and userReceivedAccount != ''"> and userReceivedAccount = #{userReceivedAccount}</if>
  54. <if test="successTime != null "> and successTime = #{successTime}</if>
  55. <if test="refundTime != null and refundTime != ''"> and refundTime = #{refundTime}</if>
  56. <if test="status != null and status != ''"> and status = #{status}</if>
  57. <if test="fundsAccount != null and fundsAccount != ''"> and fundsAccount = #{fundsAccount}</if>
  58. <if test="payerTotal != null "> and payerTotal = #{payerTotal}</if>
  59. <if test="payerRefund != null "> and payerRefund = #{payerRefund}</if>
  60. <if test="settlementRefund != null "> and settlementRefund = #{settlementRefund}</if>
  61. <if test="settlementTotal != null "> and settlementTotal = #{settlementTotal}</if>
  62. <if test="discountRefund != null "> and discountRefund = #{discountRefund}</if>
  63. </where>
  64. </select>
  65. <select id="selectRefundInfoById" parameterType="Long" resultMap="RefundInfoResult">
  66. <include refid="selectRefundInfoVo"/>
  67. where id = #{id}
  68. </select>
  69. <insert id="insertRefundInfo" parameterType="RefundInfo" useGeneratedKeys="true" keyProperty="id">
  70. insert into t_refund_info
  71. <trim prefix="(" suffix=")" suffixOverrides=",">
  72. <if test="delFlag != null">delFlag,</if>
  73. <if test="createUser != null">createUser,</if>
  74. <if test="createTime != null">createTime,</if>
  75. <if test="updateUser != null">updateUser,</if>
  76. <if test="updateTime != null">updateTime,</if>
  77. <if test="transactionId != null">transactionId,</if>
  78. <if test="outTradeNo != null">outTradeNo,</if>
  79. <if test="outRefundNo != null">outRefundNo,</if>
  80. <if test="reason != null">reason,</if>
  81. <if test="notifyUrl != null">notifyUrl,</if>
  82. <if test="amountRefund != null">amountRefund,</if>
  83. <if test="amountTotal != null">amountTotal,</if>
  84. <if test="refundId != null">refundId,</if>
  85. <if test="channel != null">channel,</if>
  86. <if test="userReceivedAccount != null">userReceivedAccount,</if>
  87. <if test="successTime != null">successTime,</if>
  88. <if test="refundTime != null">refundTime,</if>
  89. <if test="status != null">status,</if>
  90. <if test="fundsAccount != null">fundsAccount,</if>
  91. <if test="payerTotal != null">payerTotal,</if>
  92. <if test="payerRefund != null">payerRefund,</if>
  93. <if test="settlementRefund != null">settlementRefund,</if>
  94. <if test="settlementTotal != null">settlementTotal,</if>
  95. <if test="discountRefund != null">discountRefund,</if>
  96. </trim>
  97. <trim prefix="values (" suffix=")" suffixOverrides=",">
  98. <if test="delFlag != null">#{delFlag},</if>
  99. <if test="createUser != null">#{createUser},</if>
  100. <if test="createTime != null">#{createTime},</if>
  101. <if test="updateUser != null">#{updateUser},</if>
  102. <if test="updateTime != null">#{updateTime},</if>
  103. <if test="transactionId != null">#{transactionId},</if>
  104. <if test="outTradeNo != null">#{outTradeNo},</if>
  105. <if test="outRefundNo != null">#{outRefundNo},</if>
  106. <if test="reason != null">#{reason},</if>
  107. <if test="notifyUrl != null">#{notifyUrl},</if>
  108. <if test="amountRefund != null">#{amountRefund},</if>
  109. <if test="amountTotal != null">#{amountTotal},</if>
  110. <if test="refundId != null">#{refundId},</if>
  111. <if test="channel != null">#{channel},</if>
  112. <if test="userReceivedAccount != null">#{userReceivedAccount},</if>
  113. <if test="successTime != null">#{successTime},</if>
  114. <if test="refundTime != null">#{refundTime},</if>
  115. <if test="status != null">#{status},</if>
  116. <if test="fundsAccount != null">#{fundsAccount},</if>
  117. <if test="payerTotal != null">#{payerTotal},</if>
  118. <if test="payerRefund != null">#{payerRefund},</if>
  119. <if test="settlementRefund != null">#{settlementRefund},</if>
  120. <if test="settlementTotal != null">#{settlementTotal},</if>
  121. <if test="discountRefund != null">#{discountRefund},</if>
  122. </trim>
  123. </insert>
  124. <insert id="batchInsertRefundInfo">
  125. insert into t_refund_info( delFlag, createUser, createTime, updateUser, updateTime, transactionId, outTradeNo, outRefundNo, reason, notifyUrl, amountRefund, amountTotal, refundId, channel, userReceivedAccount, successTime, refundTime, status, fundsAccount, payerTotal, payerRefund, settlementRefund, settlementTotal, discountRefund) values
  126. <foreach item="item" index="index" collection="list" separator=",">
  127. ( #{item.delFlag}, #{item.createUser}, #{item.createTime}, #{item.updateUser}, #{item.updateTime}, #{item.transactionId}, #{item.outTradeNo}, #{item.outRefundNo}, #{item.reason}, #{item.notifyUrl}, #{item.amountRefund}, #{item.amountTotal}, #{item.refundId}, #{item.channel}, #{item.userReceivedAccount}, #{item.successTime}, #{item.refundTime}, #{item.status}, #{item.fundsAccount}, #{item.payerTotal}, #{item.payerRefund}, #{item.settlementRefund}, #{item.settlementTotal}, #{item.discountRefund})
  128. </foreach>
  129. </insert>
  130. <update id="updateRefundInfo" parameterType="RefundInfo">
  131. update t_refund_info
  132. <trim prefix="SET" suffixOverrides=",">
  133. <if test="delFlag != null">delFlag = #{delFlag},</if>
  134. <if test="createUser != null">createUser = #{createUser},</if>
  135. <if test="createTime != null">createTime = #{createTime},</if>
  136. <if test="updateUser != null">updateUser = #{updateUser},</if>
  137. <if test="updateTime != null">updateTime = #{updateTime},</if>
  138. <if test="transactionId != null">transactionId = #{transactionId},</if>
  139. <if test="outTradeNo != null">outTradeNo = #{outTradeNo},</if>
  140. <if test="outRefundNo != null">outRefundNo = #{outRefundNo},</if>
  141. <if test="reason != null">reason = #{reason},</if>
  142. <if test="notifyUrl != null">notifyUrl = #{notifyUrl},</if>
  143. <if test="amountRefund != null">amountRefund = #{amountRefund},</if>
  144. <if test="amountTotal != null">amountTotal = #{amountTotal},</if>
  145. <if test="refundId != null">refundId = #{refundId},</if>
  146. <if test="channel != null">channel = #{channel},</if>
  147. <if test="userReceivedAccount != null">userReceivedAccount = #{userReceivedAccount},</if>
  148. <if test="successTime != null">successTime = #{successTime},</if>
  149. <if test="refundTime != null">refundTime = #{refundTime},</if>
  150. <if test="status != null">status = #{status},</if>
  151. <if test="fundsAccount != null">fundsAccount = #{fundsAccount},</if>
  152. <if test="payerTotal != null">payerTotal = #{payerTotal},</if>
  153. <if test="payerRefund != null">payerRefund = #{payerRefund},</if>
  154. <if test="settlementRefund != null">settlementRefund = #{settlementRefund},</if>
  155. <if test="settlementTotal != null">settlementTotal = #{settlementTotal},</if>
  156. <if test="discountRefund != null">discountRefund = #{discountRefund},</if>
  157. </trim>
  158. where id = #{id}
  159. </update>
  160. <delete id="deleteRefundInfoById" parameterType="Long">
  161. delete from t_refund_info where id = #{id}
  162. </delete>
  163. <delete id="deleteRefundInfoByIds" parameterType="String">
  164. delete from t_refund_info where id in
  165. <foreach item="id" collection="array" open="(" separator="," close=")">
  166. #{id}
  167. </foreach>
  168. </delete>
  169. <update id="logicDeleteRefundInfoById" parameterType="Long">
  170. update t_refund_info
  171. set delFlag = '1'
  172. where id = #{id}
  173. </update>
  174. <update id="logicDeleteRefundInfoByIds" parameterType="String">
  175. update t_refund_info
  176. set delFlag = '1'
  177. where id in
  178. <foreach item="id" collection="array" open="(" separator="," close=")">
  179. #{id}
  180. </foreach>
  181. </update>
  182. <update id="logicDeleteRefundInfoByCondition" parameterType="RefundInfo">
  183. update t_refund_info
  184. set delFlag = '1'
  185. <where>
  186. <if test="delFlag != null and delFlag != ''"> and delFlag = #{delFlag}</if>
  187. <if test="createUser != null and createUser != ''"> and createUser = #{createUser}</if>
  188. <if test="createTime != null "> and createTime = #{createTime}</if>
  189. <if test="updateUser != null and updateUser != ''"> and updateUser = #{updateUser}</if>
  190. <if test="updateTime != null "> and updateTime = #{updateTime}</if>
  191. <if test="transactionId != null and transactionId != ''"> and transactionId = #{transactionId}</if>
  192. <if test="outTradeNo != null and outTradeNo != ''"> and outTradeNo = #{outTradeNo}</if>
  193. <if test="outRefundNo != null and outRefundNo != ''"> and outRefundNo = #{outRefundNo}</if>
  194. <if test="reason != null and reason != ''"> and reason = #{reason}</if>
  195. <if test="notifyUrl != null and notifyUrl != ''"> and notifyUrl = #{notifyUrl}</if>
  196. <if test="amountRefund != null "> and amountRefund = #{amountRefund}</if>
  197. <if test="amountTotal != null "> and amountTotal = #{amountTotal}</if>
  198. <if test="refundId != null and refundId != ''"> and refundId = #{refundId}</if>
  199. <if test="channel != null and channel != ''"> and channel = #{channel}</if>
  200. <if test="userReceivedAccount != null and userReceivedAccount != ''"> and userReceivedAccount = #{userReceivedAccount}</if>
  201. <if test="successTime != null "> and successTime = #{successTime}</if>
  202. <if test="refundTime != null and refundTime != ''"> and refundTime = #{refundTime}</if>
  203. <if test="status != null and status != ''"> and status = #{status}</if>
  204. <if test="fundsAccount != null and fundsAccount != ''"> and fundsAccount = #{fundsAccount}</if>
  205. <if test="payerTotal != null "> and payerTotal = #{payerTotal}</if>
  206. <if test="payerRefund != null "> and payerRefund = #{payerRefund}</if>
  207. <if test="settlementRefund != null "> and settlementRefund = #{settlementRefund}</if>
  208. <if test="settlementTotal != null "> and settlementTotal = #{settlementTotal}</if>
  209. <if test="discountRefund != null "> and discountRefund = #{discountRefund}</if>
  210. </where>
  211. </update>
  212. </mapper>