package com.jeeplus.hotelorder.dish.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jeeplus.hotelorder.dish.domain.HotelDish;
import com.jeeplus.hotelorder.order.domain.HotelOrderItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface HotelDishMapper extends BaseMapper<HotelDish> {

    /**
     * 客户端菜品列表(只查在售)
     */
    IPage<HotelDish> selectClientList(Page<HotelDish> page, @Param("categoryId") String categoryId,
                                      @Param("keyword") String keyword);

    /**
     * 管理后台菜品分页
     */
    IPage<HotelDish> selectAdminPage(Page<HotelDish> page, @Param("categoryId") String categoryId,
                                     @Param("status") String status, @Param("name") String name);

    /**
     * 销量排行
     */
    List<HotelDish> selectSalesRanking(@Param("limit") int limit);

    /**
     * 批量更新销量
     */
    int batchUpdateSales(@Param("items") List<HotelOrderItem> items);
}
