1
0

ApiPayerChildOrderRealMapper.xml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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.kmall.api.dao.ApiPayerChildOrderRealMapper">
  4. <resultMap type="com.kmall.api.entity.PayerChildOrderRealEntity" id="payerChildOrderRealMap">
  5. <result property="id" column="id"/>
  6. <result property="orderSn" column="order_sn"/>
  7. <result property="userId" column="user_id"/>
  8. <result property="payNo" column="pay_no"/>
  9. <result property="merchSn" column="merch_sn"/>
  10. <result property="merchOrderSn" column="merch_order_sn"/>
  11. <result property="payPrice" column="pay_price"/>
  12. <result property="goodsBizType" column="goods_biz_type"/>
  13. <result property="createrSn" column="creater_sn"/>
  14. <result property="createTime" column="create_time"/>
  15. <result property="moderSn" column="moder_sn"/>
  16. <result property="modTime" column="mod_time"/>
  17. <result property="tstm" column="tstm"/>
  18. </resultMap>
  19. <select id="queryObject" resultType="com.kmall.api.entity.PayerChildOrderRealEntity">
  20. select
  21. `id`,
  22. `order_sn`,
  23. `user_id`,
  24. `merch_order_sn`,
  25. `pay_no`,
  26. `merch_sn`,
  27. `pay_price`,
  28. `goods_biz_type`,
  29. `creater_sn`,
  30. `create_time`,
  31. `moder_sn`,
  32. `mod_time`,
  33. `tstm`
  34. from mall_payer_child_order_real
  35. where id = #{id}
  36. </select>
  37. <select id="queryList" resultType="com.kmall.api.entity.PayerChildOrderRealEntity">
  38. select
  39. `id`,
  40. `order_sn`,
  41. `user_id`,
  42. `merch_order_sn`,
  43. `pay_no`,
  44. `merch_sn`,
  45. `pay_price`,
  46. `goods_biz_type`,
  47. `creater_sn`,
  48. `create_time`,
  49. `moder_sn`,
  50. `mod_time`,
  51. `tstm`
  52. from mall_payer_child_order_real
  53. WHERE 1=1
  54. <if test="name != null and name.trim() != ''">
  55. AND name LIKE concat('%',#{name},'%')
  56. </if>
  57. <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
  58. AND merch_order_sn = #{merchOrderSn}
  59. </if>
  60. <if test="orderSn != null and orderSn.trim() != ''">
  61. AND order_sn = #{orderSn}
  62. </if>
  63. <choose>
  64. <when test="sidx != null and sidx.trim() != ''">
  65. order by ${sidx} ${order}
  66. </when>
  67. <otherwise>
  68. order by id desc
  69. </otherwise>
  70. </choose>
  71. <if test="offset != null and limit != null">
  72. limit #{offset}, #{limit}
  73. </if>
  74. </select>
  75. <select id="queryTotal" resultType="int">
  76. select count(*) from mall_payer_child_order_real
  77. WHERE 1=1
  78. <if test="name != null and name.trim() != ''">
  79. AND name LIKE concat('%',#{name},'%')
  80. </if>
  81. </select>
  82. <insert id="save" parameterType="com.kmall.api.entity.PayerChildOrderRealEntity">
  83. insert into mall_payer_child_order_real(
  84. `order_sn`,
  85. `user_id`,
  86. `merch_order_sn`,
  87. `pay_no`,
  88. `merch_sn`,
  89. `pay_price`,
  90. `goods_biz_type`,
  91. `creater_sn`,
  92. `create_time`,
  93. `moder_sn`,
  94. `mod_time`,
  95. `tstm`)
  96. values(
  97. #{orderSn},
  98. #{userId},
  99. #{merchOrderSn},
  100. #{payNo},
  101. #{merchSn},
  102. #{payPrice},
  103. #{goodsBizType},
  104. #{createrSn},
  105. #{createTime},
  106. #{moderSn},
  107. #{modTime},
  108. #{tstm})
  109. </insert>
  110. <update id="update" parameterType="com.kmall.api.entity.PayerChildOrderRealEntity">
  111. update mall_payer_child_order_real
  112. <set>
  113. <if test="orderSn != null">`order_sn` = #{orderSn}, </if>
  114. <if test="userId != null">`user_id` = #{userId}, </if>
  115. <if test="merchOrderSn != null">`merch_order_sn` = #{merchOrderSn}, </if>
  116. <if test="payNo != null">`pay_no` = #{payNo}, </if>
  117. <if test="merchSn != null">`merch_sn` = #{merchSn}, </if>
  118. <if test="payPrice != null">`pay_price` = #{payPrice}, </if>
  119. <if test="goodsBizType != null">`goods_biz_type` = #{goodsBizType}, </if>
  120. <if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
  121. <if test="createTime != null">`create_time` = #{createTime}, </if>
  122. <if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
  123. <if test="modTime != null">`mod_time` = #{modTime}, </if>
  124. <if test="tstm != null">`tstm` = #{tstm}</if>
  125. </set>
  126. where id = #{id}
  127. </update>
  128. <delete id="delete">
  129. delete from mall_payer_child_order_real where id = #{value}
  130. </delete>
  131. <delete id="deleteBatch">
  132. delete from mall_payer_child_order_real where id in
  133. <foreach item="id" collection="array" open="(" separator="," close=")">
  134. #{id}
  135. </foreach>
  136. </delete>
  137. </mapper>