package com.tofly.gpsboot.common.system;

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

/**
 * 井位情况，关联字典编码表：（完好、轻损、松动、缺失）
 * @author Zev
 */
@Getter
@AllArgsConstructor
public enum WellSituationEnum {
    /**
     *
     */
    NORMAL("535","完好"),
    MINOR_DAMAGE("536","轻损"),
    LOOSE("537","松动"),
    MISSING("538","缺失"),

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

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

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