PmsSkuStockDao.xml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435
  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.macro.mall.dao.PmsSkuStockDao">
  4. <insert id="insertList">
  5. INSERT INTO pms_sku_stock (product_id, sku_code, price, stock, low_stock, sp1, sp2, sp3, pic, sale) VALUES
  6. <foreach collection="list" item="item" index="index" separator=",">
  7. (#{item.productId,jdbcType=BIGINT},
  8. #{item.skuCode,jdbcType=VARCHAR},
  9. #{item.price,jdbcType=DECIMAL},
  10. #{item.stock,jdbcType=INTEGER},
  11. #{item.lowStock,jdbcType=INTEGER},
  12. #{item.sp1,jdbcType=VARCHAR},
  13. #{item.sp2,jdbcType=VARCHAR},
  14. #{item.sp3,jdbcType=VARCHAR},
  15. #{item.pic,jdbcType=VARCHAR},
  16. #{item.sale,jdbcType=INTEGER})
  17. </foreach>
  18. </insert>
  19. <insert id="replaceList">
  20. REPLACE INTO pms_sku_stock (id,product_id, sku_code, price, stock, low_stock, sp1, sp2, sp3, pic, sale) VALUES
  21. <foreach collection="list" item="item" index="index" separator=",">
  22. (#{item.id,jdbcType=BIGINT},
  23. #{item.productId,jdbcType=BIGINT},
  24. #{item.skuCode,jdbcType=VARCHAR},
  25. #{item.price,jdbcType=DECIMAL},
  26. #{item.stock,jdbcType=INTEGER},
  27. #{item.lowStock,jdbcType=INTEGER},
  28. #{item.sp1,jdbcType=VARCHAR},
  29. #{item.sp2,jdbcType=VARCHAR},
  30. #{item.sp3,jdbcType=VARCHAR},
  31. #{item.pic,jdbcType=VARCHAR},
  32. #{item.sale,jdbcType=INTEGER})
  33. </foreach>
  34. </insert>
  35. </mapper>