package com.ssj.bean.weixin.sales.domain;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.ssj.bean.weixin.user.domain.User;
import com.ssj.bean.common.framework.core.domain.BaseEntity;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

/** 
 * @author  ZhangCaibao 
 * @version 2017年4月24日 上午10:53:46 
 * 类说明  人员配置
 */
@Entity
@Table(name = "tb_lib_staffing")
public class LibStaffing extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8413971660895675964L;
	/**
	 * 人员类型  1 CD  2 CC 3 CDA 4 ZB
	 */
	private String  type;
	/**
	 * 人员
	 */
	private String userId;
	/**
	 * SSJ总部销售人员，其他代表各个图书馆
	 */
	private String libId;
	/**
	 * 组织架构CODE
	 */
	private String orgCode;
	private Date createTime;//生成时间
	/**
	 * 销售名字
	 */
	private String name;
	/**
	 * 联系电话
	 */
	private String telephone;
	/**
	 *  1男 2女
	 */
	private Integer sex;
	/**
	 * 1有效，2失效
	 */
	private Integer stat;

	
	private User user = new User();
	 
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	public String getLibId() {
		return libId;
	}
	public void setLibId(String libId) {
		this.libId = libId;
	}
	@Column(updatable =false)
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	@OneToOne(cascade = { CascadeType.PERSIST}, fetch=FetchType.EAGER)
	@JoinColumn(name="userId",updatable =false,insertable =false)
	@Fetch(FetchMode.SELECT)
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public String getOrgCode() {
		return orgCode;
	}
	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getTelephone() {
		return telephone;
	}
	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}
	public Integer getSex() {
		return sex;
	}
	public void setSex(Integer sex) {
		this.sex = sex;
	}
	public Integer getStat() {
		return stat;
	}
	public void setStat(Integer stat) {
		this.stat = stat;
	}
}
