|
@@ -10,14 +10,14 @@
|
|
|
FROM cm_cart c
|
|
|
LEFT JOIN shop s ON c.shopID = s.shopID
|
|
|
WHERE c.userID = #{userId}
|
|
|
- GROUP BY c.shopID
|
|
|
+ GROUP BY c.shopID, c.cm_cartID
|
|
|
ORDER BY c.cm_cartID DESC
|
|
|
</select>
|
|
|
<select id="getCartShopsByProductIds" resultType="com.caimei365.order.model.vo.CartShopVo">
|
|
|
SELECT
|
|
|
- c.shopID AS shopId,
|
|
|
- s.name AS shopName,
|
|
|
- s.logo AS shopLogo
|
|
|
+ c.shopID AS shopId,
|
|
|
+ s.name AS shopName,
|
|
|
+ s.logo AS shopLogo
|
|
|
FROM cm_cart c
|
|
|
LEFT JOIN shop s ON c.shopID = s.shopID
|
|
|
WHERE c.userID = #{userId}
|
|
@@ -25,7 +25,7 @@
|
|
|
<foreach collection="productIds" open="(" separator="," close=")" item="productId">
|
|
|
#{productId}
|
|
|
</foreach>
|
|
|
- GROUP BY c.shopID
|
|
|
+ GROUP BY c.shopID, c.cm_cartID
|
|
|
ORDER BY c.cm_cartID DESC
|
|
|
</select>
|
|
|
<select id="getCartProductsByShopId" resultType="com.caimei365.order.model.vo.CartItemVo">
|
|
@@ -114,6 +114,7 @@
|
|
|
c.cm_cartID AS id,
|
|
|
c.productCount,
|
|
|
c.productID AS productId,
|
|
|
+ c.shopID AS shopId,
|
|
|
c.userID AS userId
|
|
|
FROM cm_cart c
|
|
|
WHERE c.productID = #{productId} and c.userID = #{userId}
|
|
@@ -127,8 +128,8 @@
|
|
|
WHERE userID = #{userId} AND productID = #{productId}
|
|
|
</update>
|
|
|
<insert id="insertCart" keyColumn="cm_cartID" keyProperty="id" parameterType="com.caimei365.order.model.po.CartPo" useGeneratedKeys="true">
|
|
|
- INSERT INTO cm_cart (productID, userID, productCount, addTime, reBuyFlag)
|
|
|
- VALUES (#{productId}, #{userId}, #{productCount}, #{addTime}, #{reBuyFlag})
|
|
|
+ INSERT INTO cm_cart (shopID, productID, userID, productCount, addTime, reBuyFlag)
|
|
|
+ VALUES (#{shopId}, #{productId}, #{userId}, #{productCount}, #{addTime}, #{reBuyFlag})
|
|
|
</insert>
|
|
|
<delete id="deleteCartByProductIds">
|
|
|
DELETE FROM cm_cart
|