/*
 * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 * 未经允许，不可做商业用途！
 *
 * 版权所有，侵权必究！
 */

package com.yami.shop.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yami.shop.bean.app.dto.ShopCartItemDto;
import com.yami.shop.bean.app.param.ShopCartParam;
import com.yami.shop.bean.model.Basket;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface BasketMapper extends BaseMapper<Basket> {

    List<ShopCartItemDto> getShopCartItems(@Param("userId") String userId);

    List<ShopCartItemDto> getShopCartItemsByPlatform(@Param("userId") String userId, @Param("channelId") Long channelId);

    void deleteShopCartItemsByBasketIds(@Param("userId") String userId, @Param("basketIds") List<Long> basketIds);

    void deleteAllShopCartItems(@Param("userId") String userId);

    List<ShopCartItemDto> getShopCartExpiryItems(@Param("userId") String userId);

    void cleanExpiryProdList(@Param("userId") String userId);

    List<ShopCartItemDto> shopCartItemDtoList(@Param("basketIdList") List<Long> basketIdList);

    void updateDiscountItemId(@Param("userId") String userId, @Param("shopCartParams") List<ShopCartParam> shopCartParams);

    List<String> listUserIdByProdId(@Param("prodId") Long prodId);

    ShopCartItemDto getShopCartItemsByShopIdSkuIdUserId(@Param("shopId") Long shopId, @Param("skuId") Long skuId, @Param("userId")String userId);

    Long findByCount( @Param("prodId")Long prodId, @Param("shopId") Long shopId, @Param("userId") String userId);
}
