package com.goafanti.common.enums;

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

public enum OrgAnnualReportFields {
	
	UID("uid", "用户id"),
	TOTALTAX("totalTax", "纳税总额(万元)"),
	INCOMETAXRELIEF("incomeTaxRelief", "所得税减免(万元)"),
	TOTALEXPORTVOLUME("totalExportVolume", "出口创汇总额(万元)"),
	BASICRESEARCHCOST("basicResearchCost", "基础研究投入费用"),
	YEAR("year", "年份"),
	STATE("state", "年报状态"),
	
	OTHER("", "未知参数");
	
	private String	code;
	private String	desc;
	
	private static Map<String, OrgAnnualReportFields> status = new HashMap<String, OrgAnnualReportFields>();
	
	private OrgAnnualReportFields(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	static {
		for (OrgAnnualReportFields value : OrgAnnualReportFields.values()) {
			status.put(value.getCode(), value);
		}
	}
	
	public static OrgAnnualReportFields 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;
	}

}
