PayRequestMapper.xml 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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="DECIMAL"/>
  14. <result property="itemId" column="item_id" jdbcType="VARCHAR"/>
  15. <result property="itemName" column="item_name" jdbcType="VARCHAR"/>
  16. <result property="itemType" column="item_type" jdbcType="INTEGER"/>
  17. <result property="itemChannel" column="item_channel" jdbcType="VARCHAR"/>
  18. <result property="payChannel" column="pay_channel" jdbcType="INTEGER"/>
  19. <result property="payStatus" column="pay_status" jdbcType="BIGINT"/>
  20. <result property="payAmount" column="pay_amount" jdbcType="DECIMAL"/>
  21. <result property="payTime" column="pay_time" jdbcType="TIMESTAMP"/>
  22. <result property="callbackUrl" column="callback_url" jdbcType="VARCHAR"/>
  23. <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
  24. <result property="modifiedTime" column="modified_time" jdbcType="TIMESTAMP"/>
  25. </resultMap>
  26. <sql id="Base_Column_List">
  27. id,request_body,order_sn,
  28. open_id,mobile,order_id,
  29. amount,item_id,item_name,item_type,
  30. item_channel,pay_channel,pay_status,pay_amount,pay_time,callback_url,create_time,
  31. modified_time
  32. </sql>
  33. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  34. select
  35. <include refid="Base_Column_List" />
  36. from pay_request
  37. where id = #{id,jdbcType=INTEGER}
  38. </select>
  39. <select id="selectByOrderSn" resultMap="BaseResultMap">
  40. select
  41. <include refid="Base_Column_List" />
  42. from pay_request
  43. where order_sn = #{orderSn} limit 1
  44. </select>
  45. <select id="selectPaySuccessByOrderId" resultMap="BaseResultMap">
  46. select
  47. <include refid="Base_Column_List" />
  48. from pay_request
  49. where order_id = #{orderId} and pay_status = 1 limit 1
  50. </select>
  51. <select id="selectByUser" resultMap="BaseResultMap">
  52. select order_sn, order_id, item_id, item_name, pay_status
  53. from pay_request
  54. where mobile = #{phoneNo} and item_type = #{itemType}
  55. <if test="payStatus != null">
  56. and pay_status = #{payStatus}
  57. </if>
  58. </select>
  59. <select id="selectByOrderId" resultMap="BaseResultMap">
  60. select order_sn, order_id, item_id, item_name, pay_status
  61. from pay_request
  62. where mobile = #{phoneNo} and order_id = #{orderId}
  63. </select>
  64. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  65. delete from pay_request
  66. where id = #{id,jdbcType=INTEGER}
  67. </delete>
  68. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.PayRequest" useGeneratedKeys="true">
  69. insert into pay_request
  70. ( id,request_body,order_sn
  71. ,open_id,mobile,order_id
  72. ,amount,item_id,item_type
  73. ,item_channel,pay_channel,create_time
  74. ,modified_time)
  75. values (#{id,jdbcType=INTEGER},#{requestBody,jdbcType=VARCHAR},#{orderSn,jdbcType=VARCHAR}
  76. ,#{openId,jdbcType=VARCHAR},#{mobile,jdbcType=VARCHAR},#{orderId,jdbcType=VARCHAR}
  77. ,#{amount,jdbcType=DECIMAL},#{itemId,jdbcType=VARCHAR},#{itemType,jdbcType=INTEGER}
  78. ,#{itemChannel,jdbcType=VARCHAR},#{payChannel,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP}
  79. ,#{modifiedTime,jdbcType=TIMESTAMP})
  80. </insert>
  81. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.PayRequest" useGeneratedKeys="true">
  82. insert into pay_request
  83. <trim prefix="(" suffix=")" suffixOverrides=",">
  84. <if test="id != null">id,</if>
  85. <if test="requestBody != null">request_body,</if>
  86. <if test="orderSn != null">order_sn,</if>
  87. <if test="openId != null">open_id,</if>
  88. <if test="mobile != null">mobile,</if>
  89. <if test="orderId != null">order_id,</if>
  90. <if test="amount != null">amount,</if>
  91. <if test="itemId != null">item_id,</if>
  92. <if test="itemType != null">item_type,</if>
  93. <if test="itemChannel != null">item_channel,</if>
  94. <if test="payChannel != null">pay_channel,</if>
  95. <if test="itemName != null">item_name,</if>
  96. <if test="responseBody != null">response_body,</if>
  97. <if test="payStatus != null">pay_status,</if>
  98. <if test="callbackUrl != null">callback_url,</if>
  99. <if test="createTime != null">create_time,</if>
  100. <if test="modifiedTime != null">modified_time,</if>
  101. </trim>
  102. <trim prefix="values (" suffix=")" suffixOverrides=",">
  103. <if test="id != null">#{id,jdbcType=INTEGER},</if>
  104. <if test="requestBody != null">#{requestBody,jdbcType=VARCHAR},</if>
  105. <if test="orderSn != null">#{orderSn,jdbcType=VARCHAR},</if>
  106. <if test="openId != null">#{openId,jdbcType=VARCHAR},</if>
  107. <if test="mobile != null">#{mobile,jdbcType=VARCHAR},</if>
  108. <if test="orderId != null">#{orderId,jdbcType=VARCHAR},</if>
  109. <if test="amount != null">#{amount,jdbcType=DECIMAL},</if>
  110. <if test="itemId != null">#{itemId,jdbcType=VARCHAR},</if>
  111. <if test="itemType != null">#{itemType,jdbcType=INTEGER},</if>
  112. <if test="itemChannel != null">#{itemChannel,jdbcType=VARCHAR},</if>
  113. <if test="payChannel != null">#{payChannel,jdbcType=INTEGER},</if>
  114. <if test="itemName != null">#{itemName,jdbcType=VARCHAR},</if>
  115. <if test="responseBody != null">#{responseBody,jdbcType=VARCHAR},</if>
  116. <if test="payStatus != null">#{payStatus,jdbcType=BIGINT},</if>
  117. <if test="callbackUrl != null">#{callbackUrl,jdbcType=VARCHAR},</if>
  118. <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
  119. <if test="modifiedTime != null">#{modifiedTime,jdbcType=TIMESTAMP},</if>
  120. </trim>
  121. </insert>
  122. <update id="updateByPrimaryKeySelective" parameterType="com.mofangchuxing.aska.dao.domain.PayRequest">
  123. update pay_request
  124. <set>
  125. <if test="requestBody != null">
  126. request_body = #{requestBody,jdbcType=VARCHAR},
  127. </if>
  128. <if test="orderSn != null">
  129. order_sn = #{orderSn,jdbcType=VARCHAR},
  130. </if>
  131. <if test="openId != null">
  132. open_id = #{openId,jdbcType=VARCHAR},
  133. </if>
  134. <if test="mobile != null">
  135. mobile = #{mobile,jdbcType=VARCHAR},
  136. </if>
  137. <if test="orderId != null">
  138. order_id = #{orderId,jdbcType=VARCHAR},
  139. </if>
  140. <if test="amount != null">
  141. amount = #{amount,jdbcType=DECIMAL},
  142. </if>
  143. <if test="itemId != null">
  144. item_id = #{itemId,jdbcType=VARCHAR},
  145. </if>
  146. <if test="itemType != null">
  147. item_type = #{itemType,jdbcType=INTEGER},
  148. </if>
  149. <if test="itemChannel != null">
  150. item_channel = #{itemChannel,jdbcType=VARCHAR},
  151. </if>
  152. <if test="payChannel != null">
  153. pay_channel = #{payChannel,jdbcType=INTEGER},
  154. </if>
  155. <if test="responseBody != null">
  156. response_body = #{responseBody,jdbcType=VARCHAR},
  157. </if>
  158. <if test="payStatus != null">
  159. pay_status = #{payStatus,jdbcType=BIGINT},
  160. </if>
  161. <if test="payAmount != null">
  162. pay_amount = #{payAmount,jdbcType=DECIMAL},
  163. </if>
  164. <if test="payTime != null">
  165. pay_time = #{payTime,jdbcType=TIMESTAMP},
  166. </if>
  167. <if test="createTime != null">
  168. create_time = #{createTime,jdbcType=TIMESTAMP},
  169. </if>
  170. <if test="modifiedTime != null">
  171. modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
  172. </if>
  173. </set>
  174. where id = #{id,jdbcType=INTEGER}
  175. </update>
  176. <update id="updateByPrimaryKey" parameterType="com.mofangchuxing.aska.dao.domain.PayRequest">
  177. update pay_request
  178. set
  179. request_body = #{requestBody,jdbcType=VARCHAR},
  180. order_sn = #{orderSn,jdbcType=VARCHAR},
  181. open_id = #{openId,jdbcType=VARCHAR},
  182. mobile = #{mobile,jdbcType=VARCHAR},
  183. order_id = #{orderId,jdbcType=VARCHAR},
  184. amount = #{amount,jdbcType=DECIMAL},
  185. item_id = #{itemId,jdbcType=VARCHAR},
  186. item_type = #{itemType,jdbcType=INTEGER},
  187. item_channel = #{itemChannel,jdbcType=VARCHAR},
  188. pay_channel = #{payChannel,jdbcType=INTEGER},
  189. response_body = #{responseBody,jdbcType=VARCHAR},
  190. create_time = #{createTime,jdbcType=TIMESTAMP},
  191. modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
  192. where id = #{id,jdbcType=INTEGER}
  193. </update>
  194. </mapper>