package com.goafanti.common.enums;

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

public enum OrgHumanResourceFields {
	
	UID("uid", "用户id"),
	FIRMTOTAL("firmTotal", "企业职工总数"),
	TECHTOTAL("techTotal", "科技人员总数"),
	FIRMINSERVICE("firmInService", "企业在职员工人数"),
	TECHINSERVICE("techInService", "科技在职员工人数"),
	FIRMPARTTIME("firmPartTime", "企业兼职人数"),
	TECHPARTTIME("techPartTime", "科技人员兼职人数"),
	FIRMTEMPORARY("firmTemporary", "企业临时聘用人数"),
	TECHTEMPORARY("techTemporary", "科技人员临时聘用人数"),
	FIRMFOREIGN("firmForeign", "企业外籍人员数"),
	TECHFOREIGN("techForeign", "外籍科技人员数"),
	FIRMABROAD("firmAbroad", "企业留学归国人员数"),
	TECHABROAD("techAbroad", "留学归国科技人员数"),
	
	FIRMCORE("firmCore", "企业千人计划人数"),
	TECHCORE("techCore", "千人计划科技人员数"),
	
	DOCTOR("doctor", "博士人数"),
	MASTER("master", "硕士人数"),
	UNDERGRADUATE("undergraduate", "本科人数"),
	COLLEGE("college", "大专人数"),
	
	SENIORTITLE("seniorTitle", "高级职称人数"),
	INTERMEDIATETITLE("intermediateTitle", "中级职称人数"),
	JUNIORTITLE("juniorTitle", "初级职称人数"),
	SENIORMECHANIC("seniorMechanic", "高级技工人数"),
	
	BELOWTHIRTY("belowThirty", "三十岁及以下员工人数"),
	THIRTYONETOTHIRTYFOUR("thirtyoneToThirtyfour", "三十一至三十四岁员工人数"),
	FORTYTOFIFTY("fortyoneToFifty", "四十一至五十岁员工人数"),
	ABOVEFIFTY("aboveFifty", "五十岁以上员工人数"),
	
	YEAR("year", "年份"),
	NEWEMPLOYMENT("newEmployment", "新增就业人数"),
	GRADUATENUMBER("graduateNumber", "高校应届毕业生人数"),
	
	ROSTERURL("rosterUrl", "花名册URL"),
	SOCIALSECURITYURL("socialSecurityUrl", "社保情况URL"),
	
	OTHER("", "未知参数");
	
	private String	code;
	private String	desc;
	
	private static Map<String, OrgHumanResourceFields> status = new HashMap<String, OrgHumanResourceFields>();
	
	private OrgHumanResourceFields(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	static {
		for (OrgHumanResourceFields value : OrgHumanResourceFields.values()) {
			status.put(value.getCode(), value);
		}
	}
	
	public static OrgHumanResourceFields getField(String code) {
		if (containsType(code)) {
			return status.get(code);
		}
		return OTHER;
	}
	
	public static String getFieldDesc(String code) {
		return getField(code).getDesc();
	}

	public static boolean containsType(String code) {
		return status.containsKey(code);
	}
	
	public String getCode() {
		return code;
	}

	public String getDesc() {
		return desc;
	}


}
