package com.hfkj.sysenum.gas;

import lombok.Getter;

import java.util.Objects;

/**
 * 油号
 * @className: GasOilNoEnum
 * @author: HuRui
 * @date: 2024/6/19
 **/
@Getter
public enum GasOilNoEnum {
    /**
     * 92号
     */
    OIL_NO_92(92, "92#", 1, "汽油"),
    /**
     * 95号
     */
    OIL_NO_95(95, "95#", 1, "汽油"),
    /**
     * 98号
     */
    OIL_NO_98(98, "98#", 1, "汽油"),
    /**
     * 0号
     */
    OIL_NO_0(0, "0#", 2, "柴油"),
    ;

    private Integer code;
    private String name;
    private Integer type;
    private String typeName;


    GasOilNoEnum(Integer code, String name, Integer type, String typeName) {
        this.code = code;
        this.name = name;
        this.type = type;
        this.typeName = typeName;
    }

    public static GasOilNoEnum getNameByType(Integer code) {
        for (GasOilNoEnum ele : values()) {
            if (Objects.equals(code, ele.getCode())) {
                return ele;
            }
        }
        return null;
    }

}
