|
@@ -51,32 +51,32 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getCartProductsByShopId" resultType="com.caimei365.order.model.vo.CartItemVo">
|
|
|
- SELECT c.cm_cartID AS id,
|
|
|
- c.productCount AS number,
|
|
|
- p.productID AS productId,
|
|
|
- p.shopID AS shopId,
|
|
|
- p.`name` AS `name`,
|
|
|
- p.mainImage AS image,
|
|
|
+ SELECT c.cm_cartID AS id,
|
|
|
+ c.productCount AS number,
|
|
|
+ p.productID AS productId,
|
|
|
+ p.shopID AS shopId,
|
|
|
+ p.`name` AS `name`,
|
|
|
+ p.mainImage AS image,
|
|
|
p.productCode,
|
|
|
c.skuId,
|
|
|
cs.price,
|
|
|
- cs.price AS originalPrice,
|
|
|
- cs.unit AS unit,
|
|
|
- cs.stock AS stock,
|
|
|
- p.step AS step,
|
|
|
- cs.minBuyNumber AS min,
|
|
|
+ cs.price AS originalPrice,
|
|
|
+ cs.unit AS unit,
|
|
|
+ cs.stock AS stock,
|
|
|
+ p.step AS step,
|
|
|
+ cs.minBuyNumber AS min,
|
|
|
p.priceFlag,
|
|
|
- cs.ladderPriceFlag AS ladderFlag,
|
|
|
- p.includedTax AS includedTax,
|
|
|
- p.invoiceType AS invoiceType,
|
|
|
- p.taxPoint AS taxRate,
|
|
|
+ ifnull(cs.ladderPriceFlag, 0) AS ladderFlag,
|
|
|
+ p.includedTax AS includedTax,
|
|
|
+ p.invoiceType AS invoiceType,
|
|
|
+ p.taxPoint AS taxRate,
|
|
|
p.productCategory,
|
|
|
- p.validFlag AS validFlag,
|
|
|
+ p.validFlag AS validFlag,
|
|
|
p.visibility,
|
|
|
- if(csp.id is not null, 1, 0) as svipProductFlag,
|
|
|
- csp.priceType as svipPriceType,
|
|
|
- csp.discount as svipDiscount,
|
|
|
- csp.discountPrice as svipDiscountPrice,
|
|
|
+ if(csp.id is not null, 1, 0) as svipProductFlag,
|
|
|
+ csp.priceType as svipPriceType,
|
|
|
+ csp.discount as svipDiscount,
|
|
|
+ csp.discountPrice as svipDiscountPrice,
|
|
|
p.productType
|
|
|
FROM cm_cart c
|
|
|
LEFT JOIN product P on c.productID = p.productID
|
|
@@ -222,14 +222,21 @@
|
|
|
set productCount = #{productCount},
|
|
|
addTime = #{addTime},
|
|
|
productId = (select productId from cm_sku where skuId = #{skuId}),
|
|
|
- shopId = (select shopId from product p left join cm_sku cs on p.productId=cs.productId where cs.skuId=#{skuId})
|
|
|
+ shopId = (select shopId
|
|
|
+ from product p
|
|
|
+ left join cm_sku cs on p.productId = cs.productId
|
|
|
+ where cs.skuId = #{skuId})
|
|
|
WHERE userID = #{userId}
|
|
|
AND skuId = #{skuId}
|
|
|
</update>
|
|
|
<insert id="insertCart" keyColumn="cm_cartID" keyProperty="id" parameterType="com.caimei365.order.model.po.CartPo"
|
|
|
useGeneratedKeys="true">
|
|
|
INSERT INTO cm_cart (skuId, shopID, productID, userID, productCount, addTime, reBuyFlag)
|
|
|
- VALUES (#{skuId}, #{shopId}, (select productId from cm_sku where skuId = #{skuId}), #{userId}, #{productCount}, #{addTime}, #{reBuyFlag})
|
|
|
+ VALUES (#{skuId},
|
|
|
+ (select shopId from product p left join cm_sku cs on p.productId = cs.productId where cs.skuId = #{skuId}),
|
|
|
+ (select productId from cm_sku where skuId = #{skuId}), #{userId},
|
|
|
+ #{productCount},
|
|
|
+ #{addTime}, #{reBuyFlag})
|
|
|
</insert>
|
|
|
<delete id="deleteCartByProductIds">
|
|
|
DELETE FROM cm_cart
|