UserOrderPaymentMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  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.yonge.cooleshow.mbg.mapper.UserOrderPaymentMapper">
  4. <resultMap id="BaseResultMap" type="com.yonge.cooleshow.mbg.model.UserOrderPayment">
  5. <!--@mbg.generated-->
  6. <!--@Table user_order_payment-->
  7. <id column="id_" jdbcType="BIGINT" property="id" />
  8. <result column="order_no_" jdbcType="VARCHAR" property="orderNo" />
  9. <result column="payment_client_" jdbcType="VARCHAR" property="paymentClient" />
  10. <result column="trans_no_" jdbcType="VARCHAR" property="transNo" />
  11. <result column="open_type_" jdbcType="VARCHAR" property="openType" />
  12. <result column="pay_channel_" jdbcType="VARCHAR" property="payChannel" />
  13. <result column="pay_amt_" jdbcType="DECIMAL" property="payAmt" />
  14. <result column="fee_amt_" jdbcType="DECIMAL" property="feeAmt" />
  15. <result column="pay_info_" jdbcType="VARCHAR" property="payInfo" />
  16. <result column="status_" jdbcType="VARCHAR" property="status" />
  17. <result column="pay_fail_msg_" jdbcType="VARCHAR" property="payFailMsg" />
  18. <result column="arrival_time_" jdbcType="TIMESTAMP" property="arrivalTime" />
  19. <result column="close_status_" jdbcType="TIMESTAMP" property="closeStatus" />
  20. <result column="close_fail_msg_" jdbcType="TIMESTAMP" property="closeFailMsg" />
  21. <result column="close_time_" jdbcType="TIMESTAMP" property="closeTime" />
  22. <result column="adapay_no_" jdbcType="TIMESTAMP" property="adapayNo" />
  23. <result column="create_time_" jdbcType="TIMESTAMP" property="createTime" />
  24. <result column="update_time_" jdbcType="TIMESTAMP" property="updateTime" />
  25. </resultMap>
  26. <sql id="Base_Column_List">
  27. <!--@mbg.generated-->
  28. id_, order_no_, trans_no_, pay_channel_, pay_amt_, fee_amt_, pay_info_, status_,
  29. pay_fail_msg_, arrival_time_,close_status_,close_fail_msg_,close_time_,create_time_, update_time_,adapay_no_,open_type_,payment_client_
  30. </sql>
  31. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  32. <!--@mbg.generated-->
  33. select
  34. <include refid="Base_Column_List" />
  35. from user_order_payment
  36. where id_ = #{id,jdbcType=BIGINT}
  37. </select>
  38. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  39. <!--@mbg.generated-->
  40. delete from user_order_payment
  41. where id_ = #{id,jdbcType=BIGINT}
  42. </delete>
  43. <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.yonge.cooleshow.mbg.model.UserOrderPayment" useGeneratedKeys="true">
  44. <!--@mbg.generated-->
  45. insert into user_order_payment (order_no_, trans_no_, pay_channel_,
  46. pay_amt_, fee_amt_, pay_info_,
  47. status_, pay_fail_msg_, arrival_time_,
  48. create_time_, update_time_,close_status_,close_fail_msg_,close_time_,adapay_no_,open_type_,payment_client_)
  49. values (#{orderNo,jdbcType=VARCHAR}, #{transNo,jdbcType=VARCHAR}, #{payChannel,jdbcType=VARCHAR},
  50. #{payAmt,jdbcType=DECIMAL}, #{feeAmt,jdbcType=DECIMAL}, #{payInfo,jdbcType=VARCHAR},
  51. #{status,jdbcType=VARCHAR}, #{payFailMsg,jdbcType=VARCHAR}, #{arrivalTime,jdbcType=TIMESTAMP},
  52. #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},#{closeStatus},#{closeFailMsg}
  53. ,#{closeTime},#{adapayNo},#{openType},#{paymentClient})
  54. </insert>
  55. <insert id="insertSelective" keyColumn="id_" keyProperty="id" parameterType="com.yonge.cooleshow.mbg.model.UserOrderPayment" useGeneratedKeys="true">
  56. <!--@mbg.generated-->
  57. insert into user_order_payment
  58. <trim prefix="(" suffix=")" suffixOverrides=",">
  59. <if test="orderNo != null">
  60. order_no_,
  61. </if>
  62. <if test="transNo != null">
  63. trans_no_,
  64. </if>
  65. <if test="payChannel != null">
  66. pay_channel_,
  67. </if>
  68. <if test="payAmt != null">
  69. pay_amt_,
  70. </if>
  71. <if test="feeAmt != null">
  72. fee_amt_,
  73. </if>
  74. <if test="payInfo != null">
  75. pay_info_,
  76. </if>
  77. <if test="status != null">
  78. status_,
  79. </if>
  80. <if test="payFailMsg != null">
  81. pay_fail_msg_,
  82. </if>
  83. <if test="arrivalTime != null">
  84. arrival_time_,
  85. </if>
  86. <if test="createTime != null">
  87. create_time_,
  88. </if>
  89. <if test="updateTime != null">
  90. update_time_,
  91. </if>
  92. <if test="closeStatus != null">
  93. close_status_,
  94. </if>
  95. <if test="closeFailMsg != null">
  96. close_fail_msg_,
  97. </if>
  98. <if test="closeTime != null">
  99. close_time_,
  100. </if>
  101. <if test="adapayNo != null">
  102. adapay_no_,
  103. </if>
  104. <if test="openType != null">
  105. open_type_,
  106. </if>
  107. <if test="paymentClient != null">
  108. payment_client_,
  109. </if>
  110. </trim>
  111. <trim prefix="values (" suffix=")" suffixOverrides=",">
  112. <if test="orderNo != null">
  113. #{orderNo,jdbcType=VARCHAR},
  114. </if>
  115. <if test="transNo != null">
  116. #{transNo,jdbcType=VARCHAR},
  117. </if>
  118. <if test="payChannel != null">
  119. #{payChannel,jdbcType=VARCHAR},
  120. </if>
  121. <if test="payAmt != null">
  122. #{payAmt,jdbcType=DECIMAL},
  123. </if>
  124. <if test="feeAmt != null">
  125. #{feeAmt,jdbcType=DECIMAL},
  126. </if>
  127. <if test="payInfo != null">
  128. #{payInfo,jdbcType=VARCHAR},
  129. </if>
  130. <if test="status != null">
  131. #{status,jdbcType=VARCHAR},
  132. </if>
  133. <if test="payFailMsg != null">
  134. #{payFailMsg,jdbcType=VARCHAR},
  135. </if>
  136. <if test="arrivalTime != null">
  137. #{arrivalTime,jdbcType=TIMESTAMP},
  138. </if>
  139. <if test="createTime != null">
  140. #{createTime,jdbcType=TIMESTAMP},
  141. </if>
  142. <if test="updateTime != null">
  143. #{updateTime,jdbcType=TIMESTAMP},
  144. </if>
  145. <if test="closeStatus != null">
  146. #{closeStatus},
  147. </if>
  148. <if test="closeFailMsg != null">
  149. #{closeFailMsg},
  150. </if>
  151. <if test="closeTime != null">
  152. #{closeTime},
  153. </if>
  154. <if test="adapayNo != null">
  155. #{adapayNo},
  156. </if>
  157. <if test="openType != null">
  158. #{openType},
  159. </if>
  160. <if test="paymentClient != null">
  161. #{paymentClient},
  162. </if>
  163. </trim>
  164. </insert>
  165. <update id="updateByPrimaryKeySelective" parameterType="com.yonge.cooleshow.mbg.model.UserOrderPayment">
  166. <!--@mbg.generated-->
  167. update user_order_payment
  168. <set>
  169. <if test="orderNo != null">
  170. order_no_ = #{orderNo,jdbcType=VARCHAR},
  171. </if>
  172. <if test="transNo != null">
  173. trans_no_ = #{transNo,jdbcType=VARCHAR},
  174. </if>
  175. <if test="payChannel != null">
  176. pay_channel_ = #{payChannel,jdbcType=VARCHAR},
  177. </if>
  178. <if test="payAmt != null">
  179. pay_amt_ = #{payAmt,jdbcType=DECIMAL},
  180. </if>
  181. <if test="feeAmt != null">
  182. fee_amt_ = #{feeAmt,jdbcType=DECIMAL},
  183. </if>
  184. <if test="payInfo != null">
  185. pay_info_ = #{payInfo,jdbcType=VARCHAR},
  186. </if>
  187. <if test="status != null">
  188. status_ = #{status,jdbcType=VARCHAR},
  189. </if>
  190. <if test="payFailMsg != null">
  191. pay_fail_msg_ = #{payFailMsg,jdbcType=VARCHAR},
  192. </if>
  193. <if test="arrivalTime != null">
  194. arrival_time_ = #{arrivalTime,jdbcType=TIMESTAMP},
  195. </if>
  196. <if test="createTime != null">
  197. create_time_ = #{createTime,jdbcType=TIMESTAMP},
  198. </if>
  199. <if test="updateTime != null">
  200. update_time_ = #{updateTime,jdbcType=TIMESTAMP},
  201. </if>
  202. <if test="closeStatus != null">
  203. close_status_ = #{closeStatus},
  204. </if>
  205. <if test="closeFailMsg != null">
  206. close_fail_msg_ = #{closeFailMsg},
  207. </if>
  208. <if test="closeTime != null">
  209. close_time_ = #{closeTime,jdbcType=TIMESTAMP},
  210. </if>
  211. <if test="adapayNo != null">
  212. adapay_no_ = #{adapayNo,jdbcType=TIMESTAMP},
  213. </if>
  214. <if test="openType != null">
  215. open_type_ = #{openType},
  216. </if>
  217. <if test="paymentClient != null">
  218. payment_client_ = #{paymentClient},
  219. </if>
  220. </set>
  221. where id_ = #{id,jdbcType=BIGINT}
  222. </update>
  223. <update id="updateByPrimaryKey" parameterType="com.yonge.cooleshow.mbg.model.UserOrderPayment">
  224. <!--@mbg.generated-->
  225. update user_order_payment
  226. set order_no_ = #{orderNo,jdbcType=VARCHAR},
  227. trans_no_ = #{transNo,jdbcType=VARCHAR},
  228. pay_channel_ = #{payChannel,jdbcType=VARCHAR},
  229. pay_amt_ = #{payAmt,jdbcType=DECIMAL},
  230. fee_amt_ = #{feeAmt,jdbcType=DECIMAL},
  231. pay_info_ = #{payInfo,jdbcType=VARCHAR},
  232. status_ = #{status,jdbcType=VARCHAR},
  233. pay_fail_msg_ = #{payFailMsg,jdbcType=VARCHAR},
  234. arrival_time_ = #{arrivalTime,jdbcType=TIMESTAMP},
  235. create_time_ = #{createTime,jdbcType=TIMESTAMP},
  236. update_time_ = #{updateTime,jdbcType=TIMESTAMP},
  237. close_status_ = #{closeStatus},
  238. close_fail_msg_ = #{closeFailMsg},
  239. close_time_ = #{closeTime,jdbcType=TIMESTAMP},
  240. adapay_no_ = #{adapayNo,jdbcType=TIMESTAMP},
  241. open_type_ = #{openType},
  242. payment_client_= #{paymentClient}
  243. where id_ = #{id,jdbcType=BIGINT}
  244. </update>
  245. <select id="selectByTranNo" resultMap="BaseResultMap">
  246. select
  247. <include refid="Base_Column_List" />
  248. from user_order_payment where trans_no_ = #{orderNo} order by id_ desc limit 1
  249. </select>
  250. <select id="selectByOrderNo" resultMap="BaseResultMap">
  251. select
  252. <include refid="Base_Column_List" />
  253. from user_order_payment where order_no_ = #{orderSn}
  254. </select>
  255. <select id="selectByOrderNoAndStatusPaying" resultMap="BaseResultMap">
  256. select
  257. <include refid="Base_Column_List" />
  258. from user_order_payment where order_no_ = #{orderSn} and status_ = 'pending' order by id_ desc limit 1
  259. </select>
  260. <select id="selectByOrderNoAndStatus" resultMap="BaseResultMap">
  261. select
  262. <include refid="Base_Column_List" />
  263. from user_order_payment where order_no_ = #{orderSn}
  264. and status_ = #{payStatus} and pay_channel_ = #{payChannel} order by id_ desc limit 1
  265. </select>
  266. <select id="selectByOrderNoAndStatusSucceeded" resultMap="BaseResultMap">
  267. select
  268. <include refid="Base_Column_List" />
  269. from user_order_payment where order_no_ = #{orderSn} and status_ = 'succeeded' order by id_ desc limit 1
  270. </select>
  271. <select id="selectByAdapayNo" resultMap="BaseResultMap">
  272. select
  273. <include refid="Base_Column_List" />
  274. from user_order_payment where adapay_no_ = #{paymentNo} order by id_ desc limit 1
  275. </select>
  276. </mapper>