package com.goafanti.common.enums;

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

public enum OrgProFields {

	IDENTITYTYPE("identityType", "身份类型"),
	COMPANYNAME("companyName", "公司名称"),
	LOCATIONPROVINCE("locationProvince", "所在地--省"),
	LOCATIONCITY("locationCity", "所在地--市"),
	LOCATIONAREA("locationArea", "所在地--区"),
	UNITSIZE("unitSize", "单位规模"),
	COMPANYINTRODUCTION("companyIntroduction", "单位简介"),
	HOMEUNIT("homeUnit", "所属单位"),
	LOGOURL("logoUrl", "logo图URL"),
	PUBLICITYPICTUREURL("publicityPictureUrl", "宣传图片URL"),
	
	QUALIFICATION("qualification", "企业资质"),
	TURNOVER("turnover", "年营业额"),
	COLLEGEATTRIBUTE("collegeAttribute", "院校属性"),
	COLLEGEESTABLISHTIME("collegeEstablishTime", "院校创办时间"),
	ACADEMICIAN("academician", "院士"),
	DOCTORALTUTOR("doctoralTutor", "博士生导师"),
	MASTERTUTOR("masterTutor", "硕士生导师"),
	OTHEREXPERT("otherExpert", "其他专家"),
	NATIONALLAB("nationalLab", "国家重点实验室"),
	EDUCATIONLAB("educationLab", "教育部重点实验室"),
	ENTERPRISECENTER("enterpriseCenter", "所在地--市"),
	OTHERCENTER("otherCenter", "其他研究中心"),
	INSTITUTIONESTABLISHTIME("institutionEstablishTime", "其他研究中心"),
	
	OTHER("", "未知参数");
	
	private String	code;
	private String	desc;
	
	private static Map<String, OrgProFields> status = new HashMap<String, OrgProFields>();
	
	private OrgProFields(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	static {
		for (OrgProFields value : OrgProFields.values()) {
			status.put(value.getCode(), value);
		}
	}
	
	public static OrgProFields 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;
	}
}
