package com.aircraft.modules.system.mapper;

import com.aircraft.modules.system.domain.EmScenic;
import com.aircraft.modules.system.domain.vo.AreaNumStatisVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.lettuce.core.dynamic.annotation.Param;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author cli
 * @since 2025-07-09
 */
@Mapper
public interface EmScenicMapper extends BaseMapper<EmScenic> {

    /**
     * 根据区域下名称获取景区
     * @param areaId
     * @param name
     * @return
     */
    EmScenic findByAreaIdAndName(@Param("areaId") Long areaId, @Param("name") String name);

    /**
     * 景区按区域统计数量
     * @return
     */
    List<AreaNumStatisVo> countByAreaId();

    Map<Long, String> getScenicNameMap(ArrayList<Long> scenicIds);

    @Select("SELECT * FROM em_scenic WHERE id IN (#{ids})")
    List<EmScenic> listByIds(ArrayList<Long> ids);
}
