package com.persagy.dmp.basic.model;

import lombok.Getter;

/***
 * Description: 码表类型
 * @author : lijie
 * @date :2021/8/31 10:17
 * Update By lijie 2021/8/31 10:17
 */
@Getter
public enum CodeTableTypeEnum {

    /**省市信息-geography*/
    GEOGRAPHY("geography", "省市信息"),
    /**设备类型-equipment_all*/
    EQUIPMENT_ALL("equipment_all", "设备类型"),
    /**种族类型-equipment_family*/
    EQUIPMENT_FAMILY("equipment_family", "种族类型"),
    /**气候区-climate*/
    CLIMATE("climate", "气候区"),
    /**发展水平-develop*/
    DEVELOP("develop", "发展水平"),
    /**天气状态-weather*/
    WEATHER("weather", "天气状态"),
    /**空气风力等级-wind*/
    WIND("wind", "空气风力等级"),
    /**方位信息-direction*/
    DIRECTION("direction", "方位信息"),
    /**建筑功能类型-building*/
    BUILDING("building", "建筑功能类型"),
    /**空间功能类型-space*/
    SPACE("space", "空间功能类型"),
    /**租赁业态-rental*/
    RENTAL("rental", "租赁业态"),
    /**防尘等级-dustproof*/
    DUSTPROOF("dustproof", "防尘等级"),
    /**防水等级-waterproof*/
    WATERPROOF("waterproof", "防水等级"),
    /**防爆设备类型-explosionproof_equipment*/
    EXPLOSIONPROOF_EQUIPMENT("explosionproof_equipment", "防爆设备类型"),
    /**防爆类型-explosionproof_type*/
    EXPLOSIONPROOF_TYPE("explosionproof_type", "防爆类型"),
    /**危险区域等级-danger*/
    DANGER("danger", "危险区域等级"),
    /**气体类型和温度类型-gas_temperature*/
    GAS_TEMPERATURE("gas_temperature", "气体类型和温度类型"),
    /**污染等级-pollution_level*/
    POLLUTION_LEVEL("pollution_level", "污染等级"),
    /**污秽等级-contamination_level*/
    CONTAMINATION_LEVEL("contamination_level", "污秽等级"),
    /**标准分项-standard_energy_item*/
    STANDARD_ENERGY_ITEM("standard_energy_item", "标准分项"),
    /**抗震设防烈度-seismic_precautionary_intensity*/
    SEISMIC_PRECAUTIONARY_INTENSITY("seismic_precautionary_intensity", "抗震设防烈度"),
    /**虚拟对象类型-virtual_object*/
    VIRTUAL_OBJECT("virtual_object", "虚拟对象类型"),
    /**日历标签-calendar_tag*/
    CALENDAR_TAG("calendar_tag", "日历标签"),
    /**日历时间段-calendar_interval*/
    CALENDAR_INTERVAL("calendar_interval", "日历时间段"),
    /**耗材编码-consumable_all*/
    CONSUMABLE_ALL("consumable_all", "耗材编码"),
    /**工具编码-tool_all*/
    TOOL_ALL("tool_all", "工具编码");

    private String index;
    private String name;

    CodeTableTypeEnum(String index, String name) {
        this.index = index;
        this.name = name;
    }

    /**
     * 通过Index查找
     * @param index
     * @return
     */
    public static CodeTableTypeEnum findByIndex(String index) {
        CodeTableTypeEnum[] values = CodeTableTypeEnum.values();
        for(CodeTableTypeEnum value:values) {
            if(value.getIndex().equalsIgnoreCase(index)) {
                return value;
            }
        }
        return null;
    }
}
