package com.energy.manage.common.enums;

/**
 * id 前缀枚举
 */
public enum IdPrefixEnum {


    COMPANY_NUMBER("COM", "企业信息编号"),
    WIND_FIELD_NUMBER("WOF", "风场信息编号"),
    WIND_GROUP_NUMBER("WOG", "风机信息编号"),
    WIND_EILL_NUMBER("WEM", "风机机型编号"),
    WIND_EILL_MF_NUMBER("WMF","风机机型厂商编号"),
    WIND_TOWER_NUMBER("WOT", "测风塔信息编号"),
    WIND_ENGINE_BATCH_NUMBER("WOB","风机批次编号"),

    UNIT_DICT_TYPE_CODE("UDTC","部件字典编号"),

    UNIT_BEARINGS_CODE("UTINTB","部件主轴"),
    UNIT_GEAR_CODE("UTINTG","部件齿轮箱"),
    UNIT_DYNAMO_CODE("UTINTD","部件发电机");

    IdPrefixEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    private String code;
    private String name;


    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getKeyByValue(String code) {
        for (IdPrefixEnum e : values()) {
            if (code.equals(e.code)) {
                return e.name;
            }
        }
        return "Not exist";
    }

    public static IdPrefixEnum getFastReplyType(String code) {
        for (IdPrefixEnum e : values()) {
            if (code.equals(e.code)) {
                return e;
            }
        }
        return null;
    }


}
