package com.fzm.mall.server.admin.goods_center.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.fzm.mall.server.admin.goods_center.entity.vo.GoodsListVO;
import com.fzm.mall.server.admin.goods_center.entity.vo.GoodsSpuVO;
import com.fzm.mall.server.admin.goods_center.model.Spu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author wangp
 * @date 2021/3/15 17:08
 * @description 商品表 Mapper 接口
 * @since JDK 1.8
 */
@Mapper
public interface SpuMapper extends BaseMapper<Spu> {
    IPage<GoodsSpuVO> page(IPage<GoodsSpuVO> page, String merchantId, Integer type, String goodsId, String goodsName, Integer status, Long addTimeHead, Long addTimeTail, Integer goodsType);

    List<GoodsListVO> queryByCategory(List<String> categoryIds, String merchantId, String goods);

    List<GoodsListVO> queryByNameOrId(@Param("merchantId") String merchantId,
                                      @Param("spuStatusOnSale") Integer spuStatusOnSale,
                                      @Param("goods") String goods);

    GoodsSpuVO readByCoin(String coin);

}
