package nckd.jxccl.base.common.enums;

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

/**
* 【人员考评】-考评结果枚举
* @author W.Y.C
* @date 2025/8/13 15:08
* @version 1.0
*/
public enum AppraisalResultEnum {

    /** 优秀 */
    EXCELLENT("01", "优秀"),
    /** 合格 */
    QUALIFIED("02", "合格"),
    /** 基本合格 */
    BASICALLY_QUALIFIED("03", "基本合格"),
    /** 不合格 */
    UN_QUALIFIED("04", "不合格"),
    /** 视同合格 */
    DEEMED_QUALIFIED("05", "视同合格"),
    /** 无 */
    NONE("06", "无"),
    /** 无考核定级 */
    NO_ASSESSMENT_GRADE("07", "无考核定级"),
    /** 良好 */
    GOOD("08", "良好"),
    /** 视同优秀*/
    DEEMED_EXCELLENT("09", "视同优秀"),
    /** 视同不合格*/
    DEEMED_UNQUALIFIED("10", "视同不合格"),
    /** 视同基本合格*/
    DEEMED_BASICALLY_QUALIFIED("11", "视同基本合格");

    private static final Map<String, AppraisalResultEnum> CODE_MAP = new HashMap<>();

    static {
        for (AppraisalResultEnum value : AppraisalResultEnum.values()) {
            CODE_MAP.put(value.code, value);
        }
    }

    private final String code;
    private final String name;

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

    /**
     * 根据编码获取枚举
     * @param code 编码
     * @return: nckd.jxccl.base.common.enums.AppraisalResultEnum
     * @author W.Y.C
     * @date: 2025/09/11 14:39
     */
    public static AppraisalResultEnum getByCode(String code) {
        if (code == null) {
            return null;
        }
        return CODE_MAP.get(code);
    }


    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
