ShoppingCartMapper.java 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. package com.caimei.mapper;
  2. import com.caimei.model.dto.CartDto;
  3. import com.caimei.model.po.CmCartPo;
  4. import com.caimei.model.vo.CartProductVo;
  5. import com.caimei.model.vo.ShopVo;
  6. import org.apache.ibatis.annotations.Mapper;
  7. import org.apache.ibatis.annotations.Param;
  8. import java.util.List;
  9. /**
  10. * Description
  11. *
  12. * @author : plf
  13. * @date : 2021/3/23
  14. */
  15. @Mapper
  16. public interface ShoppingCartMapper {
  17. /**
  18. * 查询购物车
  19. *
  20. * @param userId 机构id
  21. * @param productId 组织商品id
  22. * @return
  23. */
  24. CmCartPo findCartProduct(@Param("userId") Integer userId, @Param("productId") Integer productId);
  25. /**
  26. * 保存购物车
  27. *
  28. * @param cart
  29. */
  30. void insertCart(CartDto cart);
  31. /**
  32. * 修改购物车数量
  33. *
  34. * @param cartId
  35. * @param productCount
  36. */
  37. void updateByProductCount(@Param("cartId") Integer cartId, @Param("productCount") int productCount);
  38. /**
  39. * 查询购物车数量
  40. *
  41. * @param userId
  42. * @return
  43. */
  44. Integer getCartQuantity(Integer userId);
  45. /**
  46. * 查询购物车对应供应商
  47. *
  48. * @param userId
  49. * @return
  50. */
  51. List<ShopVo> findCartShop(Integer userId);
  52. /**
  53. * 查询购物车该供应商下商品
  54. *
  55. * @param shopId
  56. * @param userId
  57. * @return
  58. */
  59. List<CartProductVo> findByShopCartProduct(@Param("shopId") Integer shopId, @Param("userId") Integer userId);
  60. /**
  61. * 查询失效购物车商品
  62. *
  63. * @param userId
  64. * @return
  65. */
  66. List<CartProductVo> findExpiredGoods(Integer userId);
  67. /**
  68. * 删除购物车
  69. *
  70. * @param cartId
  71. */
  72. void deleteCart(String cartId);
  73. }