package thyyxxk.webserver.constants.sidicts;

import thyyxxk.webserver.utils.StringUtil;

/**
 * @description: 公务员等级
 * @author: DingJie
 * @create: 2021/7/129:00
 */
public enum CvlservLv {

    NATIONAL_PRINCIPAL("101", "国家级正职"),

    NATIONAL_DEPUTY("102", "国家级副职"),

    PROVINCIAL_LEVEL_PRINCIPAL("111", "省部级正职"),

    PROVINCIAL_DEPUTY("112", "省部级副职"),

    DEPARTMENT_LEVEL_PRINCIPAL("121", "厅局级正职"),

    DEPARTMENT_DEPUTY("122", "厅局级副职"),

    COUNTY_LEVEL_PRINCIPAL("131", "县处级正职"),

    COUNTY_DEPUTY("132", "县处级副职"),

    TOWNSHIP_SECTION_CHIEF("141", "乡科级正职"),

    TOWNSHIP_SECTION_DEPUTY("142", "乡科级副职"),

    STAFF_LEVEL("150", "科员级"),

    CLERK_LEVEL("160", "办事员级"),

    UNDECIDED_POSITION("199", "未定职");

    private final String code;
    private final String name;

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

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static CvlservLv get(String code) {
        if (StringUtil.isBlank(code)) {
            return null;
        }
        for (CvlservLv cvlservLv : CvlservLv.values()) {
            if (code.trim().equals(cvlservLv.getCode())) {
                return cvlservLv;
            }
        }
        return null;
    }
}
