package com.rndchina.aisin.system.modle;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

/**
 * 系统用户
 */
@Entity
@Table(name = "sp_system_user")
public class SystemUser implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String id;
	// private SystemOrg org;
	private Timestamp createTime;
	private Timestamp updateTime;
	private Integer version;
	// 排序
	private String cpaixu;
	// 账号过期
	private Boolean accountexpired = false;
	// 账户锁定
	private Boolean accountlocked = false;
	// 信用过期
	private Boolean credentialsexpired = false;
	private String des;
	// 账户可用 村字典项id
	private String enabled = "1";

	private String password;
	private String realName;
	private String username;

	// new begin
	/**
	 * 用户性别
	 */
	private String userSex;
	/**
	 * 移动电话
	 */
	private String userMobilephone;
	/**
	 * 座机电话
	 */
	private String userLandline;
	/**
	 * 邮箱
	 */
	private String userMail;
	/**
	 * 地址 *
	 */
	private String userAddress;
	/**
	 * 国家
	 */
	private String userCountry;
	/**
	 * 地区
	 */
	private String userArea;
	/**
	 * 爱信号码
	 */
	private String userAisinNum;
	/**
	 * 用户认证
	 */
	private String userAuthentication;
	/**
	 * 用户激活
	 */
	private String userActivation;
	/**
	 * 用户头像
	 */
	private String userIcon;
	/**
	 * 用户昵称
	 */
	private String userNickName;
	/**
	 * 个性签名
	 */
	private String userSignature;
	/**
	 * 二维码
	 */
	private String userTDcode;
	/**
	 * 身份证
	 */
	private String userIdentitycard;
	/**
	 * 认证图片（身份证+自拍）
	 */
	private String userAuthImg;
	/**
	 * 学历
	 */
	private String userEducation;
	/**
	 * 政治面貌
	 */
	private String userPolitical;
	/**
	 * 相册
	 */
	private String userPhotos;
	/**
	 * 职务
	 */
	private String userDuty;
	// new end

	// 逻辑删除
	private String deleted = "0";

	/**
	 * 用户下的角色列表
	 */
	private List<SystemRole> systemRoles = new ArrayList<SystemRole>();

	/** default constructor */
	public SystemUser() {
	}

	public SystemUser(String id, String realName, String username) {
		this.id = id;
		this.realName = realName;
		this.username = username;
	}

	public String getCpaixu() {
		return cpaixu;
	}

	public void setCpaixu(String cpaixu) {
		this.cpaixu = cpaixu;
	}

	@Id
	@Column(name = "id", length = 64)
	// @GeneratedValue(strategy = GenerationType.AUTO)
	public String getId() {
		return this.id;
	}

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

	@Column(name = "createTime", length = 19)
	public Timestamp getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	@Column(name = "updateTime", length = 19)
	public Timestamp getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Timestamp updateTime) {
		this.updateTime = updateTime;
	}

	@Column(name = "version")
	public Integer getVersion() {
		return this.version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	@Column(name = "accountexpired", nullable = false)
	public Boolean getAccountexpired() {
		return this.accountexpired;
	}

	public void setAccountexpired(Boolean accountexpired) {
		this.accountexpired = accountexpired;
	}

	@Column(name = "accountlocked", nullable = false)
	public Boolean getAccountlocked() {
		return this.accountlocked;
	}

	public void setAccountlocked(Boolean accountlocked) {
		this.accountlocked = accountlocked;
	}

	@Column(name = "credentialsexpired", nullable = false)
	public Boolean getCredentialsexpired() {
		return this.credentialsexpired;
	}

	public void setCredentialsexpired(Boolean credentialsexpired) {
		this.credentialsexpired = credentialsexpired;
	}

	@Column(name = "des", length = 100)
	public String getDes() {
		return this.des;
	}

	public void setDes(String des) {
		this.des = des;
	}

	@Column(name = "enabled", nullable = false)
	public String getEnabled() {
		return this.enabled;
	}

	public void setEnabled(String enabled) {
		this.enabled = enabled;
	}

	@Column(name = "password", length = 100)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "realName", length = 100)
	public String getRealName() {
		return this.realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	@Column(name = "username", length = 100)
	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "userrole", joinColumns = { @JoinColumn(name = "userID") }, inverseJoinColumns = { @JoinColumn(name = "roleID") })
	public List<SystemRole> getSystemRoles() {
		return systemRoles;
	}

	public void setSystemRoles(List<SystemRole> systemOrgs) {
		this.systemRoles = systemOrgs;
	}

	public String getDeleted() {
		return deleted;
	}

	public void setDeleted(String deleted) {
		this.deleted = deleted;
	}

	public String getUserSex() {
		return userSex;
	}

	public void setUserSex(String userSex) {
		this.userSex = userSex;
	}

	public String getUserMobilephone() {
		return userMobilephone;
	}

	public void setUserMobilephone(String userMobilephone) {
		this.userMobilephone = userMobilephone;
	}

	public String getUserLandline() {
		return userLandline;
	}

	public void setUserLandline(String userLandline) {
		this.userLandline = userLandline;
	}

	public String getUserMail() {
		return userMail;
	}

	public void setUserMail(String userMail) {
		this.userMail = userMail;
	}

	public String getUserAddress() {
		return userAddress;
	}

	public void setUserAddress(String userAddress) {
		this.userAddress = userAddress;
	}

	public String getUserCountry() {
		return userCountry;
	}

	public void setUserCountry(String userCountry) {
		this.userCountry = userCountry;
	}

	public String getUserArea() {
		return userArea;
	}

	public void setUserArea(String userArea) {
		this.userArea = userArea;
	}

	public String getUserAisinNum() {
		return userAisinNum;
	}

	public void setUserAisinNum(String userAisinNum) {
		this.userAisinNum = userAisinNum;
	}

	public String getUserAuthentication() {
		return userAuthentication;
	}

	public void setUserAuthentication(String userAuthentication) {
		this.userAuthentication = userAuthentication;
	}

	public String getUserActivation() {
		return userActivation;
	}

	public void setUserActivation(String userActivation) {
		this.userActivation = userActivation;
	}

	public String getUserIcon() {
		return userIcon;
	}

	public void setUserIcon(String userIcon) {
		this.userIcon = userIcon;
	}

	public String getUserNickName() {
		return userNickName;
	}

	public void setUserNickName(String userNickName) {
		this.userNickName = userNickName;
	}

	public String getUserSignature() {
		return userSignature;
	}

	public void setUserSignature(String userSignature) {
		this.userSignature = userSignature;
	}

	public String getUserTDcode() {
		return userTDcode;
	}

	public void setUserTDcode(String userTDcode) {
		this.userTDcode = userTDcode;
	}

	public String getUserIdentitycard() {
		return userIdentitycard;
	}

	public void setUserIdentitycard(String userIdentitycard) {
		this.userIdentitycard = userIdentitycard;
	}

	public String getUserAuthImg() {
		return userAuthImg;
	}

	public void setUserAuthImg(String userAuthImg) {
		this.userAuthImg = userAuthImg;
	}

	public String getUserEducation() {
		return userEducation;
	}

	public void setUserEducation(String userEducation) {
		this.userEducation = userEducation;
	}

	public String getUserPolitical() {
		return userPolitical;
	}

	public void setUserPolitical(String userPolitical) {
		this.userPolitical = userPolitical;
	}

	public String getUserPhotos() {
		return userPhotos;
	}

	public void setUserPhotos(String userPhotos) {
		this.userPhotos = userPhotos;
	}

	public String getUserDuty() {
		return userDuty;
	}

	public void setUserDuty(String userDuty) {
		this.userDuty = userDuty;
	}

}