PaymentInfoMapper.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  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.xingxi.business.PaymentInfo.mapper.PaymentInfoMapper">
  4. <resultMap type="PaymentInfo" id="PaymentInfoResult">
  5. <result property="payId" column="payId" />
  6. <result property="delFlag" column="delFlag" />
  7. <result property="createUser" column="createUser" />
  8. <result property="createTime" column="createTime" />
  9. <result property="updateUser" column="updateUser" />
  10. <result property="updateTime" column="updateTime" />
  11. <result property="orderId" column="orderId" />
  12. <result property="orderNo" column="orderNo" />
  13. <result property="payTime" column="payTime" />
  14. <result property="sellerId" column="sellerId" />
  15. <result property="description" column="description" />
  16. <result property="outTradeNo" column="outTradeNo" />
  17. <result property="notifyUrl" column="notifyUrl" />
  18. <result property="amountTotal" column="amountTotal" />
  19. <result property="payerOpenid" column="payerOpenid" />
  20. <result property="prepayId" column="prepayId" />
  21. <result property="notifyId" column="notifyId" />
  22. <result property="notifyTime" column="notifyTime" />
  23. <result property="eventType" column="eventType" />
  24. <result property="transactionId" column="transactionId" />
  25. <result property="tradeType" column="tradeType" />
  26. <result property="tradeState" column="tradeState" />
  27. <result property="tradeStateDesc" column="tradeStateDesc" />
  28. <result property="bankType" column="bankType" />
  29. <result property="successTime" column="successTime" />
  30. </resultMap>
  31. <sql id="selectPaymentInfo">
  32. select payId, delFlag, createUser, createTime, updateUser, updateTime, orderId, orderNo, payTime, sellerId, description, outTradeNo, notifyUrl, amountTotal, payerOpenid, prepayId, notifyId, notifyTime, eventType, transactionId, tradeType, tradeState, tradeStateDesc, bankType, successTime from t_payment_info
  33. </sql>
  34. <sql id="selectPaymentInfoExt">
  35. select
  36. ${tableAlias}.payId,
  37. ${tableAlias}.delFlag,
  38. ${tableAlias}.createUser,
  39. ${tableAlias}.createTime,
  40. ${tableAlias}.updateUser,
  41. ${tableAlias}.updateTime,
  42. ${tableAlias}.orderId,
  43. ${tableAlias}.orderNo,
  44. ${tableAlias}.payTime,
  45. ${tableAlias}.sellerId,
  46. ${tableAlias}.description,
  47. ${tableAlias}.outTradeNo,
  48. ${tableAlias}.notifyUrl,
  49. ${tableAlias}.amountTotal,
  50. ${tableAlias}.payerOpenid,
  51. ${tableAlias}.prepayId,
  52. ${tableAlias}.notifyId,
  53. ${tableAlias}.notifyTime,
  54. ${tableAlias}.eventType,
  55. ${tableAlias}.transactionId,
  56. ${tableAlias}.tradeType,
  57. ${tableAlias}.tradeState,
  58. ${tableAlias}.tradeStateDesc,
  59. ${tableAlias}.bankType,
  60. ${tableAlias}.successTime
  61. from t_payment_info ${tableAlias}
  62. </sql>
  63. <select id="selectPaymentInfoList" parameterType="PaymentInfo" resultMap="PaymentInfoResult">
  64. <include refid="selectPaymentInfo"/>
  65. <where>
  66. <if test="delFlag != null and delFlag != ''"> and delFlag = #{delFlag}</if>
  67. <if test="createUser != null and createUser != ''"> and createUser = #{createUser}</if>
  68. <if test="createTime != null "> and createTime = #{createTime}</if>
  69. <if test="updateUser != null and updateUser != ''"> and updateUser = #{updateUser}</if>
  70. <if test="updateTime != null "> and updateTime = #{updateTime}</if>
  71. <if test="orderId != null "> and orderId = #{orderId}</if>
  72. <if test="orderNo != null and orderNo != ''"> and orderNo = #{orderNo}</if>
  73. <if test="payTime != null "> and payTime = #{payTime}</if>
  74. <if test="sellerId != null "> and sellerId = #{sellerId}</if>
  75. <if test="description != null and description != ''"> and description = #{description}</if>
  76. <if test="outTradeNo != null and outTradeNo != ''"> and outTradeNo = #{outTradeNo}</if>
  77. <if test="notifyUrl != null and notifyUrl != ''"> and notifyUrl = #{notifyUrl}</if>
  78. <if test="amountTotal != null "> and amountTotal = #{amountTotal}</if>
  79. <if test="payerOpenid != null and payerOpenid != ''"> and payerOpenid = #{payerOpenid}</if>
  80. <if test="prepayId != null and prepayId != ''"> and prepayId = #{prepayId}</if>
  81. <if test="notifyId != null and notifyId != ''"> and notifyId = #{notifyId}</if>
  82. <if test="notifyTime != null "> and notifyTime = #{notifyTime}</if>
  83. <if test="eventType != null and eventType != ''"> and eventType = #{eventType}</if>
  84. <if test="transactionId != null and transactionId != ''"> and transactionId = #{transactionId}</if>
  85. <if test="tradeType != null and tradeType != ''"> and tradeType = #{tradeType}</if>
  86. <if test="tradeState != null and tradeState != ''"> and tradeState = #{tradeState}</if>
  87. <if test="tradeStateDesc != null and tradeStateDesc != ''"> and tradeStateDesc = #{tradeStateDesc}</if>
  88. <if test="bankType != null and bankType != ''"> and bankType = #{bankType}</if>
  89. <if test="successTime != null "> and successTime = #{successTime}</if>
  90. </where>
  91. </select>
  92. <select id="selectPaymentInfoByPayId" parameterType="Long" resultMap="PaymentInfoResult">
  93. <include refid="selectPaymentInfo"/>
  94. where payId = #{payId}
  95. </select>
  96. <insert id="insertPaymentInfo" parameterType="PaymentInfo" useGeneratedKeys="true" keyProperty="payId">
  97. insert into t_payment_info
  98. <trim prefix="(" suffix=")" suffixOverrides=",">
  99. <if test="delFlag != null">delFlag,</if>
  100. <if test="createUser != null">createUser,</if>
  101. <if test="createTime != null">createTime,</if>
  102. <if test="updateUser != null">updateUser,</if>
  103. <if test="updateTime != null">updateTime,</if>
  104. <if test="orderId != null">orderId,</if>
  105. <if test="orderNo != null">orderNo,</if>
  106. <if test="payTime != null">payTime,</if>
  107. <if test="sellerId != null">sellerId,</if>
  108. <if test="description != null">description,</if>
  109. <if test="outTradeNo != null">outTradeNo,</if>
  110. <if test="notifyUrl != null">notifyUrl,</if>
  111. <if test="amountTotal != null">amountTotal,</if>
  112. <if test="payerOpenid != null">payerOpenid,</if>
  113. <if test="prepayId != null">prepayId,</if>
  114. <if test="notifyId != null">notifyId,</if>
  115. <if test="notifyTime != null">notifyTime,</if>
  116. <if test="eventType != null">eventType,</if>
  117. <if test="transactionId != null">transactionId,</if>
  118. <if test="tradeType != null">tradeType,</if>
  119. <if test="tradeState != null">tradeState,</if>
  120. <if test="tradeStateDesc != null">tradeStateDesc,</if>
  121. <if test="bankType != null">bankType,</if>
  122. <if test="successTime != null">successTime,</if>
  123. </trim>
  124. <trim prefix="values (" suffix=")" suffixOverrides=",">
  125. <if test="delFlag != null">#{delFlag},</if>
  126. <if test="createUser != null">#{createUser},</if>
  127. <if test="createTime != null">#{createTime},</if>
  128. <if test="updateUser != null">#{updateUser},</if>
  129. <if test="updateTime != null">#{updateTime},</if>
  130. <if test="orderId != null">#{orderId},</if>
  131. <if test="orderNo != null">#{orderNo},</if>
  132. <if test="payTime != null">#{payTime},</if>
  133. <if test="sellerId != null">#{sellerId},</if>
  134. <if test="description != null">#{description},</if>
  135. <if test="outTradeNo != null">#{outTradeNo},</if>
  136. <if test="notifyUrl != null">#{notifyUrl},</if>
  137. <if test="amountTotal != null">#{amountTotal},</if>
  138. <if test="payerOpenid != null">#{payerOpenid},</if>
  139. <if test="prepayId != null">#{prepayId},</if>
  140. <if test="notifyId != null">#{notifyId},</if>
  141. <if test="notifyTime != null">#{notifyTime},</if>
  142. <if test="eventType != null">#{eventType},</if>
  143. <if test="transactionId != null">#{transactionId},</if>
  144. <if test="tradeType != null">#{tradeType},</if>
  145. <if test="tradeState != null">#{tradeState},</if>
  146. <if test="tradeStateDesc != null">#{tradeStateDesc},</if>
  147. <if test="bankType != null">#{bankType},</if>
  148. <if test="successTime != null">#{successTime},</if>
  149. </trim>
  150. </insert>
  151. <insert id="batchInsertPaymentInfo">
  152. insert into t_payment_info( delFlag, createUser, createTime, updateUser, updateTime, orderId, orderNo, payTime, sellerId, description, outTradeNo, notifyUrl, amountTotal, payerOpenid, prepayId, notifyId, notifyTime, eventType, transactionId, tradeType, tradeState, tradeStateDesc, bankType, successTime) values
  153. <foreach item="item" index="index" collection="list" separator=",">
  154. ( #{item.delFlag}, #{item.createUser}, #{item.createTime}, #{item.updateUser}, #{item.updateTime}, #{item.orderId}, #{item.orderNo}, #{item.payTime}, #{item.sellerId}, #{item.description}, #{item.outTradeNo}, #{item.notifyUrl}, #{item.amountTotal}, #{item.payerOpenid}, #{item.prepayId}, #{item.notifyId}, #{item.notifyTime}, #{item.eventType}, #{item.transactionId}, #{item.tradeType}, #{item.tradeState}, #{item.tradeStateDesc}, #{item.bankType}, #{item.successTime})
  155. </foreach>
  156. </insert>
  157. <update id="updatePaymentInfo" parameterType="PaymentInfo">
  158. update t_payment_info
  159. <trim prefix="SET" suffixOverrides=",">
  160. <if test="delFlag != null">delFlag = #{delFlag},</if>
  161. <if test="createUser != null">createUser = #{createUser},</if>
  162. <if test="createTime != null">createTime = #{createTime},</if>
  163. <if test="updateUser != null">updateUser = #{updateUser},</if>
  164. <if test="updateTime != null">updateTime = #{updateTime},</if>
  165. <if test="orderId != null">orderId = #{orderId},</if>
  166. <if test="orderNo != null">orderNo = #{orderNo},</if>
  167. <if test="payTime != null">payTime = #{payTime},</if>
  168. <if test="sellerId != null">sellerId = #{sellerId},</if>
  169. <if test="description != null">description = #{description},</if>
  170. <if test="outTradeNo != null">outTradeNo = #{outTradeNo},</if>
  171. <if test="notifyUrl != null">notifyUrl = #{notifyUrl},</if>
  172. <if test="amountTotal != null">amountTotal = #{amountTotal},</if>
  173. <if test="payerOpenid != null">payerOpenid = #{payerOpenid},</if>
  174. <if test="prepayId != null">prepayId = #{prepayId},</if>
  175. <if test="notifyId != null">notifyId = #{notifyId},</if>
  176. <if test="notifyTime != null">notifyTime = #{notifyTime},</if>
  177. <if test="eventType != null">eventType = #{eventType},</if>
  178. <if test="transactionId != null">transactionId = #{transactionId},</if>
  179. <if test="tradeType != null">tradeType = #{tradeType},</if>
  180. <if test="tradeState != null">tradeState = #{tradeState},</if>
  181. <if test="tradeStateDesc != null">tradeStateDesc = #{tradeStateDesc},</if>
  182. <if test="bankType != null">bankType = #{bankType},</if>
  183. <if test="successTime != null">successTime = #{successTime},</if>
  184. </trim>
  185. where payId = #{payId}
  186. </update>
  187. <delete id="deletePaymentInfoByPayId" parameterType="Long">
  188. delete from t_payment_info where payId = #{payId}
  189. </delete>
  190. <delete id="deletePaymentInfoByPayIds" parameterType="String">
  191. delete from t_payment_info where payId in
  192. <foreach item="payId" collection="array" open="(" separator="," close=")">
  193. #{payId}
  194. </foreach>
  195. </delete>
  196. <update id="logicDeletePaymentInfoByPayId" parameterType="Long">
  197. update t_payment_info
  198. set delFlag = '1'
  199. where payId = #{payId}
  200. </update>
  201. <update id="logicDeletePaymentInfoByPayIds" parameterType="String">
  202. update t_payment_info
  203. set delFlag = '1'
  204. where payId in
  205. <foreach item="payId" collection="array" open="(" separator="," close=")">
  206. #{payId}
  207. </foreach>
  208. </update>
  209. <update id="logicDeletePaymentInfoByCondition" parameterType="PaymentInfo">
  210. update t_payment_info
  211. set delFlag = '1'
  212. <where>
  213. <if test="delFlag != null and delFlag != ''"> and delFlag = #{delFlag}</if>
  214. <if test="createUser != null and createUser != ''"> and createUser = #{createUser}</if>
  215. <if test="createTime != null "> and createTime = #{createTime}</if>
  216. <if test="updateUser != null and updateUser != ''"> and updateUser = #{updateUser}</if>
  217. <if test="updateTime != null "> and updateTime = #{updateTime}</if>
  218. <if test="orderId != null "> and orderId = #{orderId}</if>
  219. <if test="orderNo != null and orderNo != ''"> and orderNo = #{orderNo}</if>
  220. <if test="payTime != null "> and payTime = #{payTime}</if>
  221. <if test="sellerId != null "> and sellerId = #{sellerId}</if>
  222. <if test="description != null and description != ''"> and description = #{description}</if>
  223. <if test="outTradeNo != null and outTradeNo != ''"> and outTradeNo = #{outTradeNo}</if>
  224. <if test="notifyUrl != null and notifyUrl != ''"> and notifyUrl = #{notifyUrl}</if>
  225. <if test="amountTotal != null "> and amountTotal = #{amountTotal}</if>
  226. <if test="payerOpenid != null and payerOpenid != ''"> and payerOpenid = #{payerOpenid}</if>
  227. <if test="prepayId != null and prepayId != ''"> and prepayId = #{prepayId}</if>
  228. <if test="notifyId != null and notifyId != ''"> and notifyId = #{notifyId}</if>
  229. <if test="notifyTime != null "> and notifyTime = #{notifyTime}</if>
  230. <if test="eventType != null and eventType != ''"> and eventType = #{eventType}</if>
  231. <if test="transactionId != null and transactionId != ''"> and transactionId = #{transactionId}</if>
  232. <if test="tradeType != null and tradeType != ''"> and tradeType = #{tradeType}</if>
  233. <if test="tradeState != null and tradeState != ''"> and tradeState = #{tradeState}</if>
  234. <if test="tradeStateDesc != null and tradeStateDesc != ''"> and tradeStateDesc = #{tradeStateDesc}</if>
  235. <if test="bankType != null and bankType != ''"> and bankType = #{bankType}</if>
  236. <if test="successTime != null "> and successTime = #{successTime}</if>
  237. </where>
  238. </update>
  239. </mapper>