package cn.com.countrygarden.bi.main.model.personnel;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.Date;


/**
 * 人才标签
 *
 * @author 李森林
 * @email www.justintoforest@gamail.com
 * @url www.yuhi.com.cn
 * @date 2018-07-10
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
@Table(name = "personnel_tag")
public class PersonnelTag implements Serializable{
    private static final long serialVersionUID = 1L;
    /**
     * 
     */
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private Integer id;
    /**
     * 关联人员编号
     */
 	@Column(name="user_id")
    private String userId;
 	
 	@Transient
 	private String regionName;
    /**
     * 标签
     */
 	@Column(name="identity")
    private String identity;
    /**
     * 届数
     */
 	@Column(name="graduates")
    private String graduates;
    /**
     * 创建时间
     */
    @JsonFormat(pattern="yyyy/MM/dd HH:mm:ss",timezone = "GMT+8")
    private Date createdDate;
    /**
     * 创建人
     */
 	@Column(name="created_by")
    private String createdBy;
    /**
     * 更新时间
     */
    @JsonFormat(pattern="yyyy/MM/dd HH:mm:ss",timezone = "GMT+8")
    private Date updatedDate;
    /**
     * 更新人
     */
 	@Column(name="updated_by")
    private String updatedBy;

    public PersonnelTag(String userId, String identity, String graduates) {
        this.userId = userId;
        this.identity = identity;
        this.graduates = graduates;
    }

    public PersonnelTag(String userId, String identity, String graduates,String createdBy) {
        this.userId = userId;
        this.identity = identity;
        this.graduates = graduates;
        this.createdBy=createdBy;
        this.createdDate=new Date();
    }

    public PersonnelTag() {
          super();
    }
    public void setId(Integer id) {
          this.id = id;
    }
	
    public Integer getId() {
          return id;
    }
    public void setUserId(String userId) {
          this.userId = userId;
    }
	
    public String getUserId() {
          return userId;
    }
    public void setIdentity(String identity) {
          this.identity = identity;
    }
	
    public String getIdentity() {
          return identity;
    }
    public void setGraduates(String graduates) {
          this.graduates = graduates;
    }
	
    public String getGraduates() {
          return graduates;
    }
    public void setCreatedDate(Date createdDate) {
          this.createdDate = createdDate;
    }
	
    public Date getCreatedDate() {
          return createdDate;
    }
    public void setCreatedBy(String createdBy) {
          this.createdBy = createdBy;
    }
	
    public String getCreatedBy() {
          return createdBy;
    }
    public void setUpdatedDate(Date updatedDate) {
          this.updatedDate = updatedDate;
    }
	
    public Date getUpdatedDate() {
          return updatedDate;
    }
    public void setUpdatedBy(String updatedBy) {
          this.updatedBy = updatedBy;
    }
	
    public String getUpdatedBy() {
          return updatedBy;
    }

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((createdBy == null) ? 0 : createdBy.hashCode());
		result = prime * result + ((createdDate == null) ? 0 : createdDate.hashCode());
		result = prime * result + ((graduates == null) ? 0 : graduates.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((identity == null) ? 0 : identity.hashCode());
		result = prime * result + ((updatedBy == null) ? 0 : updatedBy.hashCode());
		result = prime * result + ((updatedDate == null) ? 0 : updatedDate.hashCode());
		result = prime * result + ((userId == null) ? 0 : userId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		PersonnelTag other = (PersonnelTag) obj;
		if (createdBy == null) {
			if (other.createdBy != null)
				return false;
		} else if (!createdBy.equals(other.createdBy))
			return false;
		if (createdDate == null) {
			if (other.createdDate != null)
				return false;
		} else if (!createdDate.equals(other.createdDate))
			return false;
		if (graduates == null) {
			if (other.graduates != null)
				return false;
		} else if (!graduates.equals(other.graduates))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (identity == null) {
			if (other.identity != null)
				return false;
		} else if (!identity.equals(other.identity))
			return false;
		if (updatedBy == null) {
			if (other.updatedBy != null)
				return false;
		} else if (!updatedBy.equals(other.updatedBy))
			return false;
		if (updatedDate == null) {
			if (other.updatedDate != null)
				return false;
		} else if (!updatedDate.equals(other.updatedDate))
			return false;
		if (userId == null) {
			if (other.userId != null)
				return false;
		} else if (!userId.equals(other.userId))
			return false;
		return true;
	}

	public String getRegionName() {
		return regionName;
	}

	public void setRegionName(String regionName) {
		this.regionName = regionName;
	}
    
    
    
}
