package org.security.common.eum;

/**
 * @author Create by wzf
 * @date 2022/5/23 15:46
 */
public enum EducationEnum {

	/**
	 * 员工学历、岗位类型、政治面貌枚举
	 */
	ONE("specialty","专科"),
	TWO("undergraduate","本科"),
	THREE("master","硕士研究生"),
	FOUR("doctor","博士研究生"),
	FIVE("post-doctoral","博士后"),
	SIX("other","其他"),
	SEVEN("leader","机构负责人"),
	EIGHT("safeLeader","安全部门负责人"),
	NINE("leaderInCharge","分管领导"),
	TEN("safer","安全员"),
	ELEVEN("fireman","义务消防员"),
	UNKNOWN("-1","未知"),
	POLITICS_ONE("01","中共党员"),
	POLITICS_TWO("02","中共预备党员"),
	POLITICS_THREE("03","共青团团员"),
	POLITICS_FOUR("04","民革党员"),
	POLITICS_FIVE("05","民盟盟员"),
	POLITICS_SIX("06","民建会员"),
	POLITICS_SEVEN("07","民进会员"),
	POLITICS_EIGHT("08","农工党党员"),
	POLITICS_NINE("09","致公党党员"),
	POLITICS_TEN("10","九三学社社员"),
	POLITICS_ELEVEN("11","台盟盟员"),
	POLITICS_TWELVE("12","无党派人士"),
	POLITICS_THIRTEEN("13","群众");

	private String  code;

	private String label;

	EducationEnum(String code, String label) {
		this.code = code;
		this.label = label;
	}

	public String getCode() {
		return code;
	}

	public String getLabel() {
		return label;
	}

	/**
	 *
	 * @param code
	 * @return
	 */
	public static EducationEnum parseByCode(String code) {
		EducationEnum[] items = EducationEnum.values();
		for (EducationEnum item : items) {
			if (item.code.equals(code)) {
				return item;
			}
		}
		return UNKNOWN;
	}

	/**
	 *
	 * @param label
	 * @return
	 */
	public static EducationEnum parseByLabel(String label) {
		EducationEnum[] items = EducationEnum.values();
		for (EducationEnum item : items) {
			if (item.label.equalsIgnoreCase(label)) {
				return item;
			}
		}
		return UNKNOWN;
	}
}
