package cn.cecep.talroad.enums.effective;

/**
 * @author zhangshiji
 * @date 2022/7/26
 */
public enum StandardPollutantEnum {
    PM25(1,"PM₂.₅","µg/m³"),
    PM10(2,"PM₁₀","µg/m³"),
    SO2(3,"SO₂","µg/m³"),
    NO2(4,"NO₂","µg/m³"),
    CO(5,"CO","mg/m³"),
    O38H(6,"O₃-8H","µg/m³"),
    AQI(7,"AQI",""),
    PMI(8,"综合指数",""),
    CO_OVER(9,"CO超标天数","天"),
    O3_OVER(10,"O₃超标天数","天"),
    GOOD_DAYS(11,"优良天数","天"),
    HEAVY_DAYS(12,"重污染天数","天");

    private final Integer id;
    private final String name;
    private final String unit;



    StandardPollutantEnum(Integer id, String name, String unit) {
        this.id = id;
        this.name = name;
        this.unit = unit;
    }

    public static String getNameById(Integer id) {
        StandardPollutantEnum[] carTypeEnums = values();
        for (StandardPollutantEnum enumTest : carTypeEnums) {
            if (enumTest.id.equals(id)) {
                return enumTest.getName();
            }
        }
        return null;
    }

    public static String getUnitById(Integer id) {
        StandardPollutantEnum[] carTypeEnums = values();
        for (StandardPollutantEnum enumTest : carTypeEnums) {
            if (enumTest.id.equals(id)) {
                return enumTest.getUnit();
            }
        }
        return null;
    }

    public Integer getPkId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getUnit() {
        return unit;
    }


}
