MkActivitiesCombinationPriceDao.xml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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.MkActivitiesCombinationPriceDao">
  4. <resultMap type="com.kmall.admin.entity.MkActivitiesCombinationPriceEntity" id="mkActivitiesCombinationPriceMap">
  5. <result property="macpId" column="macp_id"/>
  6. <result property="goodsSn" column="goods_sn"/>
  7. <result property="barcode" column="barcode"/>
  8. <result property="combinationNum" column="combination_num"/>
  9. <result property="combinedPrice" column="combined_price"/>
  10. <result property="combinationType" column="combination_type"/>
  11. <result property="mkaId" column="mka_id"/>
  12. <result property="deadline" column="deadline"/>
  13. <result property="createTime" column="create_time"/>
  14. <result property="createrSn" column="creater_sn"/>
  15. <result property="moderSn" column="moder_sn"/>
  16. <result property="updateTime" column="update_time"/>
  17. </resultMap>
  18. <select id="queryObject" resultType="com.kmall.admin.entity.MkActivitiesCombinationPriceEntity">
  19. select
  20. `macp_id`,
  21. `goods_sn`,
  22. `barcode`,
  23. `combination_num`,
  24. `combined_price`,
  25. `mka_id`,
  26. `deadline`,
  27. `create_time`,
  28. `creater_sn`,
  29. `moder_sn`,
  30. `update_time`
  31. from mk_activities_combination_price
  32. where macp_id = #{id}
  33. </select>
  34. <select id="queryList" resultType="com.kmall.admin.entity.MkActivitiesCombinationPriceEntity">
  35. select
  36. `macp_id`,
  37. `goods_sn`,
  38. `barcode`,
  39. `combination_num`,
  40. `combined_price`,
  41. `combination_type`,
  42. `mka_id`,
  43. `deadline`,
  44. `create_time`,
  45. `creater_sn`,
  46. `moder_sn`,
  47. `update_time`
  48. from mk_activities_combination_price
  49. WHERE 1=1
  50. <if test="name != null and name.trim() != ''">
  51. AND name LIKE concat('%',#{name},'%')
  52. </if>
  53. <if test="storeId != null and storeId.trim() != ''">
  54. AND shop_sn = #{storeId}
  55. </if>
  56. <if test="mkaId != null">
  57. AND mka_id = #{mkaId}
  58. </if>
  59. <if test="prodBarcode != null and prodBarcode.trim() != ''">
  60. AND combination_type like concat ( '%' , #{prodBarcode}, '%')
  61. </if>
  62. <choose>
  63. <when test="sidx != null and sidx.trim() != ''">
  64. order by ${sidx} ${order}
  65. </when>
  66. <otherwise>
  67. order by macp_id desc
  68. </otherwise>
  69. </choose>
  70. <if test="offset != null and limit != null">
  71. limit #{offset}, #{limit}
  72. </if>
  73. </select>
  74. <select id="queryTotal" resultType="int">
  75. select count(*) from mk_activities_combination_price
  76. WHERE 1=1
  77. <if test="name != null and name.trim() != ''">
  78. AND name LIKE concat('%',#{name},'%')
  79. </if>
  80. <if test="storeId != null and storeId.trim() != ''">
  81. AND shop_sn = #{storeId}
  82. </if>
  83. <if test="mkaId != null">
  84. AND mka_id = #{mkaId}
  85. </if>
  86. </select>
  87. <insert id="save" parameterType="com.kmall.admin.entity.MkActivitiesCombinationPriceEntity" useGeneratedKeys="true" keyProperty="macpId">
  88. insert into mk_activities_combination_price(
  89. `goods_sn`,
  90. `barcode`,
  91. `combination_num`,
  92. `combined_price`,
  93. `combination_type`,
  94. `mka_id`,
  95. `deadline`,
  96. `create_time`,
  97. `creater_sn`,
  98. `moder_sn`,
  99. `update_time`)
  100. values(
  101. #{goodsSn},
  102. #{barcode},
  103. #{combinationNum},
  104. #{combinedPrice},
  105. #{combinationType},
  106. #{mkaId},
  107. #{deadline},
  108. #{createTime},
  109. #{createrSn},
  110. #{moderSn},
  111. #{updateTime})
  112. </insert>
  113. <insert id="saveBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
  114. insert into mk_activities_combination_price(
  115. `goods_sn`,
  116. `barcode`,
  117. `combination_num`,
  118. `combined_price`,
  119. `combination_type`,
  120. `mka_id`,
  121. `deadline`,
  122. `create_time`,
  123. `creater_sn`,
  124. `moder_sn`,
  125. `update_time`)
  126. values
  127. <foreach collection="list" index="index" item="item" separator=",">
  128. (
  129. #{item.goodsSn},
  130. #{item.barcode},
  131. #{item.combinationNum},
  132. #{item.combinedPrice},
  133. #{item.combinationType},
  134. #{item.mkaId},
  135. #{item.deadline},
  136. #{item.createTime},
  137. #{item.createrSn},
  138. #{item.moderSn},
  139. #{item.updateTime}
  140. )
  141. </foreach>
  142. </insert>
  143. <update id="update" parameterType="com.kmall.admin.entity.MkActivitiesCombinationPriceEntity">
  144. update mk_activities_combination_price
  145. <set>
  146. <if test="goodsSn != null">`goods_sn` = #{goodsSn}, </if>
  147. <if test="barcode != null">`barcode` = #{barcode}, </if>
  148. <if test="combinationNum != null">`combination_num` = #{combinationNum}, </if>
  149. <if test="combinedPrice != null">`combined_price` = #{combinedPrice}, </if>
  150. <if test="combinationType != null">`combination_type` = #{combinationType}, </if>
  151. <if test="mkaId != null">`mka_id` = #{mkaId}, </if>
  152. <if test="deadline != null">`deadline` = #{deadline}, </if>
  153. <if test="createTime != null">`create_time` = #{createTime}, </if>
  154. <if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
  155. <if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
  156. <if test="updateTime != null">`update_time` = #{updateTime}</if>
  157. </set>
  158. where macp_id = #{macpId}
  159. </update>
  160. <delete id="delete">
  161. delete from mk_activities_combination_price where macp_id = #{value}
  162. </delete>
  163. <delete id="deleteBatch">
  164. delete from mk_activities_combination_price where macp_id in
  165. <foreach item="macpId" collection="array" open="(" separator="," close=")">
  166. #{macpId}
  167. </foreach>
  168. </delete>
  169. </mapper>