package com.czg.service.product.mapper;

import com.czg.product.dto.ProductDTO;
import com.czg.product.entity.Product;
import com.czg.product.vo.ProductVO;
import com.czg.product.vo.RecommendProVO;
import com.czg.product.vo.ShopProductInfoVo;
import com.czg.product.vo.ShopProductVo;
import com.mybatisflex.core.BaseMapper;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品
 *
 * @author Tankaikai tankaikai@aliyun.com
 * @since 1.0 2025-02-16
 */
@Mapper
public interface ProductMapper extends BaseMapper<Product> {

    Page<ProductDTO> selectProductPage();

    long selectProductPage_COUNT();

    List<ProductDTO> selectProductList(QueryWrapper qw);

    List<ShopProductVo> selectHotsProductList(@Param("shopId") Long shopId);

    List<ShopProductVo> selectGroupProductList(@Param("shopId") Long shopId, @Param("idList") List<Long> idList);

    ShopProductInfoVo selectOneProductInfo(@Param("id") Long id, @Param("shopId") Long shopId);

    List<RecommendProVO> selectCouponProBySaleNum();

    List<RecommendProVO> selectRecommendProductList(@Param("lng") String lng, @Param("lat") String lat, @Param("address") String address,
                                                    @Param("classify") Integer classify, @Param("orderType") Integer orderType,
                                                    @Param("distanceType") Integer distanceType, @Param("name") String name);

    List<RecommendProVO> getTodayProInfo();

    String getShopName(@Param("shopId") Long shopId);

    List<ProductVO> productList(@Param("shopId") Long shopId, @Param("productIds") List<Long> productIds);
}
