package com.palmnest.model.estateserve;

import com.palmnest.model.lingling.DevicePermGroup;
import com.palmnest.model.lingling.LingLingCard;

import org.codehaus.jackson.annotate.JsonIgnore;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.*;

/**
 * AppUser entity.
 *
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "tb_user")
public class AppUser implements java.io.Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = 7698351439385258925L;

	private Integer id;
	private String  userName;

	private String  loginName;

	private String  nickName;
	private String  userMobile;
	private String  userType;
	private String  userSex;
	private String  userCardNo;
	private Date    birthday;
	private String  userPhotoUrl;
	private String  password;
	private String  status;
	private String  suggestion;            //审核说明
	private String  address;
	private String  imageUrl01;
	private String  imageUrl02;
	private String  imageUrl03;
	private String  creator;
	private Date    createTime;
	private String  modifier;
	private Date    modifyTime;
	private String  isEnabled;
	private Integer organizationId;    //项目ID
	private Integer virtualArchId;        //企业ID
	private String  userNumber;            //员工编号
	private Date    enteringTime;            //入司时间
	private String  positionName;        //职位名称
	private Integer departmentId;        //部门ID
	private Integer facePlusUserId;        //face++唯一标识
	private String  roleType;            //企业用户角色（1-管理员，2-普通用户,3-被代订用户）
	private String  noticePower;            //接受审核通知（0-不接收用户申请通知，关，1-接收用户申请通知，开）
	private String  organizationName;    //部门名称
	private String  departmentName;        //部门名称
	private String  virtualArchName;        //公司名称
	private Integer facePlusImageId;    //face++图片唯一标识
	private String  imageId1;
	private String  imageId2;
	private String  imageId3;
	private String  imageUrl1;
	private String  imageUrl2;
	private String  imageUrl3;
	private Integer     isSyncNeigou; //是否同步内购网
	private Integer     isResponsible;//是否责任人
	private Integer     isPushPower;//是否有账单推送权限
	private Integer     isReleasePower;//是否有物品放行权限
	private Integer     reOrder;//负责人的顺序  0代表不是负责人的 1代表负责人1  2代表负责人2
	private Integer deviceType;//手机登录设备类型
	private String  deviceNo;//手机登录设备号
	private String  remark;
	private Integer integral;//积分
	private String  email;//邮箱
	private String  userCode;//航电对接 用户code
	private Integer wxUserId;//微信用户id
	private Integer isBinding;//白名单是否绑定微信用户
	private Integer isLogin;//白名单用户是否登录

//	private DevicePermGroup group;// 用户所属权限组
//	private LingLingCard    card;// 用户绑定的实体卡
	private String          lingLingId;// 令令对接用户员工唯一标识
	private Integer         isLeader;//是否汇总领导餐(开发测试环境收订餐推送的账号)
	private Long            orderNum;//排序
	private Long            virPermId;
	private String          openId;
	
	private String bindOpenid;
	private String bindDevelopid;

	private String isPushState;

	public String getIsPushState() {
		return isPushState;
	}

	public void setIsPushState(String isPushState) {
		this.isPushState = isPushState;
	}

	@Column(name = "bind_openid")
	public String getBindOpenid() {
		return bindOpenid;
	}

	public void setBindOpenid(String bindOpenid) {
		this.bindOpenid = bindOpenid;
	}
	@Column(name = "bind_developid")
	public String getBindDevelopid() {
		return bindDevelopid;
	}

	public void setBindDevelopid(String bindDevelopid) {
		this.bindDevelopid = bindDevelopid;
	}

	public Integer getIsLogin() {
		return isLogin;
	}

	public void setIsLogin(Integer isLogin) {
		this.isLogin = isLogin;
	}

	public String getUserCode() {
		return userCode;
	}

	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}

	public Integer getReOrder() {
		return reOrder;
	}

	public void setReOrder(Integer reOrder) {
		this.reOrder = reOrder;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Id
//	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return id;
	}

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

	@Column(name = "userName")
	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Column(name = "isSyncNeigou")
	public Integer getIsSyncNeigou() {
		return isSyncNeigou;
	}

	public void setIsSyncNeigou(Integer isSyncNeigou) {
		this.isSyncNeigou = isSyncNeigou;
	}


	@Column(name = "nickName")
	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	@Column(name = "userMobile")
	public String getUserMobile() {
		return userMobile;
	}

	public void setUserMobile(String userMobile) {
		this.userMobile = userMobile;
	}

	@Column(name = "userType")
	public String getUserType() {
		return userType;
	}

	public void setUserType(String userType) {
		this.userType = userType;
	}

	@Column(name = "userCardNo")
	public String getUserCardNo() {
		return userCardNo;
	}

	public void setUserCardNo(String userCardNo) {
		this.userCardNo = userCardNo;
	}

	@Column(name = "birthday")
	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	@Column(name = "userPhotoUrl")
	public String getUserPhotoUrl() {
		return userPhotoUrl;
	}

	public void setUserPhotoUrl(String userPhotoUrl) {
		this.userPhotoUrl = userPhotoUrl;
	}

	@Column(name = "password")
	public String getPassword() {
		return password;
	}

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

	@Column(name = "imageUrl01")
	public String getImageUrl01() {
		return imageUrl01;
	}

	public void setImageUrl01(String imageUrl01) {
		this.imageUrl01 = imageUrl01;
	}

	@Column(name = "imageUrl02")
	public String getImageUrl02() {
		return imageUrl02;
	}

	public void setImageUrl02(String imageUrl02) {
		this.imageUrl02 = imageUrl02;
	}

	@Column(name = "imageUrl03")
	public String getImageUrl03() {
		return imageUrl03;
	}

	public void setImageUrl03(String imageUrl03) {
		this.imageUrl03 = imageUrl03;
	}

	@Column(name = "status")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Column(name = "suggestion")
	public String getSuggestion() {
		return suggestion;
	}

	public void setSuggestion(String suggestion) {
		this.suggestion = suggestion;
	}

	@Column(name = "address")
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Column(name = "creator")
	public String getCreator() {
		return creator;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}

	@Column(name = "createTime")
	public Date getCreateTime() {
		return createTime;
	}

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

	@Column(name = "modifier")
	public String getModifier() {
		return modifier;
	}

	public void setModifier(String modifier) {
		this.modifier = modifier;
	}

	@Column(name = "modifyTime")
	public Date getModifyTime() {
		return modifyTime;
	}

	public void setModifyTime(Date modifyTime) {
		this.modifyTime = modifyTime;
	}

	@Column(name = "isEnabled")
	public String getIsEnabled() {
		return isEnabled;
	}

	public void setIsEnabled(String isEnabled) {
		this.isEnabled = isEnabled;
	}

	@Column(name = "organizationId")
	public Integer getOrganizationId() {
		return organizationId;
	}

	public void setOrganizationId(Integer organizationId) {
		this.organizationId = organizationId;
	}

	@Column(name = "userSex")
	public String getUserSex() {
		return userSex;
	}

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

	@Column(name = "virtualArchId")
	public Integer getVirtualArchId() {
		return virtualArchId;
	}

	public void setVirtualArchId(Integer virtualArchId) {
		this.virtualArchId = virtualArchId;
	}

	@Column(name = "userNumber")
	public String getUserNumber() {
		return userNumber;
	}

	public void setUserNumber(String userNumber) {
		this.userNumber = userNumber;
	}

	@Column(name = "enteringTime")
	public Date getEnteringTime() {
		return enteringTime;
	}

	public void setEnteringTime(Date enteringTime) {
		this.enteringTime = enteringTime;
	}

	@Column(name = "positionName")
	public String getPositionName() {
		return positionName;
	}

	public void setPositionName(String positionName) {
		this.positionName = positionName;
	}

	@Column(name = "departmentId")
	public Integer getDepartmentId() {
		return departmentId;
	}

	public void setDepartmentId(Integer departmentId) {
		this.departmentId = departmentId;
	}

	@Column(name = "facePlusUserId")
	public Integer getFacePlusUserId() {
		return facePlusUserId;
	}

	public void setFacePlusUserId(Integer facePlusUserId) {
		this.facePlusUserId = facePlusUserId;
	}

	@Column(name = "roleType")
	public String getRoleType() {
		return roleType;
	}

	public void setRoleType(String roleType) {
		this.roleType = roleType;
	}

	@Column(name = "noticePower")
	public String getNoticePower() {
		return noticePower;
	}

	public void setNoticePower(String noticePower) {
		this.noticePower = noticePower;
	}


	public Integer getIsResponsible() {
		return isResponsible;
	}

	public void setIsResponsible(Integer isResponsible) {
		this.isResponsible = isResponsible;
	}

	public Integer getIsPushPower() {
		return isPushPower;
	}

	public void setIsPushPower(Integer isPushPower) {
		this.isPushPower = isPushPower;
	}

	public Integer getIsReleasePower() {
		return isReleasePower;
	}

	public void setIsReleasePower(Integer isReleasePower) {
		this.isReleasePower = isReleasePower;
	}

	/*
	 * 以下字段为非持久化字段
	 */
	@Transient
	public String getOrganizationName() {
		return organizationName;
	}

	public void setOrganizationName(String organizationName) {
		this.organizationName = organizationName;
	}

	@Transient
	public String getDepartmentName() {
		return departmentName;
	}

	public void setDepartmentName(String departmentName) {
		this.departmentName = departmentName;
	}

	@Transient
	public String getVirtualArchName() {
		return virtualArchName;
	}

	public void setVirtualArchName(String virtualArchName) {
		this.virtualArchName = virtualArchName;
	}

	@Column(name = "facePlusImageId")
	public Integer getFacePlusImageId() {
		return facePlusImageId;
	}

	public void setFacePlusImageId(Integer facePlusImageId) {
		this.facePlusImageId = facePlusImageId;
	}

	@Transient
	public String getImageId1() {
		return imageId1;
	}

	public void setImageId1(String imageId1) {
		this.imageId1 = imageId1;
	}

	@Transient
	public String getImageId2() {
		return imageId2;
	}

	public void setImageId2(String imageId2) {
		this.imageId2 = imageId2;
	}

	@Transient
	public String getImageId3() {
		return imageId3;
	}

	public void setImageId3(String imageId3) {
		this.imageId3 = imageId3;
	}

	@Transient
	public String getImageUrl1() {
		return imageUrl1;
	}

	public void setImageUrl1(String imageUrl1) {
		this.imageUrl1 = imageUrl1;
	}

	@Transient
	public String getImageUrl2() {
		return imageUrl2;
	}

	public void setImageUrl2(String imageUrl2) {
		this.imageUrl2 = imageUrl2;
	}

	@Transient
	public String getImageUrl3() {
		return imageUrl3;
	}

	public void setImageUrl3(String imageUrl3) {
		this.imageUrl3 = imageUrl3;
	}

	@Column(name = "device_type")
	public Integer getDeviceType() {
		return deviceType;
	}

	public void setDeviceType(Integer deviceType) {
		this.deviceType = deviceType;
	}

	@Column(name = "device_no")
	public String getDeviceNo() {
		return deviceNo;
	}

	public void setDeviceNo(String deviceNo) {
		this.deviceNo = deviceNo;
	}


	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Integer getIntegral() {
		return integral;
	}

	public void setIntegral(Integer integral) {
		this.integral = integral;
	}

	@Column(name = "wxUserId")
	public Integer getWxUserId() {
		return wxUserId;
	}

	public void setWxUserId(Integer wxUserId) {
		this.wxUserId = wxUserId;
	}

	@Column(name = "isBinding")
	public Integer getIsBinding() {
		return isBinding;
	}

	public void setIsBinding(Integer isBinding) {
		this.isBinding = isBinding;
	}
	
//	@Transient
//	//@JsonIgnore
////	@ManyToOne(fetch = FetchType.EAGER)
////	@JoinTable(name = "tr_perm_group_user", joinColumns = {@JoinColumn(name = "user_id")}, inverseJoinColumns = @JoinColumn(name = "device_perm_group_id"))
//	public DevicePermGroup getGroup() {
//		return group;
//	}
//
//	@Transient
//	public void setGroup(DevicePermGroup group) {
//		this.group = group;
//	}
//
//	@JsonIgnore
////	@OneToOne(fetch = FetchType.EAGER)
////	@JoinTable(name = "tr_user_lingling_card", joinColumns = {@JoinColumn(name = "user_id")}, inverseJoinColumns = @JoinColumn(name = "card_id"))
//	public LingLingCard getCard() {
//		return card;
//	}
//
//	public void setCard(LingLingCard card) {
//		this.card = card;
//	}

	public String getLingLingId() {
		return lingLingId;
	}

	public void setLingLingId(String lingLingId) {
		this.lingLingId = lingLingId;
	}

	public Integer getIsLeader() {
		return isLeader;
	}

	public void setIsLeader(Integer isLeader) {
		this.isLeader = isLeader;
	}

	public Long getOrderNum() {
		return orderNum;
	}

	public void setOrderNum(Long orderNum) {
		this.orderNum = orderNum;
	}

	public Long getVirPermId() {
		return virPermId;
	}

	public void setVirPermId(Long virPermId) {
		this.virPermId = virPermId;
	}

	public String getOpenId() {
		return openId;
	}

	public void setOpenId(String openId) {
		this.openId = openId;
	}

	@Column(name = "login_name")
	public String getLoginName() {
		return loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}
}