PayerChildOrderRealMapper.xml 3.9 KB

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