package com.goafanti.common.enums;

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

public enum OrgTechProductFields {
	UID("uid", "用户id"),
	SERIALNUMBER("serialNumber", "编号"),
	PRODUCTNAME("productName", "产品名称"),
	TECHNICALFIELD1("technicalField1", "技术领域1st select"),
	TECHNICALFIELD2("technicalField2", "技术领域2nd select"),
	TECHNICALFIELD3("technicalField3", "技术领域3rd select"),
	TECHNICALSOURCE("technicalSource", "技术来源"),
	LASTYEARREVENUE("lastYearRevenue", "上年度销售收入(万元)"),
	MAINPRODUCT("mainProduct", "是否是主要产品(服务)"),
	INTELLECTUALPROPERTYNUMBER("intellectualPropertyNumber", "知识产权编号"),
	KEYTECHNOLOGY("keyTechnology", "关键技术及主要技术指标"),
	COMPETITIVEEDGE("competitiveEdge", "与同类产品（服务）的竞争优势"),
	CONDITIONEFFECT("conditionEffect", "知识产权获得情况及其对产品（服务）在技术上发挥的支持作用"),
	YEAR("year", "年份"),
	ACCOUNTURL("accountUrl", "台帐URL"),
	
	OTHER("", "未知参数");
	
	private String	code;
	private String	desc;
	
	private static Map<String, OrgTechProductFields> status = new HashMap<String, OrgTechProductFields>();
	
	private OrgTechProductFields(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	static {
		for (OrgTechProductFields value : OrgTechProductFields.values()) {
			status.put(value.getCode(), value);
		}
	}
	
	public static OrgTechProductFields 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;
	}


}
