package com.tofly.gpsboot.common.system;

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

/**
 * 设施类别，关联字典编码表：（闸阀 、蝶阀、消火栓 、防盗阀、排气阀、泄水阀、止回阀 、其它）
 * @author Zev
 */
@Getter
@AllArgsConstructor
public enum FacilityCategoryEnum {
    /**
     *
     */
    ZF("511","闸阀"),
    DF("512","蝶阀"),
    XHS("513","消火栓"),
    FDF("514","防盗阀"),
    PQF("515","排气阀"),
    XSF("516","泄水阀"),
    ZHF("517","止回阀"),
    OTHER("518","其它"),

    ;
    /**
     * 编码
     */
    private String code;
    /**
     * 内容
     */
    private String value;

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

        for (FacilityCategoryEnum e : FacilityCategoryEnum.values()) {
            if (e.code.equalsIgnoreCase(code)) {
                path = e.value;
                break;
            }
        }
        return path;
    }
}
