MkActivitiesGetOneFreeGoodsDao.xml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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.admin.dao.MkActivitiesGetOneFreeGoodsDao">
  4. <resultMap type="com.kmall.admin.entity.MkActivitiesGetOneFreeGoodsEntity" id="mkActivitiesGetOneFreeGoodsMap">
  5. <result property="mkaFreeId" column="mka_free_id"/>
  6. <result property="productName" column="product_name"/>
  7. <result property="edlp" column="edlp"/>
  8. <result property="suggestedRetailPrice" column="suggested_retail_price"/>
  9. <result property="activityPrice" column="activity_price"/>
  10. <result property="shopSn" column="shop_sn"/>
  11. <result property="goodsSn" column="goods_sn"/>
  12. <result property="barcode" column="barcode"/>
  13. <result property="productBrand" column="product_brand"/>
  14. <result property="productSeries" column="product_series"/>
  15. <result property="giftBarcode" column="gift_barcode"/>
  16. <result property="mkaId" column="mka_id"/>
  17. <result property="createTime" column="create_time"/>
  18. <result property="createrSn" column="creater_sn"/>
  19. <result property="moderSn" column="moder_sn"/>
  20. <result property="updateTime" column="update_time"/>
  21. </resultMap>
  22. <select id="queryObject" resultType="com.kmall.admin.entity.MkActivitiesGetOneFreeGoodsEntity">
  23. select
  24. `mka_free_id`,
  25. `product_name`,
  26. `edlp`,
  27. `suggested_retail_price`,
  28. `activity_price`,
  29. `shop_sn`,
  30. `goods_sn`,
  31. `barcode`,
  32. `product_brand`,
  33. `product_series`,
  34. `gift_barcode`,
  35. `mka_id`,
  36. `create_time`,
  37. `creater_sn`,
  38. `moder_sn`,
  39. `update_time`
  40. from mk_activities_get_one_free_goods
  41. where mka_free_id = #{id}
  42. </select>
  43. <select id="queryList" resultType="com.kmall.admin.entity.MkActivitiesGetOneFreeGoodsEntity">
  44. select
  45. `mka_free_id`,
  46. `product_name`,
  47. `edlp`,
  48. `suggested_retail_price`,
  49. `activity_price`,
  50. `shop_sn`,
  51. `goods_sn`,
  52. `barcode`,
  53. `product_brand`,
  54. `product_series`,
  55. `gift_barcode`,
  56. `mka_id`,
  57. `create_time`,
  58. `creater_sn`,
  59. `moder_sn`,
  60. `update_time`
  61. from mk_activities_get_one_free_goods
  62. WHERE 1=1
  63. <if test="name != null and name.trim() != ''">
  64. AND name LIKE concat('%',#{name},'%')
  65. </if>
  66. <choose>
  67. <when test="sidx != null and sidx.trim() != ''">
  68. order by ${sidx} ${order}
  69. </when>
  70. <otherwise>
  71. order by mka_free_id desc
  72. </otherwise>
  73. </choose>
  74. <if test="offset != null and limit != null">
  75. limit #{offset}, #{limit}
  76. </if>
  77. </select>
  78. <select id="queryTotal" resultType="int">
  79. select count(*) from mk_activities_get_one_free_goods
  80. WHERE 1=1
  81. <if test="name != null and name.trim() != ''">
  82. AND name LIKE concat('%',#{name},'%')
  83. </if>
  84. </select>
  85. <insert id="save" parameterType="com.kmall.admin.entity.MkActivitiesGetOneFreeGoodsEntity" useGeneratedKeys="true" keyProperty="mkaFreeId">
  86. insert into mk_activities_get_one_free_goods(
  87. `product_name`,
  88. `edlp`,
  89. `suggested_retail_price`,
  90. `activity_price`,
  91. `shop_sn`,
  92. `goods_sn`,
  93. `barcode`,
  94. `product_brand`,
  95. `product_series`,
  96. `gift_barcode`,
  97. `mka_id`,
  98. `create_time`,
  99. `creater_sn`,
  100. `moder_sn`,
  101. `update_time`)
  102. values(
  103. #{productName},
  104. #{edlp},
  105. #{suggestedRetailPrice},
  106. #{activityPrice},
  107. #{shopSn},
  108. #{goodsSn},
  109. #{barcode},
  110. #{productBrand},
  111. #{productSeries},
  112. #{giftBarcode},
  113. #{mkaId},
  114. #{createTime},
  115. #{createrSn},
  116. #{moderSn},
  117. #{updateTime})
  118. </insert>
  119. <update id="update" parameterType="com.kmall.admin.entity.MkActivitiesGetOneFreeGoodsEntity">
  120. update mk_activities_get_one_free_goods
  121. <set>
  122. <if test="productName != null">`product_name` = #{productName}, </if>
  123. <if test="edlp != null">`edlp` = #{edlp}, </if>
  124. <if test="suggestedRetailPrice != null">`suggested_retail_price` = #{suggestedRetailPrice}, </if>
  125. <if test="activityPrice != null">`activity_price` = #{activityPrice}, </if>
  126. <if test="shopSn != null">`shop_sn` = #{shopSn}, </if>
  127. <if test="goodsSn != null">`goods_sn` = #{goodsSn}, </if>
  128. <if test="barcode != null">`barcode` = #{barcode}, </if>
  129. <if test="productBrand != null">`product_brand` = #{productBrand}, </if>
  130. <if test="productSeries != null">`product_series` = #{productSeries}, </if>
  131. <if test="giftBarcode != null">`gift_barcode` = #{giftBarcode}, </if>
  132. <if test="mkaId != null">`mka_id` = #{mkaId}, </if>
  133. <if test="createTime != null">`create_time` = #{createTime}, </if>
  134. <if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
  135. <if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
  136. <if test="updateTime != null">`update_time` = #{updateTime}</if>
  137. </set>
  138. where mka_free_id = #{mkaFreeId}
  139. </update>
  140. <delete id="delete">
  141. delete from mk_activities_get_one_free_goods where mka_free_id = #{value}
  142. </delete>
  143. <delete id="deleteBatch">
  144. delete from mk_activities_get_one_free_goods where mka_free_id in
  145. <foreach item="mkaFreeId" collection="array" open="(" separator="," close=")">
  146. #{mkaFreeId}
  147. </foreach>
  148. </delete>
  149. </mapper>