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

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

/**
* 【内部人力资源市场】-人员类别
* @author W.Y.C
* @date 2025/7/14 14:25
* @version 1.0
*/
public enum TalentTypeEnum {

    /*优秀员工	A
    富余员工	B
    绩效末等员工	C*/
    /*优秀员工*/
    EXCELLENT_EMPLOYEE("A", "优秀员工"),
    /*富余员工*/
    RICH_EMPLOYEE("B", "富余员工"),
    /*绩效末等员工*/
    PERFORMANCE_LAST_EMPLOYEE("C", "绩效末等员工");
    private final String code;
    private final String name;

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

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

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

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

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
