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