package com.uas.search.console.b2b.model;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * 用于搜索的企业信息
 *
 */
@Entity
@Table(name = EnterpriseSearchSimpleInfo.TABLE_NAME)
public class EnterpriseSearchSimpleInfo {

	/**
	 * 表名
	 */
	public static final String TABLE_NAME = "SEC$ENTERPRISES";

	/**
	 * 各字段名
	 */
	public static final String ID_FIELD = "en_uu";// ID不存在会报异常

	public static final String NAME_FIELD = "en_name";

	public static final String SHORTNAME_FIELD = "en_shortname";

	public static final String TEL_FIELD = "en_tel";

	public static final String FAX_FIELD = "en_fax";

	public static final String ADDRESS_FIELD = "en_address";

	public static final String TYPE_FIELD = "en_type";

	public static final String AREA_FIELD = "en_area";

	public static final String STATUS_FIELD = "en_status";

	public static final String SENDSTATUS_FIELD = "en_sendstatus";

	public static final String DELIVERYADDR_FIELD = "en_deliveraddr";

	public static final String EMAIL_FIELD = "en_email";

	public static final String CORPORATION_FIELD = "en_corporation";

	public static final String BUSSINESSCODE_FIELD = "en_businesscode";

	public static final String TAXCODE_FIELD = "en_taxcode";

	public static final String REGISTERCAPITAL_FIELD = "en_registercapital";

	public static final String URL_FIELD = "en_url";

	public static final String DATE_FIELD = "en_time";

	public static final String ADMINUU_FIELD = "en_adminuu";

	public static final String INDUSTRY_FIELD = "en_industry";

	public static final String SAASURL_FIELD = "en_saasurl";

	public static final String SAASSTATUS_FIELD = "en_saasstatus";

	public static final String SAASSENDSTATUS_FIELD = "en_saassendstatus";

	public static final String ISERP_FIELD = "en_iserp";



	/**
	 * 企业uu，唯一标识
	 */
	@Id
	@Column(name = ID_FIELD)
	private Long id;

	/**
	 * 公司名称
	 */
	@Column(name = NAME_FIELD)
	private String enName;

	/**
	 * 简称
	 */
	@Column(name = SHORTNAME_FIELD)
	private String enShortname;

	/**
	 * 公司类型
	 */
	@Column(name = TYPE_FIELD)
	private String enType;

	/**
	 * 企业注册地区
	 */
	@Column(name = AREA_FIELD)
	private String enArea;

	/**
	 * 状态
	 */
	@Column(name = STATUS_FIELD)
	private Short enStatus;

	/**
	 * 传输到管理平台的状态
	 */
	@Column(name = SENDSTATUS_FIELD)
	private Short enSendStatus;

	/**
	 * 注册地址
	 */
	@Column(name = ADDRESS_FIELD)
	private String enAddress;

	/**
	 * 默认送货地址
	 */
	@Column(name = DELIVERYADDR_FIELD)
	private String enDeliverAddr;

	/**
	 * 公司电话
	 */
	@Column(name = TEL_FIELD)
	private String enTel;

	/**
	 * 传真
	 */
	@Column(name = FAX_FIELD)
	private String enFax;

	/**
	 * 公司邮箱
	 */
	@Column(name = EMAIL_FIELD)
	private String enEmail;

	/**
	 * 公司法人
	 */
	@Column(name = CORPORATION_FIELD)
	private String enCorporation;

	/**
	 * 商业登记证号
	 */
	@Column(name = BUSSINESSCODE_FIELD)
	private String enBussinessCode;

	/**
	 * 纳税人识别号
	 */
	@Column(name = TAXCODE_FIELD)
	private String enTaxcode;

	/**
	 * 注册资本
	 */
	@Column(name = REGISTERCAPITAL_FIELD)
	private String enRegistercapital;

	/**
	 * 公司主页地址
	 */
	@Column(name = URL_FIELD)
	private String enUrl;

	/**
	 * 注册时间
	 */
	@Column(name = DATE_FIELD)
	private Date enDate;

	/**
	 * 管理员UU号
	 */
	@Column(name = ADMINUU_FIELD)
	private Long enAdminuu;

	/**
	 * 所属行业
	 */
	@Column(name = INDUSTRY_FIELD)
	private String enIndustry;

	/**
	 * 优企云服域名
	 */
	@Column(name = SAASURL_FIELD)
	private String enSaasUrl;

	/**
	 * 优企云服状态
	 */
	@Column(name = SAASSTATUS_FIELD)
	private Short enSaasStatus;

	/**
	 * 优企云服传输状态
	 */
	@Column(name = SAASSENDSTATUS_FIELD)
	private Short enSaasSendStatus;

	/**
	 * enIsErp
	 */
	@Column(name = ISERP_FIELD)
	private Short enIsErp;

	public Long getEnuu() {
		return id;
	}

	public void setEnuu(Long enuu) {
		this.id = enuu;
	}

	public String getEnName() {
		return enName;
	}

	public void setEnName(String enName) {
		this.enName = enName;
	}

	public String getEnShortname() {
		return enShortname;
	}

	public void setEnShortname(String enShortname) {
		this.enShortname = enShortname;
	}

	public String getEnType() {
		return enType;
	}

	public void setEnType(String enType) {
		this.enType = enType;
	}

	public String getEnArea() {
		return enArea;
	}

	public void setEnArea(String enArea) {
		this.enArea = enArea;
	}

	public Short getEnStatus() {
		return enStatus;
	}

	public void setEnStatus(Short enStatus) {
		this.enStatus = enStatus;
	}

	public Short getEnSendStatus() {
		return enSendStatus;
	}

	public void setEnSendStatus(Short enSendStatus) {
		this.enSendStatus = enSendStatus;
	}

	public String getEnAddress() {
		return enAddress;
	}

	public void setEnAddress(String enAddress) {
		this.enAddress = enAddress;
	}

	public String getEnDeliverAddr() {
		return enDeliverAddr;
	}

	public void setEnDeliverAddr(String enDeliverAddr) {
		this.enDeliverAddr = enDeliverAddr;
	}

	public String getEnTel() {
		return enTel;
	}

	public void setEnTel(String enTel) {
		this.enTel = enTel;
	}

	public String getEnFax() {
		return enFax;
	}

	public void setEnFax(String enFax) {
		this.enFax = enFax;
	}

	public String getEnEmail() {
		return enEmail;
	}

	public void setEnEmail(String enEmail) {
		this.enEmail = enEmail;
	}

	public String getEnCorporation() {
		return enCorporation;
	}

	public void setEnCorporation(String enCorporation) {
		this.enCorporation = enCorporation;
	}

	public String getEnBussinessCode() {
		return enBussinessCode;
	}

	public void setEnBussinessCode(String enBussinessCode) {
		this.enBussinessCode = enBussinessCode;
	}

	public String getEnTaxcode() {
		return enTaxcode;
	}

	public void setEnTaxcode(String enTaxcode) {
		this.enTaxcode = enTaxcode;
	}

	public String getEnRegistercapital() {
		return enRegistercapital;
	}

	public void setEnRegistercapital(String enRegistercapital) {
		this.enRegistercapital = enRegistercapital;
	}

	public String getEnUrl() {
		return enUrl;
	}

	public void setEnUrl(String enUrl) {
		this.enUrl = enUrl;
	}

	public Date getEnDate() {
		return enDate;
	}

	public void setEnDate(Date enDate) {
		this.enDate = enDate;
	}

	public Long getEnAdminuu() {
		return enAdminuu;
	}

	public void setEnAdminuu(Long enAdminuu) {
		this.enAdminuu = enAdminuu;
	}

	public String getEnIndustry() {
		return enIndustry;
	}

	public void setEnIndustry(String enIndustry) {
		this.enIndustry = enIndustry;
	}

	public String getEnSaasUrl() {
		return enSaasUrl;
	}

	public void setEnSaasUrl(String enSaasUrl) {
		this.enSaasUrl = enSaasUrl;
	}

	public Short getEnSaasStatus() {
		return enSaasStatus;
	}

	public void setEnSaasStatus(Short enSaasStatus) {
		this.enSaasStatus = enSaasStatus;
	}

	public Short getEnSaasSendStatus() {
		return enSaasSendStatus;
	}

	public void setEnSaasSendStatus(Short enSaasSendStatus) {
		this.enSaasSendStatus = enSaasSendStatus;
	}

	public Short getEnIsErp() {
		return enIsErp;
	}

	public void setEnIsErp(Short enIsErp) {
		this.enIsErp = enIsErp;
	}

	/**
	 * 获取所有可以搜索的字段列名（索引的field名）
	 * 
	 * @return 可以搜索的字段列名
	 */
	public static List<String> getKeywordFields() {
		List<String> fields = new ArrayList<>();
		fields.add(ID_FIELD);
		fields.add(NAME_FIELD);
		fields.add(SHORTNAME_FIELD);
		fields.add(ADDRESS_FIELD);
		fields.add(BUSSINESSCODE_FIELD);
		fields.add(CORPORATION_FIELD);
		fields.add(DELIVERYADDR_FIELD);
		fields.add(EMAIL_FIELD);
		fields.add(FAX_FIELD);
		fields.add(TEL_FIELD);
		fields.add(SAASURL_FIELD);
		fields.add(TAXCODE_FIELD);
		fields.add(URL_FIELD);
		return fields;
	}

	@Override
	public String toString() {
		return "EnterpriseSearchSimpleInfo [enuu=" + id + ", enName=" + enName + ", enShortname=" + enShortname
				+ ", enType=" + enType + ", enArea=" + enArea + ", enStatus=" + enStatus + ", enSendStatus="
				+ enSendStatus + ", enAddress=" + enAddress + ", enDeliverAddr=" + enDeliverAddr + ", enTel=" + enTel
				+ ", enFax=" + enFax + ", enEmail=" + enEmail + ", enCorporation=" + enCorporation
				+ ", enBussinessCode=" + enBussinessCode + ", enTaxcode=" + enTaxcode + ", enRegistercapital="
				+ enRegistercapital + ", enUrl=" + enUrl + ", enDate=" + enDate + ", enAdminuu=" + enAdminuu
				+ ", enIndustry=" + enIndustry + ", enSaasUrl=" + enSaasUrl + ", enSaasStatus=" + enSaasStatus
				+ ", enSaasSendStatus=" + enSaasSendStatus + ", enIsErp=" + enIsErp + "]";
	}

}
