package com.tofly.analyse.entity.em;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.util.StringUtils;

@Getter
@AllArgsConstructor
public enum LayerTypeEnum {

    DLGD("电力供电", "dlgd"),
    DLLD("电力路灯", "dlld"),
    JSJS("给水", "jsjs"),
    PSHS("排水合流", "pshs"),
    RQTQ("燃气", "rqtq"),
    TXDH("通信电话", "txdh"),
    TXDX("通信中国电信", "txdx"),
    TXGB("通信广播", "txgb"),
    TXKX("通信监控信号", "TXKX"),
    TXXW("通信校园网", "TXXW")
    ;

    String name;

    String code;


    public static String getNameForValue(String code) {
        String path = "";
        if (StringUtils.isEmpty(code)) {
            return path;
        }

        for (LayerTypeEnum e : LayerTypeEnum.values()) {
            if (code.toLowerCase().contains(e.code)) {
                path = e.name;
                break;
            }
        }
        return path;
    }
}
