PayRequestMapper.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  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.mofangchuxing.aska.dao.mapper.PayRequestMapper">
  6. <resultMap id="BaseResultMap" type="com.mofangchuxing.aska.dao.domain.PayRequest">
  7. <id property="id" column="id" jdbcType="INTEGER"/>
  8. <result property="requestBody" column="request_body" jdbcType="VARCHAR"/>
  9. <result property="orderSn" column="order_sn" jdbcType="VARCHAR"/>
  10. <result property="openId" column="open_id" jdbcType="VARCHAR"/>
  11. <result property="mobile" column="mobile" jdbcType="VARCHAR"/>
  12. <result property="orderId" column="order_id" jdbcType="VARCHAR"/>
  13. <result property="amount" column="amount" jdbcType="INTEGER"/>
  14. <result property="itemId" column="item_id" jdbcType="VARCHAR"/>
  15. <result property="itemType" column="item_type" jdbcType="INTEGER"/>
  16. <result property="itemName" column="item_name" jdbcType="VARCHAR"/>
  17. <result property="itemChannel" column="item_channel" jdbcType="VARCHAR"/>
  18. <result property="retailId" column="retail_id" jdbcType="VARCHAR"/>
  19. <result property="retailName" column="retail_name" jdbcType="VARCHAR"/>
  20. <result property="useCouponId" column="use_coupon_id" jdbcType="VARCHAR"/>
  21. <result property="payChannel" column="pay_channel" jdbcType="INTEGER"/>
  22. <result property="responseBody" column="response_body" jdbcType="VARCHAR"/>
  23. <result property="payStatus" column="pay_status" jdbcType="INTEGER"/>
  24. <result property="payTime" column="pay_time" jdbcType="TIMESTAMP"/>
  25. <result property="transactionId" column="transaction_id" jdbcType="VARCHAR"/>
  26. <result property="payAmount" column="pay_amount" jdbcType="DECIMAL"/>
  27. <result property="hasRefund" column="has_refund" jdbcType="INTEGER"/>
  28. <result property="refundTotal" column="refund_total" jdbcType="DECIMAL"/>
  29. <result property="clientType" column="client_type" jdbcType="VARCHAR"/>
  30. <result property="cansplit" column="canSplit" jdbcType="INTEGER"/>
  31. <result property="callbackUrl" column="callback_url" jdbcType="VARCHAR"/>
  32. <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
  33. <result property="modifiedTime" column="modified_time" jdbcType="TIMESTAMP"/>
  34. </resultMap>
  35. <sql id="Base_Column_List">
  36. id,request_body,order_sn,
  37. open_id,mobile,order_id,
  38. amount,item_id,item_type,
  39. item_name,item_channel,retail_id,
  40. retail_name,use_coupon_id,pay_channel,
  41. response_body,pay_status,pay_time,
  42. transaction_id,pay_amount,has_refund,
  43. refund_total,client_type,canSplit,
  44. callback_url,create_time,modified_time
  45. </sql>
  46. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  47. select
  48. <include refid="Base_Column_List" />
  49. from pay_request
  50. where id = #{id,jdbcType=INTEGER}
  51. </select>
  52. <select id="selectByOrderSn" resultMap="BaseResultMap">
  53. select
  54. <include refid="Base_Column_List" />
  55. from pay_request
  56. where order_sn = #{orderSn} limit 1
  57. </select>
  58. <select id="selectPaySuccessByOrderId" resultMap="BaseResultMap">
  59. select
  60. <include refid="Base_Column_List" />
  61. from pay_request
  62. where order_id = #{orderId} and pay_status = 1 limit 1
  63. </select>
  64. <select id="selectByUser" resultMap="BaseResultMap">
  65. select order_sn, order_id, item_id, item_name, pay_status
  66. from pay_request
  67. where mobile = #{phoneNo} and item_type = #{itemType}
  68. <if test="payStatus != null">
  69. and pay_status = #{payStatus}
  70. </if>
  71. </select>
  72. <select id="selectByOrderId" resultMap="BaseResultMap">
  73. select order_sn, order_id, item_id, item_name, pay_status
  74. from pay_request
  75. where mobile = #{phoneNo} and order_id = #{orderId}
  76. </select>
  77. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  78. delete from pay_request
  79. where id = #{id,jdbcType=INTEGER}
  80. </delete>
  81. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.PayRequest" useGeneratedKeys="true">
  82. insert into pay_request
  83. ( id,request_body,order_sn
  84. ,open_id,mobile,order_id
  85. ,amount,item_id,item_type
  86. ,item_name,item_channel,retail_id
  87. ,retail_name,use_coupon_id,pay_channel
  88. ,response_body,pay_status,pay_time
  89. ,transaction_id,pay_amount,has_refund
  90. ,refund_total,client_type,canSplit
  91. ,callback_url,create_time,modified_time
  92. )
  93. values (#{id,jdbcType=INTEGER},#{requestBody,jdbcType=VARCHAR},#{orderSn,jdbcType=VARCHAR}
  94. ,#{openId,jdbcType=VARCHAR},#{mobile,jdbcType=VARCHAR},#{orderId,jdbcType=VARCHAR}
  95. ,#{amount,jdbcType=DECIMAL},#{itemId,jdbcType=VARCHAR},#{itemType,jdbcType=INTEGER}
  96. ,#{itemName,jdbcType=VARCHAR},#{itemChannel,jdbcType=VARCHAR},#{retailId,jdbcType=VARCHAR}
  97. ,#{retailName,jdbcType=VARCHAR},#{useCouponId,jdbcType=VARCHAR},#{payChannel,jdbcType=INTEGER}
  98. ,#{responseBody,jdbcType=VARCHAR},#{payStatus,jdbcType=INTEGER},#{payTime,jdbcType=TIMESTAMP}
  99. ,#{transactionId,jdbcType=VARCHAR},#{payAmount,jdbcType=DECIMAL},#{hasRefund,jdbcType=INTEGER}
  100. ,#{refundTotal,jdbcType=DECIMAL},#{clientType,jdbcType=VARCHAR},#{cansplit,jdbcType=INTEGER}
  101. ,#{callbackUrl,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{modifiedTime,jdbcType=TIMESTAMP}
  102. )
  103. </insert>
  104. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.PayRequest" useGeneratedKeys="true">
  105. insert into pay_request
  106. <trim prefix="(" suffix=")" suffixOverrides=",">
  107. <if test="id != null">id,</if>
  108. <if test="requestBody != null">request_body,</if>
  109. <if test="orderSn != null">order_sn,</if>
  110. <if test="openId != null">open_id,</if>
  111. <if test="mobile != null">mobile,</if>
  112. <if test="orderId != null">order_id,</if>
  113. <if test="amount != null">amount,</if>
  114. <if test="itemId != null">item_id,</if>
  115. <if test="itemType != null">item_type,</if>
  116. <if test="itemName != null">item_name,</if>
  117. <if test="itemChannel != null">item_channel,</if>
  118. <if test="channelId != null">channel_id,</if>
  119. <if test="retailId != null">retail_id,</if>
  120. <if test="retailName != null">retail_name,</if>
  121. <if test="useCouponId != null">use_coupon_id,</if>
  122. <if test="payChannel != null">pay_channel,</if>
  123. <if test="responseBody != null">response_body,</if>
  124. <if test="payStatus != null">pay_status,</if>
  125. <if test="payTime != null">pay_time,</if>
  126. <if test="transactionId != null">transaction_id,</if>
  127. <if test="payAmount != null">pay_amount,</if>
  128. <if test="hasRefund != null">has_refund,</if>
  129. <if test="refundTotal != null">refund_total,</if>
  130. <if test="clientType != null">client_type,</if>
  131. <if test="cansplit != null">canSplit,</if>
  132. <if test="callbackUrl != null">callback_url,</if>
  133. <if test="createTime != null">create_time,</if>
  134. <if test="modifiedTime != null">modified_time,</if>
  135. </trim>
  136. <trim prefix="values (" suffix=")" suffixOverrides=",">
  137. <if test="id != null">#{id,jdbcType=INTEGER},</if>
  138. <if test="requestBody != null">#{requestBody,jdbcType=VARCHAR},</if>
  139. <if test="orderSn != null">#{orderSn,jdbcType=VARCHAR},</if>
  140. <if test="openId != null">#{openId,jdbcType=VARCHAR},</if>
  141. <if test="mobile != null">#{mobile,jdbcType=VARCHAR},</if>
  142. <if test="orderId != null">#{orderId,jdbcType=VARCHAR},</if>
  143. <if test="amount != null">#{amount,jdbcType=DECIMAL},</if>
  144. <if test="itemId != null">#{itemId,jdbcType=VARCHAR},</if>
  145. <if test="itemType != null">#{itemType,jdbcType=INTEGER},</if>
  146. <if test="itemName != null">#{itemName,jdbcType=VARCHAR},</if>
  147. <if test="itemChannel != null">#{itemChannel,jdbcType=VARCHAR},</if>
  148. <if test="channelId != null">#{channelId,jdbcType=INTEGER},</if>
  149. <if test="retailId != null">#{retailId,jdbcType=VARCHAR},</if>
  150. <if test="retailName != null">#{retailName,jdbcType=VARCHAR},</if>
  151. <if test="useCouponId != null">#{useCouponId,jdbcType=VARCHAR},</if>
  152. <if test="payChannel != null">#{payChannel,jdbcType=INTEGER},</if>
  153. <if test="responseBody != null">#{responseBody,jdbcType=VARCHAR},</if>
  154. <if test="payStatus != null">#{payStatus,jdbcType=INTEGER},</if>
  155. <if test="payTime != null">#{payTime,jdbcType=TIMESTAMP},</if>
  156. <if test="transactionId != null">#{transactionId,jdbcType=VARCHAR},</if>
  157. <if test="payAmount != null">#{payAmount,jdbcType=DECIMAL},</if>
  158. <if test="hasRefund != null">#{hasRefund,jdbcType=INTEGER},</if>
  159. <if test="refundTotal != null">#{refundTotal,jdbcType=DECIMAL},</if>
  160. <if test="clientType != null">#{clientType,jdbcType=VARCHAR},</if>
  161. <if test="cansplit != null">#{cansplit,jdbcType=INTEGER},</if>
  162. <if test="callbackUrl != null">#{callbackUrl,jdbcType=VARCHAR},</if>
  163. <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
  164. <if test="modifiedTime != null">#{modifiedTime,jdbcType=TIMESTAMP},</if>
  165. </trim>
  166. </insert>
  167. <update id="updateByPrimaryKeySelective" parameterType="com.mofangchuxing.aska.dao.domain.PayRequest">
  168. update pay_request
  169. <set>
  170. <if test="requestBody != null">
  171. request_body = #{requestBody,jdbcType=VARCHAR},
  172. </if>
  173. <if test="orderSn != null">
  174. order_sn = #{orderSn,jdbcType=VARCHAR},
  175. </if>
  176. <if test="openId != null">
  177. open_id = #{openId,jdbcType=VARCHAR},
  178. </if>
  179. <if test="mobile != null">
  180. mobile = #{mobile,jdbcType=VARCHAR},
  181. </if>
  182. <if test="orderId != null">
  183. order_id = #{orderId,jdbcType=VARCHAR},
  184. </if>
  185. <if test="amount != null">
  186. amount = #{amount,jdbcType=DECIMAL},
  187. </if>
  188. <if test="itemId != null">
  189. item_id = #{itemId,jdbcType=VARCHAR},
  190. </if>
  191. <if test="itemType != null">
  192. item_type = #{itemType,jdbcType=INTEGER},
  193. </if>
  194. <if test="itemName != null">
  195. item_name = #{itemName,jdbcType=VARCHAR},
  196. </if>
  197. <if test="itemChannel != null">
  198. item_channel = #{itemChannel,jdbcType=VARCHAR},
  199. </if>
  200. <if test="retailId != null">
  201. retail_id = #{retailId,jdbcType=VARCHAR},
  202. </if>
  203. <if test="retailName != null">
  204. retail_name = #{retailName,jdbcType=VARCHAR},
  205. </if>
  206. <if test="useCouponId != null">
  207. use_coupon_id = #{useCouponId,jdbcType=VARCHAR},
  208. </if>
  209. <if test="payChannel != null">
  210. pay_channel = #{payChannel,jdbcType=INTEGER},
  211. </if>
  212. <if test="responseBody != null">
  213. response_body = #{responseBody,jdbcType=VARCHAR},
  214. </if>
  215. <if test="payStatus != null">
  216. pay_status = #{payStatus,jdbcType=INTEGER},
  217. </if>
  218. <if test="payTime != null">
  219. pay_time = #{payTime,jdbcType=TIMESTAMP},
  220. </if>
  221. <if test="transactionId != null">
  222. transaction_id = #{transactionId,jdbcType=VARCHAR},
  223. </if>
  224. <if test="payAmount != null">
  225. pay_amount = #{payAmount,jdbcType=DECIMAL},
  226. </if>
  227. <if test="hasRefund != null">
  228. has_refund = #{hasRefund,jdbcType=INTEGER},
  229. </if>
  230. <if test="refundTotal != null">
  231. refund_total = #{refundTotal,jdbcType=DECIMAL},
  232. </if>
  233. <if test="clientType != null">
  234. client_type = #{clientType,jdbcType=VARCHAR},
  235. </if>
  236. <if test="cansplit != null">
  237. canSplit = #{cansplit,jdbcType=INTEGER},
  238. </if>
  239. <if test="callbackUrl != null">
  240. callback_url = #{callbackUrl,jdbcType=VARCHAR},
  241. </if>
  242. <if test="createTime != null">
  243. create_time = #{createTime,jdbcType=TIMESTAMP},
  244. </if>
  245. <if test="modifiedTime != null">
  246. modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
  247. </if>
  248. </set>
  249. where id = #{id,jdbcType=INTEGER}
  250. </update>
  251. <update id="updateByPrimaryKey" parameterType="com.mofangchuxing.aska.dao.domain.PayRequest">
  252. update pay_request
  253. set
  254. request_body = #{requestBody,jdbcType=VARCHAR},
  255. order_sn = #{orderSn,jdbcType=VARCHAR},
  256. open_id = #{openId,jdbcType=VARCHAR},
  257. mobile = #{mobile,jdbcType=VARCHAR},
  258. order_id = #{orderId,jdbcType=VARCHAR},
  259. amount = #{amount,jdbcType=DECIMAL},
  260. item_id = #{itemId,jdbcType=VARCHAR},
  261. item_type = #{itemType,jdbcType=INTEGER},
  262. item_name = #{itemName,jdbcType=VARCHAR},
  263. item_channel = #{itemChannel,jdbcType=VARCHAR},
  264. retail_id = #{retailId,jdbcType=VARCHAR},
  265. retail_name = #{retailName,jdbcType=VARCHAR},
  266. use_coupon_id = #{useCouponId,jdbcType=VARCHAR},
  267. pay_channel = #{payChannel,jdbcType=INTEGER},
  268. response_body = #{responseBody,jdbcType=VARCHAR},
  269. pay_status = #{payStatus,jdbcType=INTEGER},
  270. pay_time = #{payTime,jdbcType=TIMESTAMP},
  271. transaction_id = #{transactionId,jdbcType=VARCHAR},
  272. pay_amount = #{payAmount,jdbcType=DECIMAL},
  273. has_refund = #{hasRefund,jdbcType=INTEGER},
  274. refund_total = #{refundTotal,jdbcType=DECIMAL},
  275. client_type = #{clientType,jdbcType=VARCHAR},
  276. canSplit = #{cansplit,jdbcType=INTEGER},
  277. callback_url = #{callbackUrl,jdbcType=VARCHAR},
  278. create_time = #{createTime,jdbcType=TIMESTAMP},
  279. modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
  280. where id = #{id,jdbcType=INTEGER}
  281. </update>
  282. </mapper>