package jnpf.enums.attendance;

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

/**
 * @Author huanglinpan
 * @Date 2024/6/26 15:23
 * @Version 1.0 （版本号）
 */
public enum LeaveTypeEnum {

    //类型编码 0 ：其他 1：事假 2：病假 3：工伤假 4：年假 5：婚假 6：产假 7：陪产假 8：丧假 9：探亲假 10：小儿照护假
    OTHER(0,"其他"),
    SICK_LEAVE(1,"事假"),
    MEDICAL_LEAVE(2,"病假"),
    WORK_INJURY_LEAVE(3,"工伤假"),
    ANNUAL_LEAVE(4,"年假"),
    WEDDING_LEAVE(5,"婚假"),
    MATERNITY_LEAVE(6,"产假"),
    PATERNITY_LEAVE(7,"陪产假"),
    FUNERAL_LEAVE(8,"丧假"),
    FAMILY_VISIT_LEAVE(9,"探亲假"),
    CHILD_CARE_LEAVE(10,    "小儿照护假");


    Map<String, String> map = new HashMap<>();

    public static String getByCode(Integer code) {
        LeaveTypeEnum[] values = values();
        for (LeaveTypeEnum value : values) {
            if (code.equals(value.code)) {
                return value.msg;
            }
        }
        return null;
    }

    Integer code;
    String msg;

    LeaveTypeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

}
