package com.heketai.website.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.heketai.website.common.result.ReplacePictureRequest;
import com.heketai.website.common.vo.AllProductRequest;
import com.heketai.website.common.vo.ProductVO;
import com.heketai.website.entity.Product;
import com.heketai.website.entity.dto.ProductAttrsDto;
import com.heketai.website.entity.dto.ProductDto;
import com.heketai.website.entity.dto.ProductSortQueryVo;
import com.heketai.website.entity.dto.ReplacePictureDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 商品表 Mapper 接口
 * </p>
 *
 * @author xjl
 * @since 2019-12-17
 */
@Mapper
@Repository
public interface ProductMapper extends BaseMapper<Product> {
    List<Product> queryByK3ids(@Param("ids") List<String> ids);

    List<Product> queryByAppId(@Param("product") Product product, @Param("startIndex") int startIndex, @Param("pageSize") int pageSize);

    int queryByAppIdCount(@Param("product") Product product);

    List<Product> queryDistint(@Param("categoryId") Integer categoryId);

    /***
     * 条件检索
     * param vo
     * return
     */
    List<Product> queryValueByVo(@Param("vo") ProductSortQueryVo vo, @Param("startIndex") Integer start, @Param("pageSize") Integer size);

    int queryCountByVo(@Param("vo") ProductSortQueryVo vo);

    List<ReplacePictureDto> selectMyPage(ReplacePictureRequest request);

    int selectMyCount(ReplacePictureRequest request);

    Boolean updateMyImg(ReplacePictureDto request);

    List<ProductVO> findByAll(@Param("request")AllProductRequest request);

    int updateSort(int sort);

    List<String> findByFz(int sort);

    List<String> findByJd(int sort);

    List<Product> queryProductVo(@Param("vo") ProductDto vo, @Param("startIndex") Integer start, @Param("pageSize") Integer size);

    List<Product> queryProductAll(@Param("vo") ProductDto vo);

    List<Product> queryScope(@Param("dto") ProductAttrsDto dto);


    List<Product> queryBySearch(@Param("searchValue")String searchValue);
}
