package com.caimei.mapper; import com.caimei.model.dto.CartDto; import com.caimei.model.po.CmCartPo; import com.caimei.model.vo.CartProductVo; import com.caimei.model.vo.ShopVo; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; /** * Description * * @author : plf * @date : 2021/3/23 */ @Mapper public interface ShoppingCartMapper { /** * 查询购物车 * * @param userId 机构id * @param productId 组织商品id * @return */ CmCartPo findCartProduct(@Param("userId") Integer userId, @Param("productId") Integer productId); /** * 保存购物车 * * @param cart */ void insertCart(CartDto cart); /** * 修改购物车数量 * * @param cartId * @param productCount */ void updateByProductCount(@Param("cartId") Integer cartId, @Param("productCount") int productCount); /** * 查询购物车数量 * * @param userId * @return */ Integer getCartQuantity(Integer userId); /** * 查询购物车对应供应商 * * @param userId * @return */ List findCartShop(Integer userId); /** * 查询购物车该供应商下商品 * * @param shopId * @param userId * @return */ List findByShopCartProduct(@Param("shopId") Integer shopId, @Param("userId") Integer userId); /** * 查询失效购物车商品 * * @param userId * @return */ List findExpiredGoods(Integer userId); /** * 删除购物车 * * @param cartId */ void deleteCart(String cartId); }