From c8a179a0bdbc7bdc987788e129efce16d467889f Mon Sep 17 00:00:00 2001 From: p-honggang.li <p-honggang.li@pcitc.com> Date: 星期四, 04 九月 2025 20:44:57 +0800 Subject: [PATCH] 修改购物车逻辑 --- src/main/resources/mapper/CartMapper.xml | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/src/main/resources/mapper/CartMapper.xml b/src/main/resources/mapper/CartMapper.xml index 22f7e4c..1226da6 100644 --- a/src/main/resources/mapper/CartMapper.xml +++ b/src/main/resources/mapper/CartMapper.xml @@ -43,6 +43,9 @@ <if test="unitId !=null and unitId != ''"> AND unit_id = #{unitId} </if> + <if test="productId !=null and productId != ''"> + AND product_id = #{productId} + </if> ORDER BY add_time DESC </select> @@ -55,6 +58,7 @@ AND unit_id = #{unitId} </if> AND pricing_id = #{pricingId} + AND product_id = #{productId} LIMIT 1 </select> @@ -66,6 +70,9 @@ <if test="unitId != '' and unitId != null"> AND unit_id = #{unitId} </if> + <if test="productId != '' and productId != null"> + AND product_id = #{productId} + </if> </select> <select id="sumTotalAmountByUserIdAndUnitId" resultType="java.math.BigDecimal"> -- Gitblit v1.8.0