package com.tofly.gpsboot.common.system;

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

/**
 * 井室情况，关联字典编码表：（正常、积水、垮塌、积土）
 * @author Zev
 */
@Getter
@AllArgsConstructor
public enum WellChamberSituationEnum {
    /**
     *
     */
    NORMAL("525","正常"),
    HYDROPS("526","积水"),
    COLLAPSE("527","垮塌"),
    SOIL("528","积土"),

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

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

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