package com.fzm.mall.server.front.goods.mapper;

import com.fzm.mall.server.front.goods.model.SaleHot;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fzm.mall.server.front.goods.model.vo.SaleHotVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 爆款推荐 Mapper 接口
 * </p>
 *
 * @author fzm
 * @since 2021-03-02
 */
public interface SaleHotMapper extends BaseMapper<SaleHot> {
    @Select("select * from goods_sale_hot a left join goods_spu b on  a.goods_id = b.goods_id where a.status = 1 and  b.status = 1 order by a.type limit ${start},${end};")
    List<SaleHotVo> getList(@Param("start")int start,@Param("end") int end);
    @Select("select count(*) from goods_sale_hot a left join goods_spu b on  a.goods_id = b.goods_id where a.status = 1 and  b.status = 1")
    int getCount();
}
