GoodsHistoryPriceDao.xml 5.3 KB

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