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.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * 邀请注册平台的记录
 * 
 * @author hejq
 * @time 创建时间：2017年5月12日
 */
@Entity
@Table(name = InvitationRecordSimpleInfo.TABLE_NAME)
public class InvitationRecordSimpleInfo {

	public static final String TABLE_NAME = "INVITATIONRECORDS";

	/**
	 * 各字段名
	 */
	public static final String ID_FIELD = "in_id";

	public static final String ENUU_FIELD = "in_enuu";

	public static final String USERUU_FIELD = "in_useruu";
	
	public static final String DATE_FIELD = "in_date";
	
	public static final String ACTIVE_FIELD = "in_active";

	public static final String VENDNAME_FIELD = "in_vendname";
	
	public static final String VENDUSERNAME_FIELD = "in_vendusername";

	public static final String VENDUSERTEL_FIELD = "in_vendusertel";

	public static final String VENDUSEREMAIL_FIELD = "in_venduseremail";

	@Id
	@Column(name = ID_FIELD)
	private Long id;

	/**
	 * 邀请企业uu
	 */
	@Column(name = ENUU_FIELD)
	private Long enuu;

	/**
	 * 用户uu
	 */
	@OneToOne
	@JoinColumn(name = USERUU_FIELD, insertable = false, updatable = false)
	private UserSimpleInfo user;

	/**
	 * 最后一次邀请时间
	 */
	@Column(name = DATE_FIELD)
	private Date date;

	/**
	 * 是否已激活
	 */
	@Column(name = ACTIVE_FIELD)
	private Short active;

	/**
	 * 邀请的客户名称
	 */
	@Column(name = VENDNAME_FIELD)
	private String vendname;

	/**
	 * 邀请的用户名称
	 */
	@Column(name = VENDUSERNAME_FIELD)
	private String vendusername;

	/**
	 * 邀请的用户的电话
	 */
	@Column(name = VENDUSERTEL_FIELD)
	private String vendusertel;

	/**
	 * 邀请的用户的邮箱
	 */
	@Column(name = VENDUSEREMAIL_FIELD)
	private String venduseremail;

	public Long getId() {
		return id;
	}

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

	public Long getEnuu() {
		return enuu;
	}

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

	public UserSimpleInfo getUser() {
		return user;
	}

	public void setUser(UserSimpleInfo user) {
		this.user = user;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public Short getActive() {
		return active;
	}

	public void setActive(Short active) {
		this.active = active;
	}

	public String getVendname() {
		return vendname;
	}

	public void setVendname(String vendname) {
		this.vendname = vendname;
	}

	public String getVendusername() {
		return vendusername;
	}

	public void setVendusername(String vendusername) {
		this.vendusername = vendusername;
	}

	public String getVendusertel() {
		return vendusertel;
	}

	public void setVendusertel(String vendusertel) {
		this.vendusertel = vendusertel;
	}

	public String getVenduseremail() {
		return venduseremail;
	}

	public void setVenduseremail(String venduseremail) {
		this.venduseremail = venduseremail;
	}

	@Override
	public String toString() {
		return "InvitationRecordSimpleInfo [id=" + id + ", enuu=" + enuu + ", user=" + user + ", date=" + date
				+ ", active=" + active + ", vendname=" + vendname + ", vendusername=" + vendusername + ", vendusertel="
				+ vendusertel + ", venduseremail=" + venduseremail + "]";
	}

	/**
	 * 获取除了status外的所有字段的列名（field名）
	 * 
	 * @return
	 */
	public static List<String> getKeywordFields() {
		List<String> fields = new ArrayList<>();
		fields.add(VENDNAME_FIELD);
		fields.add(VENDUSERNAME_FIELD);
		fields.add(VENDUSERTEL_FIELD);
		fields.add(VENDUSEREMAIL_FIELD);
		fields.add(USERUU_FIELD);
		return fields;
	}

}
