|
@@ -40,10 +40,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</insert>
|
|
</insert>
|
|
|
<update id="updateQuantityAtomically">
|
|
<update id="updateQuantityAtomically">
|
|
|
UPDATE fs_integral_cart
|
|
UPDATE fs_integral_cart
|
|
|
- SET quantity = LEAST(quantity + #{addQuantity}, #{maxQuantity}),
|
|
|
|
|
|
|
+ SET cart_num = LEAST(cart_num + #{addQuantity}, #{maxQuantity}),
|
|
|
is_selected = 1,
|
|
is_selected = 1,
|
|
|
update_time = NOW()
|
|
update_time = NOW()
|
|
|
- WHERE user_id = #{userId} AND goods_id = #{goodsId} AND quantity <![CDATA[<]]> #{maxQuantity}
|
|
|
|
|
|
|
+ WHERE user_id = #{userId} AND goods_id = #{goodsId} AND cart_num <![CDATA[<]]> #{maxQuantity}
|
|
|
</update>
|
|
</update>
|
|
|
|
|
|
|
|
<select id="getCartCountByMap" resultType="java.lang.Integer">
|
|
<select id="getCartCountByMap" resultType="java.lang.Integer">
|
|
@@ -91,7 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</where>
|
|
</where>
|
|
|
</select>
|
|
</select>
|
|
|
<select id="getFsIntegralCartList" resultType="com.fs.his.vo.GetFsIntegralCartListVo">
|
|
<select id="getFsIntegralCartList" resultType="com.fs.his.vo.GetFsIntegralCartListVo">
|
|
|
- select fc.*,fg.*,fg.integral as goodsIntegral,fu.integral as userIntegral
|
|
|
|
|
|
|
+ select fc.id as cart_id, fc.cart_num AS quantity,fc.*,fg.*,fg.integral as goodsIntegral,fu.integral as userIntegral
|
|
|
from fs_integral_cart fc
|
|
from fs_integral_cart fc
|
|
|
left join fs_integral_goods fg on fc.goods_id = fg.goods_id
|
|
left join fs_integral_goods fg on fc.goods_id = fg.goods_id
|
|
|
left join fs_user fu on fu.user_id = fc.user_id
|
|
left join fs_user fu on fu.user_id = fc.user_id
|