package com.ruoyi.info.collection.enums;


/**
 * 员工状态枚举
 *
 * @author ruoyi
 */
public enum EmployeeStatus {

    /** 在职 */
    ACTIVE("0", "在职"),

    /** 离职 */
    INACTIVE("1", "离职");

    private final String code;
    private final String desc;

    EmployeeStatus(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    /**
     * 根据编码获取描述
     */
    public static String getDescByCode(String code) {
        for (EmployeeStatus status : values()) {
            if (status.getCode().equals(code)) {
                return status.getDesc();
            }
        }
        return null;
    }
}
