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

import com.fzm.mall.server.front.goods.model.OprationFloorGoods;
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-04-02
 */
public interface OprationFloorGoodsMapper extends BaseMapper<OprationFloorGoods> {
    @Select("select * from goods_spu a left join opration_floor_goods b on a.goods_id = b.goods_id  where b.operation_floor_id = #{operationFloorId} and a.status = 1 and b.status = 0 order by display_order asc limit ${start},${end}")
    List<SaleHotVo> getList(@Param("operationFloorId") String operationFloorId, @Param("start") int start, @Param("end")int end);
    @Select("select count(*) from goods_spu a left join opration_floor_goods b on a.goods_id = b.goods_id where b.operation_floor_id = #{operationFloorId} and a.status = 1 and b.status = 0")
    Integer getCount(@Param("operationFloorId") String operationFloorId);
}
