MkActivitiesCombinationPriceDao.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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="storeId != null and storeId.trim() != ''">
  51. AND shop_sn = #{storeId}
  52. </if>
  53. <if test="mkaId != null">
  54. AND mka_id = #{mkaId}
  55. </if>
  56. <if test="name != null and name.trim() != ''">
  57. AND combination_type like concat ( '%' , #{name}, '%')
  58. </if>
  59. <choose>
  60. <when test="sidx != null and sidx.trim() != ''">
  61. order by ${sidx} ${order}
  62. </when>
  63. <otherwise>
  64. order by macp_id desc
  65. </otherwise>
  66. </choose>
  67. <if test="offset != null and limit != null">
  68. limit #{offset}, #{limit}
  69. </if>
  70. </select>
  71. <select id="queryTotal" resultType="int">
  72. select count(*) from mk_activities_combination_price
  73. WHERE 1=1
  74. <if test="storeId != null and storeId.trim() != ''">
  75. AND shop_sn = #{storeId}
  76. </if>
  77. <if test="mkaId != null">
  78. AND mka_id = #{mkaId}
  79. </if>
  80. <if test="name != null and name.trim() != ''">
  81. AND combination_type like concat ( '%' , #{name}, '%')
  82. </if>
  83. </select>
  84. <insert id="save" parameterType="com.kmall.admin.entity.MkActivitiesCombinationPriceEntity" useGeneratedKeys="true" keyProperty="macpId">
  85. insert into mk_activities_combination_price(
  86. `goods_sn`,
  87. `barcode`,
  88. `combination_num`,
  89. `combined_price`,
  90. `combination_type`,
  91. `mka_id`,
  92. `deadline`,
  93. `create_time`,
  94. `creater_sn`,
  95. `moder_sn`,
  96. `update_time`)
  97. values(
  98. #{goodsSn},
  99. #{barcode},
  100. #{combinationNum},
  101. #{combinedPrice},
  102. #{combinationType},
  103. #{mkaId},
  104. #{deadline},
  105. #{createTime},
  106. #{createrSn},
  107. #{moderSn},
  108. #{updateTime})
  109. </insert>
  110. <insert id="saveBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
  111. insert into mk_activities_combination_price(
  112. `goods_sn`,
  113. `barcode`,
  114. `combination_num`,
  115. `combined_price`,
  116. `combination_type`,
  117. `mka_id`,
  118. `deadline`,
  119. `create_time`,
  120. `creater_sn`,
  121. `moder_sn`,
  122. `update_time`)
  123. values
  124. <foreach collection="list" index="index" item="item" separator=",">
  125. (
  126. #{item.goodsSn},
  127. #{item.barcode},
  128. #{item.combinationNum},
  129. #{item.combinedPrice},
  130. #{item.combinationType},
  131. #{item.mkaId},
  132. #{item.deadline},
  133. #{item.createTime},
  134. #{item.createrSn},
  135. #{item.moderSn},
  136. #{item.updateTime}
  137. )
  138. </foreach>
  139. </insert>
  140. <update id="update" parameterType="com.kmall.admin.entity.MkActivitiesCombinationPriceEntity">
  141. update mk_activities_combination_price
  142. <set>
  143. <if test="goodsSn != null">`goods_sn` = #{goodsSn}, </if>
  144. <if test="barcode != null">`barcode` = #{barcode}, </if>
  145. <if test="combinationNum != null">`combination_num` = #{combinationNum}, </if>
  146. <if test="combinedPrice != null">`combined_price` = #{combinedPrice}, </if>
  147. <if test="combinationType != null">`combination_type` = #{combinationType}, </if>
  148. <if test="mkaId != null">`mka_id` = #{mkaId}, </if>
  149. <if test="deadline != null">`deadline` = #{deadline}, </if>
  150. <if test="createTime != null">`create_time` = #{createTime}, </if>
  151. <if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
  152. <if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
  153. <if test="updateTime != null">`update_time` = #{updateTime}</if>
  154. </set>
  155. where macp_id = #{macpId}
  156. </update>
  157. <delete id="delete">
  158. delete from mk_activities_combination_price where macp_id = #{value}
  159. </delete>
  160. <delete id="deleteBatch">
  161. delete from mk_activities_combination_price where macp_id in
  162. <foreach item="macpId" collection="array" open="(" separator="," close=")">
  163. #{macpId}
  164. </foreach>
  165. </delete>
  166. </mapper>