package com.yeejoin.amos.boot.module.tcm.api.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

@AllArgsConstructor
@Getter
public enum EquipmentClassifityEnum {

    /**
    **设备分类
     */
    GL("锅炉","1000"),
    YLRQ("压力容器","2000"),
    DT("电梯","3000"),
    QZJX("起重机械","4000"),
    CC("场（厂）内专用机动车辆","5000"),
    YLSS("大型游乐设施","6000"),
    KYSD("客运索道","9000"),
    YLGD("压力管道","8000"),
    QP("气瓶","2300"),

    //树类型

    //设备认领状态
    SBRLZT("设备认领状态","rlzt"),
    BDLS("八大类树","eightCategory"),
    RENLING("其他","other"),

    CYLINDER("气瓶","cylinder");

    private String name;
    private String code;
    public static Map<String,String> getName=new HashMap<>();
    public static Map<String,String> getCode=new HashMap<>();
    static {
        for (EquipmentClassifityEnum e : EquipmentClassifityEnum.values()){
            getName.put(e.code, e.name);
            getCode.put(e.name, e.code);
        }

    }

    public static EquipmentClassifityEnum getEnumByCode(String code) {
        for (EquipmentClassifityEnum value : EquipmentClassifityEnum.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
