package com.nokia.hb.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nokia.hb.dao.entity.PerCfgIndicator;
import com.nokia.hb.pojo.bo.IndicatorTemplateItemBo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Set;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author baomidou
 * @since 2023-02-27
 */
@Mapper
public interface PerCfgIndicatorMapper extends BaseMapper<PerCfgIndicator> {
    /**
     * 所有指标
     *
     * @return {@link List}<{@link PerCfgIndicator}>
     */
    @Select("select * from pm_parse.per_cfg_indicator order by sort desc")
    List<PerCfgIndicator> all();

    /**
     * 通过id列表查询indicator_en
     *
     * @param list 列表
     * @return {@link Set}<{@link String}>
     */
    @Select("<script>"
            + " select indicator_en from pm_parse.per_cfg_indicator"
            + " where indicator_id in"
            + " <foreach open=\"(\" close=\")\" collection=\"list\" item=\"item\" separator=\",\">"
            + "   #{item}"
            + " </foreach>"
            + " </script>")
    Set<String> listByIds(@Param("list") Set<Long> list);
}
