退单接口修改 购物车查询逻辑修改
This commit is contained in:
@@ -7,6 +7,7 @@ import cn.ysk.cashier.vo.TbCashierCartVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -36,4 +37,15 @@ public interface TbCashierCartMapper extends BaseMapper<TbCashierCart> {
|
||||
|
||||
@Select("select a.*, b.spec_snap from tb_cashier_cart as a left join tb_product_sku as b on a.sku_id=b.id where a.shop_id=#{shopId} and a.status='refund';")
|
||||
List<TbCashierCartVO> selectPending(Integer shopId);
|
||||
|
||||
/**
|
||||
* 更新购物车数量以及金额
|
||||
* @param id id
|
||||
* @param status 状态
|
||||
* @param changeNum 修改数量 正数增加 负数减少
|
||||
* @return 影响行数
|
||||
*/
|
||||
@Update("update tb_cashier_cart set status=#{status}, total_amount=(number+#{changeNum})*sale_price,number=number+#{changeNum},total_number=total_number+#{changeNum} " +
|
||||
"where id=#{id}")
|
||||
int updateNumAmountStatus(Integer id, String status, Integer changeNum);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,18 @@ package cn.ysk.cashier.mybatis.mapper;
|
||||
|
||||
import cn.ysk.cashier.pojo.order.TbOrderDetail;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
public interface TbOrderDetailMapper extends BaseMapper<TbOrderDetail> {
|
||||
|
||||
/**
|
||||
* 更新购物车数量以及金额
|
||||
* @param id id
|
||||
* @param status 状态
|
||||
* @param changeNum 修改数量 正数增加 负数减少
|
||||
* @return 影响行数
|
||||
*/
|
||||
@Update("update tb_order_detail set status=#{status}, price_amount=(num+#{changeNum})*price,num=num+#{changeNum} " +
|
||||
"where id=#{id}")
|
||||
int updateNumAmountStatus(Integer id, String status, int changeNum);
|
||||
}
|
||||
|
||||
@@ -39,6 +39,4 @@ public interface TbOrderInfoMapper extends BaseMapper<TbOrderInfo> {
|
||||
"order_amount=origin_amount-#{priceAmount}, amount=amount-#{priceAmount}," +
|
||||
"order_amount=order_amount-#{priceAmount} where id=#{orderId} and origin_amount-#{priceAmount} >= 0")
|
||||
int updateOrderAmount(Integer orderId, BigDecimal priceAmount, BigDecimal packAmount);
|
||||
|
||||
void cancelOrder();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user