OnlinePayV1ServiceDaoImplMapper.xml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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="onlinePayV1ServiceDaoImpl">
  6. <!-- 保存线上支付信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveOnlinePayInfo" parameterType="Map">
  8. insert into online_pay(
  9. refund_fee,mch_id,order_id,total_fee,open_id,app_id,pay_id,state,message,pay_name,transaction_id
  10. ) values (
  11. #{refundFee},#{mchId},#{orderId},#{totalFee},#{openId},#{appId},#{payId},#{state},#{message},#{payName},#{transactionId}
  12. )
  13. </insert>
  14. <!-- 查询线上支付信息 add by wuxw 2018-07-03 -->
  15. <select id="getOnlinePayInfo" parameterType="Map" resultType="Map">
  16. select t.refund_fee,t.refund_fee refundFee,t.mch_id,t.mch_id mchId,t.order_id,t.order_id
  17. orderId,t.total_fee,t.total_fee totalFee,t.open_id,t.open_id openId,t.app_id,t.app_id
  18. appId,t.status_cd,t.status_cd statusCd,t.pay_id,t.pay_id payId,t.state,t.message,t.pay_name,t.pay_name
  19. payName,t.transaction_id,t.transaction_id transactionId
  20. from online_pay t
  21. where 1 =1
  22. <if test="refundFee !=null and refundFee != ''">
  23. and t.refund_fee= #{refundFee}
  24. </if>
  25. <if test="mchId !=null and mchId != ''">
  26. and t.mch_id= #{mchId}
  27. </if>
  28. <if test="orderId !=null and orderId != ''">
  29. and t.order_id= #{orderId}
  30. </if>
  31. <if test="totalFee !=null and totalFee != ''">
  32. and t.total_fee= #{totalFee}
  33. </if>
  34. <if test="openId !=null and openId != ''">
  35. and t.open_id= #{openId}
  36. </if>
  37. <if test="appId !=null and appId != ''">
  38. and t.app_id= #{appId}
  39. </if>
  40. <if test="statusCd !=null and statusCd != ''">
  41. and t.status_cd= #{statusCd}
  42. </if>
  43. <if test="payId !=null and payId != ''">
  44. and t.pay_id= #{payId}
  45. </if>
  46. <if test="state !=null and state != ''">
  47. and t.state= #{state}
  48. </if>
  49. <if test="message !=null and message != ''">
  50. and t.message= #{message}
  51. </if>
  52. <if test="payName !=null and payName != ''">
  53. and t.pay_name= #{payName}
  54. </if>
  55. <if test="transactionId !=null and transactionId != ''">
  56. and t.transaction_id= #{transactionId}
  57. </if>
  58. order by t.create_time desc
  59. <if test="page != -1 and page != null ">
  60. limit #{page}, #{row}
  61. </if>
  62. </select>
  63. <!-- 修改线上支付信息 add by wuxw 2018-07-03 -->
  64. <update id="updateOnlinePayInfo" parameterType="Map">
  65. update online_pay t set t.status_cd = #{statusCd}
  66. <if test="newBId != null and newBId != ''">
  67. ,t.b_id = #{newBId}
  68. </if>
  69. <if test="refundFee !=null and refundFee != ''">
  70. , t.refund_fee= #{refundFee}
  71. </if>
  72. <if test="mchId !=null and mchId != ''">
  73. , t.mch_id= #{mchId}
  74. </if>
  75. <if test="orderId !=null and orderId != ''">
  76. , t.order_id= #{orderId}
  77. </if>
  78. <if test="totalFee !=null and totalFee != ''">
  79. , t.total_fee= #{totalFee}
  80. </if>
  81. <if test="openId !=null and openId != ''">
  82. , t.open_id= #{openId}
  83. </if>
  84. <if test="appId !=null and appId != ''">
  85. , t.app_id= #{appId}
  86. </if>
  87. <if test="state !=null and state != ''">
  88. , t.state= #{state}
  89. </if>
  90. <if test="message !=null and message != ''">
  91. , t.message= #{message}
  92. </if>
  93. <if test="payName !=null and payName != ''">
  94. , t.pay_name= #{payName}
  95. </if>
  96. <if test="transactionId !=null and transactionId != ''">
  97. , t.transaction_id= #{transactionId}
  98. </if>
  99. where 1=1
  100. <if test="payId !=null and payId != ''">
  101. and t.pay_id= #{payId}
  102. </if>
  103. </update>
  104. <!-- 查询线上支付数量 add by wuxw 2018-07-03 -->
  105. <select id="queryOnlinePaysCount" parameterType="Map" resultType="Map">
  106. select count(1) count
  107. from online_pay t
  108. where 1 =1
  109. <if test="refundFee !=null and refundFee != ''">
  110. and t.refund_fee= #{refundFee}
  111. </if>
  112. <if test="mchId !=null and mchId != ''">
  113. and t.mch_id= #{mchId}
  114. </if>
  115. <if test="orderId !=null and orderId != ''">
  116. and t.order_id= #{orderId}
  117. </if>
  118. <if test="totalFee !=null and totalFee != ''">
  119. and t.total_fee= #{totalFee}
  120. </if>
  121. <if test="openId !=null and openId != ''">
  122. and t.open_id= #{openId}
  123. </if>
  124. <if test="appId !=null and appId != ''">
  125. and t.app_id= #{appId}
  126. </if>
  127. <if test="statusCd !=null and statusCd != ''">
  128. and t.status_cd= #{statusCd}
  129. </if>
  130. <if test="payId !=null and payId != ''">
  131. and t.pay_id= #{payId}
  132. </if>
  133. <if test="state !=null and state != ''">
  134. and t.state= #{state}
  135. </if>
  136. <if test="message !=null and message != ''">
  137. and t.message= #{message}
  138. </if>
  139. <if test="payName !=null and payName != ''">
  140. and t.pay_name= #{payName}
  141. </if>
  142. <if test="transactionId !=null and transactionId != ''">
  143. and t.transaction_id= #{transactionId}
  144. </if>
  145. </select>
  146. </mapper>