package nckd.jxccl.base.common.enums.psms;

import java.util.HashMap;
import java.util.Map;

/**
* 奖项级别
* @author W.Y.C
* @date 2025/10/22 20:35
* @version 1.0
*/
public enum AwardLevelEnum {

    /**国家级*/
    NATIONAL_LEVEL("1", "国家级"),
    /**省部级*/
    PROVINCIAL_LEVEL("2", "省部级"),
    /**公司级*/
    COMPANY_LEVEL("3", "公司级"),
    /**矿级*/
    MINE_LEVEL("4", "厂矿级"),
    /**车间级*/
    WORKSHOP_LEVEL("5", "车间级");


    private static final Map<String, AwardLevelEnum> CODE_MAP = new HashMap<>();
    static {
        for (AwardLevelEnum value : AwardLevelEnum.values()) {
            CODE_MAP.put(value.code, value);
        }
    }

    private final String code;
    private final String name;

    AwardLevelEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    /**
     * 根据编码获取枚举
     * @param code
     * @return: AwardLevelEnum
     * @author W.Y.C
     * @date: 2025/09/12 14:33
     */
    public static AwardLevelEnum getByCode(String code) {
        if (code == null) {
            return null;
        }
        return CODE_MAP.get(code);
    }


    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
