MkActivitiesCombinationPriceDao.xml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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="combinationBarcode" column="combination_barcode"/>
  7. <result property="goodsSn" column="goods_sn"/>
  8. <result property="barcode" column="barcode"/>
  9. <result property="combinationNum" column="combination_num"/>
  10. <result property="productName" column="product_name"/>
  11. <result property="combinedPrice" column="combined_price"/>
  12. <result property="mkaId" column="mka_id"/>
  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. `combination_barcode`,
  22. `goods_sn`,
  23. `barcode`,
  24. `combination_num`,
  25. `product_name`,
  26. `combined_price`,
  27. `mka_id`,
  28. `create_time`,
  29. `creater_sn`,
  30. `moder_sn`,
  31. `update_time`
  32. from mk_activities_combination_price
  33. where macp_id = #{id}
  34. </select>
  35. <select id="queryList" resultType="com.kmall.admin.entity.MkActivitiesCombinationPriceEntity">
  36. select
  37. `macp_id`,
  38. `combination_barcode`,
  39. `goods_sn`,
  40. `barcode`,
  41. `combination_num`,
  42. `product_name`,
  43. `combined_price`,
  44. `mka_id`,
  45. `create_time`,
  46. `creater_sn`,
  47. `moder_sn`,
  48. `update_time`
  49. from mk_activities_combination_price
  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 macp_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 mk_activities_combination_price
  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.admin.entity.MkActivitiesCombinationPriceEntity" useGeneratedKeys="true" keyProperty="macpId">
  74. insert into mk_activities_combination_price(
  75. `combination_barcode`,
  76. `goods_sn`,
  77. `barcode`,
  78. `combination_num`,
  79. `product_name`,
  80. `combined_price`,
  81. `mka_id`,
  82. `create_time`,
  83. `creater_sn`,
  84. `moder_sn`,
  85. `update_time`)
  86. values(
  87. #{combinationBarcode},
  88. #{goodsSn},
  89. #{barcode},
  90. #{combinationNum},
  91. #{productName},
  92. #{combinedPrice},
  93. #{mkaId},
  94. #{createTime},
  95. #{createrSn},
  96. #{moderSn},
  97. #{updateTime})
  98. </insert>
  99. <update id="update" parameterType="com.kmall.admin.entity.MkActivitiesCombinationPriceEntity">
  100. update mk_activities_combination_price
  101. <set>
  102. <if test="combinationBarcode != null">`combination_barcode` = #{combinationBarcode}, </if>
  103. <if test="goodsSn != null">`goods_sn` = #{goodsSn}, </if>
  104. <if test="barcode != null">`barcode` = #{barcode}, </if>
  105. <if test="combinationNum != null">`combination_num` = #{combinationNum}, </if>
  106. <if test="productName != null">`product_name` = #{productName}, </if>
  107. <if test="combinedPrice != null">`combined_price` = #{combinedPrice}, </if>
  108. <if test="mkaId != null">`mka_id` = #{mkaId}, </if>
  109. <if test="createTime != null">`create_time` = #{createTime}, </if>
  110. <if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
  111. <if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
  112. <if test="updateTime != null">`update_time` = #{updateTime}</if>
  113. </set>
  114. where macp_id = #{macpId}
  115. </update>
  116. <delete id="delete">
  117. delete from mk_activities_combination_price where macp_id = #{value}
  118. </delete>
  119. <delete id="deleteBatch">
  120. delete from mk_activities_combination_price where macp_id in
  121. <foreach item="macpId" collection="array" open="(" separator="," close=")">
  122. #{macpId}
  123. </foreach>
  124. </delete>
  125. </mapper>