PayerChildOrderRealMapper.xml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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.dao.PayerChildOrderRealDao">
  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. <choose>
  58. <when test="sidx != null and sidx.trim() != ''">
  59. order by ${sidx} ${order}
  60. </when>
  61. <otherwise>
  62. order by id desc
  63. </otherwise>
  64. </choose>
  65. <if test="offset != null and limit != null">
  66. limit #{offset}, #{limit}
  67. </if>
  68. </select>
  69. <select id="queryTotal" resultType="int">
  70. select count(*) from mall_payer_child_order_real
  71. WHERE 1=1
  72. <if test="name != null and name.trim() != ''">
  73. AND name LIKE concat('%',#{name},'%')
  74. </if>
  75. </select>
  76. <insert id="save" parameterType="com.kmall.api.entity.PayerChildOrderRealEntity">
  77. insert into mall_payer_child_order_real(
  78. `id`,
  79. `order_sn`,
  80. `user_id`,
  81. `merch_order_sn`,
  82. `pay_no`,
  83. `merch_sn`,
  84. `pay_price`,
  85. `goods_biz_type`,
  86. `creater_sn`,
  87. `create_time`,
  88. `moder_sn`,
  89. `mod_time`,
  90. `tstm`)
  91. values(
  92. #{id},
  93. #{orderSn},
  94. #{userId},
  95. #{merchOrderSn},
  96. #{payNo},
  97. #{merchSn},
  98. #{payPrice},
  99. #{goodsBizType},
  100. #{createrSn},
  101. #{createTime},
  102. #{moderSn},
  103. #{modTime},
  104. #{tstm})
  105. </insert>
  106. <update id="update" parameterType="com.kmall.api.entity.PayerChildOrderRealEntity">
  107. update mall_payer_child_order_real
  108. <set>
  109. <if test="orderSn != null">`order_sn` = #{orderSn}, </if>
  110. <if test="userId != null">`user_id` = #{userId}, </if>
  111. <if test="merchOrderSn != null">`merch_order_sn` = #{merchOrderSn}, </if>
  112. <if test="payNo != null">`pay_no` = #{payNo}, </if>
  113. <if test="merchSn != null">`merch_sn` = #{merchSn}, </if>
  114. <if test="payPrice != null">`pay_price` = #{payPrice}, </if>
  115. <if test="goodsBizType != null">`goods_biz_type` = #{goodsBizType}, </if>
  116. <if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
  117. <if test="createTime != null">`create_time` = #{createTime}, </if>
  118. <if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
  119. <if test="modTime != null">`mod_time` = #{modTime}, </if>
  120. <if test="tstm != null">`tstm` = #{tstm}</if>
  121. </set>
  122. where id = #{id}
  123. </update>
  124. <delete id="delete">
  125. delete from mall_payer_child_order_real where id = #{value}
  126. </delete>
  127. <delete id="deleteBatch">
  128. delete from mall_payer_child_order_real where id in
  129. <foreach item="id" collection="array" open="(" separator="," close=")">
  130. #{id}
  131. </foreach>
  132. </delete>
  133. </mapper>