package com.bonus.core.allocation.canteen.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bonus.core.allocation.canteen.model.AllocCanteen;
import com.bonus.core.allocation.canteen.vo.AllocCanteenStallVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AllocCanteenMapper extends BaseMapper<AllocCanteen> {
    List<Long> getCanteenIdListByAreaIdList(@Param("areaIdList") List<Long> areaIdList);

    @Select({"SELECT canteen_id, canteen_name FROM alloc_canteen WHERE if_del = #{ifDel} AND canteen_type = #{canteenType}"})
    List<AllocCanteenStallVO> listAllCanteenStall(@Param("ifDel") Integer ifDel, @Param("canteenType") Integer canteenType);

    @Select({"SELECT area_id FROM alloc_canteen WHERE canteen_id = #{canteenId}"})
    Long getAreaId(Long canteenId);
}
