package com.webmanage.mapper;
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.webmanage.entity.Cart;
|
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Param;
|
|
import java.util.List;
|
|
/**
|
* 购物车Mapper接口
|
*/
|
@Mapper
|
public interface CartMapper extends BaseMapper<Cart> {
|
|
/**
|
* 根据用户ID和单位ID查询购物车商品列表
|
*/
|
List<Cart> selectByUserIdAndUnitId(@Param("userId") Long userId, @Param("unitId") Long unitId);
|
|
/**
|
* 根据用户ID、单位ID和定价ID查询购物车商品
|
*/
|
Cart selectByUserIdUnitIdAndPricingId(@Param("userId") Long userId, @Param("unitId") Long unitId, @Param("pricingId") Long pricingId);
|
|
/**
|
* 根据用户ID和单位ID统计购物车商品数量
|
*/
|
Integer countByUserIdAndUnitId(@Param("userId") Long userId, @Param("unitId") Long unitId);
|
|
/**
|
* 根据用户ID和单位ID计算购物车总金额
|
*/
|
java.math.BigDecimal sumTotalAmountByUserIdAndUnitId(@Param("userId") Long userId, @Param("unitId") Long unitId);
|
|
Integer deleteByCustomerCondition(@Param("id") Long id);
|
}
|