Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 

199 wiersze
8.6 KiB

  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.iformall.mapper.WxPayOrderMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxPayOrder">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  8. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  9. <result column="order_id" jdbcType="BIGINT" property="orderId"/>
  10. <result column="c_user_id" jdbcType="BIGINT" property="cUserId"/>
  11. <result column="b_user_id" jdbcType="BIGINT" property="bUserId"/>
  12. <result column="auth_code" jdbcType="VARCHAR" property="authCode"/>
  13. <result column="ip" jdbcType="VARCHAR" property="ip"/>
  14. <result column="pay_amount" jdbcType="INTEGER" property="payAmount"/>
  15. <result column="pay_time_start" jdbcType="TIMESTAMP" property="payTimeStart"/>
  16. <result column="pay_time_end" jdbcType="TIMESTAMP" property="payTimeEnd"/>
  17. <result column="prepay_id" jdbcType="VARCHAR" property="prepayId"/>
  18. <result column="transaction_id" jdbcType="VARCHAR" property="transactionId"/>
  19. <result column="pay_vendor" jdbcType="INTEGER" property="payVendor"/>
  20. <result column="pay_order_no" jdbcType="VARCHAR" property="payOrderNo"/>
  21. <result column="pay_order_status" jdbcType="INTEGER" property="payOrderStatus"/>
  22. <result column="share" jdbcType="INTEGER" property="share"/>
  23. <result column="share_amount" jdbcType="INTEGER" property="shareAmount"/>
  24. <result column="rate_amount" jdbcType="INTEGER" property="rateAmount"/>
  25. <result column="fail_reason" jdbcType="VARCHAR" property="failReason"/>
  26. <result column="pos_pay_order_id" jdbcType="BIGINT" property="posPayOrderId"/>
  27. <result column="pos_pay_order_time" jdbcType="BIGINT" property="posPayOrderTime"/>
  28. <result column="pos_payment_type" jdbcType="INTEGER" property="posPaymentType"/>
  29. <result column="pos_pay_order_no" jdbcType="INTEGER" property="posPayOrderNo"/>
  30. <result column="pos_pay_des" jdbcType="INTEGER" property="posPayDes"/>
  31. </resultMap>
  32. <sql id="allColumns">
  33. `id`,`tenant_id`,`create_time`,`update_time`,`order_id`,`c_user_id`,`b_user_id`,
  34. `auth_code`,`ip`,`pay_amount`,`pay_time_start`,`pay_time_end`,
  35. `prepay_id`,`transaction_id`,`pay_vendor`,`pay_order_no`,
  36. `pay_order_status`,`share`,`share_amount`,`rate_amount`,`fail_reason`,
  37. `pos_pay_order_id`,`pos_pay_order_time`,`pos_payment_type`,`pos_pay_order_no`,`pos_pay_des`
  38. </sql>
  39. <sql id="dynamicWhereConditions">
  40. where 1 = 1
  41. <if test=" null != id ">
  42. and `id` = #{id}
  43. </if>
  44. <if test=" null != tenantId ">
  45. and `tenant_id` = #{tenantId}
  46. </if>
  47. <if test=" null != createTime ">
  48. and `create_time` = #{createTime}
  49. </if>
  50. <if test=" null != updateTime ">
  51. and `update_time` = #{updateTime}
  52. </if>
  53. <if test=" null != orderId ">
  54. and `order_id` = #{orderId}
  55. </if>
  56. <if test=" null != cUserId ">
  57. and `c_user_id` = #{cUserId}
  58. </if>
  59. <if test=" null != bUserId ">
  60. and `b_user_id` = #{bUserId}
  61. </if>
  62. <if test=" null != authCode ">
  63. and `auth_code` = #{authCode}
  64. </if>
  65. <if test=" null != ip ">
  66. and `ip` like concat('%', #{ip},'%')
  67. </if>
  68. <if test=" null != payAmount ">
  69. and `pay_amount` = #{payAmount}
  70. </if>
  71. <if test=" null != payTimeStart ">
  72. and `pay_time_start` = #{payTimeStart}
  73. </if>
  74. <if test=" null != payTimeEnd ">
  75. and `pay_time_end` = #{payTimeEnd}
  76. </if>
  77. <if test=" null != prepayId ">
  78. and `prepay_id` like concat('%', #{prepayId},'%')
  79. </if>
  80. <if test=" null != transactionId ">
  81. and `transaction_id` like concat('%', #{transactionId},'%')
  82. </if>
  83. <if test=" null != payVendor ">
  84. and `pay_vendor` = #{payVendor}
  85. </if>
  86. <if test=" null != payOrderNo ">
  87. and `pay_order_no` like concat('%', #{payOrderNo},'%')
  88. </if>
  89. <if test=" null != payOrderStatus ">
  90. and `pay_order_status` = #{payOrderStatus}
  91. </if>
  92. <if test=" null != share ">
  93. and `share` = #{share}
  94. </if>
  95. <if test=" null != shareAmount ">
  96. and `share_amount` = #{shareAmount}
  97. </if>
  98. <if test=" null != failReason ">
  99. and `fail_reason` like concat('%', #{failReason},'%')
  100. </if>
  101. <if test=" null != posPayOrderId ">
  102. and `pos_pay_order_id` = #{posPayOrderId}
  103. </if>
  104. <if test=" null != posPayOrderTime ">
  105. and `pos_pay_order_time` = #{posPayOrderTime}
  106. </if>
  107. <if test=" null != posPaymentType ">
  108. and `pos_payment_type` = #{posPaymentType}
  109. </if>
  110. <if test=" null != posPayOrderNo ">
  111. and `pos_pay_order_no` = #{posPayOrderNo}
  112. </if>
  113. <if test=" null != ids ">
  114. and id in
  115. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  116. #{idItem}
  117. </foreach>
  118. </if>
  119. <if test=" null != sortColumns">order by ${sortColumns}</if>
  120. </sql>
  121. <select id="findList" parameterType="com.iformall.domain.po.WxPayOrder" resultMap="BaseResultMap">
  122. select
  123. <include refid="allColumns"/>
  124. from wx_pay_order
  125. <include refid="dynamicWhereConditions"/>
  126. </select>
  127. <resultMap id="VBaseResultMap" type="com.iformall.domain.vo.WxPayOrderVo">
  128. <id column="id" jdbcType="BIGINT" property="id"/>
  129. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  130. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  131. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  132. <result column="order_id" jdbcType="BIGINT" property="orderId"/>
  133. <result column="c_user_id" jdbcType="BIGINT" property="cUserId"/>
  134. <result column="b_user_id" jdbcType="BIGINT" property="bUserId"/>
  135. <result column="auth_code" jdbcType="VARCHAR" property="authCode"/>
  136. <result column="ip" jdbcType="VARCHAR" property="ip"/>
  137. <result column="pay_amount" jdbcType="INTEGER" property="payAmount"/>
  138. <result column="pay_time_start" jdbcType="TIMESTAMP" property="payTimeStart"/>
  139. <result column="pay_time_end" jdbcType="TIMESTAMP" property="payTimeEnd"/>
  140. <result column="prepay_id" jdbcType="VARCHAR" property="prepayId"/>
  141. <result column="transaction_id" jdbcType="VARCHAR" property="transactionId"/>
  142. <result column="pay_vendor" jdbcType="INTEGER" property="payVendor"/>
  143. <result column="pay_order_no" jdbcType="VARCHAR" property="payOrderNo"/>
  144. <result column="pay_order_status" jdbcType="INTEGER" property="payOrderStatus"/>
  145. <result column="share" jdbcType="INTEGER" property="share"/>
  146. <result column="share_amount" jdbcType="INTEGER" property="shareAmount"/>
  147. <result column="rate_amount" jdbcType="INTEGER" property="rateAmount"/>
  148. <result column="fail_reason" jdbcType="VARCHAR" property="failReason"/>
  149. <result column="open_id" jdbcType="VARCHAR" property="openId"/>
  150. <result column="app_id" jdbcType="VARCHAR" property="appId"/>
  151. <result column="pay_id" jdbcType="BIGINT" property="payId"/>
  152. </resultMap>
  153. <sql id="allVColumns">
  154. p.`id`,p.`tenant_id`,p.`create_time`,p.`update_time`,p.`order_id`,p.`c_user_id`,p.`b_user_id`,
  155. p.`auth_code`,p.`ip`,p.`pay_amount`,p.`pay_time_start`,p.`pay_time_end`,
  156. p.`prepay_id`,p.`transaction_id`,p.`pay_vendor`,p.`pay_order_no`,
  157. p.`pay_order_status`,p.`share`,p.`share_amount`,p.`rate_amount`,p.`fail_reason`,
  158. u.`open_id`,
  159. a.`app_id`, a.`pay_id`
  160. </sql>
  161. <select id="findListOfPaidOrderByDate" parameterType="map" resultMap="VBaseResultMap">
  162. select
  163. <include refid="allVColumns"/>
  164. from wx_pay_order p
  165. left join wx_c_user u on p.`c_user_id` = u.`id`
  166. left join wx_appinfo a on a.`tenant_id` = p.`tenant_id` and a.`type` = 2
  167. where p.`pay_order_status` = '1' and p.`pay_vendor` = 0 and u.`union_id` is null
  168. <if test="startDate != null">
  169. AND unix_timestamp(p.`pay_time_end`) &gt; unix_timestamp(#{startDate,jdbcType=TIMESTAMP})
  170. </if>
  171. </select>
  172. </mapper>