package com.hnshituo.core.auth.vo;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import org.springframework.web.multipart.MultipartFile;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.hnshituo.basic.vo.BaseVO;
import com.hnshituo.core.auth.mapper.UserMapper;
import com.hnshituo.orm.annotation.Association;
import com.hnshituo.orm.annotation.Collection;
import com.hnshituo.orm.annotation.Column;
import com.hnshituo.orm.annotation.Id;
import com.hnshituo.orm.annotation.Join;
import com.hnshituo.orm.annotation.Table;

@JsonInclude(Include.NON_EMPTY)
@Table(name="CORE_AUTH_USER", namespace=UserMapper.class, cache=true)
public class User extends BaseVO implements Serializable {

	/**
	 * 用户信息表
	 */
	private static final long serialVersionUID = 3050537317325073462L;

	/** 用户编号 */
	@Id
	private String id;
	
	private MultipartFile mFile;
	
	/** 个性签名*/
	@Column
	private String individuality_signature;

	/** 科室编号 */
	@Column
	private String offices_no;
	
	/** 登录名 */
	@Column
	private String login_name;

	/** 密码 */
	@Column
	private String password;

	/** 用户姓名 */
	@Column
	private String username;
	
	/**班次*/
	@Column
	private String wrk_ord;
	
	/**班组*/
	@Column
	private String wrk_grp;
	
	/**当班日期*/
	@Column
//	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
	private String wrk_date;

	/** 组织ID */
	@Column
	private String dept_id;
	
	/** 组织部门名称 */
	@Column
	private String dept_name;

	/** 性别 */
	@Column
	private Integer sex;

	/** 年龄 */
	@Column
	private Integer age;

	/** IP地址 */
	@Column
	private String ip;

	/** 邮箱 */
	@Column
	private String email;

	/** 地址 */
	@Column
	private String address;

	/** 电话 */
	@Column
	private String phone;
	
	/**手机*/
	@Column
	private String telephone;

	/** 照片 base64 */
	@Column
	private byte[] image;
	
	/** 照片 路径*/
	@Column
	private String logo;

	/** 加入公司日期 */
	@Column
	@JsonFormat(pattern = "yyyy-MM-dd")
	private Date join_date;

	/** 生日 */
	@Column
	@JsonFormat(pattern = "yyyy-MM-dd")
	private Date birthday;

	/** 籍贯 */
	@Column
	private String native_place;

	/** 政治面貌 */
	@Column
	private String political;

	/** 职务 */
	@Column
	private String duty;

	/** 职称 */
	@Column
	private String title;

	/** 文化程度 */
	@Column
	private String education;

	/** 专业 */
	@Column
	private String profession;

	/** 毕业院校 */
	@Column
	private String graduate_school;

	/** 是否登录（0-未登录；1-已登录） */
	@Column
	private Integer islogin;

	/** 用户状态（1在职使用 0 离职停用） */
	@Column
	private String valid_flag;

	/** 创建部门 */
	@Column
	private String create_dept_id;

	/** 创建人 */
	@Column
	private String create_man;

	/** 创建时间 */
	@Column
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date create_time;

	/** 修改人 */
	@Column
	private String update_man;

	/** 修改时间 */
	@Column
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date update_time;
	
	/** 移动设备 */
	@Column
	private String device;

	@Column
	private String memo;
	
	@Column		
	private String token;
	
	@Column
	private String qr_code;
	
	@Column
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date login_time;
	
	@Column
	// 0代表禁用 1 代表启用
	private String status;
	

	/**验证码*/
	private String vcode;

	/** 科室名称*/
	@Column
	private String offices_name;
	
	@Association(column="DEPT_ID", foreignColumn="ID")
	private Department department;
	
	@Join(column="id", foreignColumn="USER_ID", table="CORE_AUTH_USER_ROLE",alias="CORE_AUTH_USER_ROLE")
	@Collection(column="ROLE_ID", foreignColumn="ID", javaType=Role.class)
	private List<Role> roles;
  
	private List<User> users;

	public String getId() {
		return id;
	}

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

	public MultipartFile getmFile() {
		return mFile;
	}

	public void setmFile(MultipartFile mFile) {
		this.mFile = mFile;
	}

	public String getIndividuality_signature() {
		return individuality_signature;
	}

	public void setIndividuality_signature(String individuality_signature) {
		this.individuality_signature = individuality_signature;
	}

	public String getOffices_no() {
		return offices_no;
	}

	public void setOffices_no(String offices_no) {
		this.offices_no = offices_no;
	}

	public String getLogin_name() {
		return login_name;
	}

	public void setLogin_name(String login_name) {
		this.login_name = login_name;
	}

	public String getPassword() {
		return password;
	}

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

	public String getUsername() {
		return username;
	}

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

	public String getWrk_ord() {
		return wrk_ord;
	}

	public void setWrk_ord(String wrk_ord) {
		this.wrk_ord = wrk_ord;
	}

	public String getWrk_grp() {
		return wrk_grp;
	}

	public void setWrk_grp(String wrk_grp) {
		this.wrk_grp = wrk_grp;
	}

	public String getDept_id() {
		return dept_id;
	}

	public void setDept_id(String dept_id) {
		this.dept_id = dept_id;
	}

	public String getDept_name() {
		return dept_name;
	}

	public void setDept_name(String dept_name) {
		this.dept_name = dept_name;
	}

	public Integer getSex() {
		return sex;
	}

	public void setSex(Integer sex) {
		this.sex = sex;
	}

	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public String getEmail() {
		return email;
	}

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

	public String getAddress() {
		return address;
	}

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

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	public byte[] getImage() {
		return image;
	}

	public void setImage(byte[] image) {
		this.image = image;
	}

	public String getLogo() {
		return logo;
	}

	public void setLogo(String logo) {
		this.logo = logo;
	}

	public Date getJoin_date() {
		return join_date;
	}

	public void setJoin_date(Date join_date) {
		this.join_date = join_date;
	}

	public Date getBirthday() {
		return birthday;
	}

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

	public String getNative_place() {
		return native_place;
	}

	public void setNative_place(String native_place) {
		this.native_place = native_place;
	}

	public String getPolitical() {
		return political;
	}

	public void setPolitical(String political) {
		this.political = political;
	}

	public String getDuty() {
		return duty;
	}

	public void setDuty(String duty) {
		this.duty = duty;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getEducation() {
		return education;
	}

	public void setEducation(String education) {
		this.education = education;
	}

	public String getProfession() {
		return profession;
	}

	public void setProfession(String profession) {
		this.profession = profession;
	}

	public String getGraduate_school() {
		return graduate_school;
	}

	public void setGraduate_school(String graduate_school) {
		this.graduate_school = graduate_school;
	}

	public Integer getIslogin() {
		return islogin;
	}

	public void setIslogin(Integer islogin) {
		this.islogin = islogin;
	}

	public String getValid_flag() {
		return valid_flag;
	}

	public void setValid_flag(String valid_flag) {
		this.valid_flag = valid_flag;
	}

	public String getCreate_dept_id() {
		return create_dept_id;
	}

	public void setCreate_dept_id(String create_dept_id) {
		this.create_dept_id = create_dept_id;
	}

	public String getCreate_man() {
		return create_man;
	}

	public void setCreate_man(String create_man) {
		this.create_man = create_man;
	}

	public Date getCreate_time() {
		return create_time;
	}

	public void setCreate_time(Date create_time) {
		this.create_time = create_time;
	}

	public String getUpdate_man() {
		return update_man;
	}

	public void setUpdate_man(String update_man) {
		this.update_man = update_man;
	}

	public Date getUpdate_time() {
		return update_time;
	}

	public void setUpdate_time(Date update_time) {
		this.update_time = update_time;
	}

	public String getDevice() {
		return device;
	}

	public void setDevice(String device) {
		this.device = device;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public String getQr_code() {
		return qr_code;
	}

	public void setQr_code(String qr_code) {
		this.qr_code = qr_code;
	}

	public Date getLogin_time() {
		return login_time;
	}

	public void setLogin_time(Date login_time) {
		this.login_time = login_time;
	}

	public String getStatus() {
		return status;
	}

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

	public String getVcode() {
		return vcode;
	}

	public void setVcode(String vcode) {
		this.vcode = vcode;
	}

	public String getOffices_name() {
		return offices_name;
	}

	public void setOffices_name(String offices_name) {
		this.offices_name = offices_name;
	}

	public Department getDepartment() {
		return department;
	}

	public void setDepartment(Department department) {
		this.department = department;
	}

	public List<Role> getRoles() {
		return roles;
	}

	public void setRoles(List<Role> roles) {
		this.roles = roles;
	}

	public List<User> getUsers() {
		return users;
	}

	public void setUsers(List<User> users) {
		this.users = users;
	}

	public String getWrk_date() {
		return wrk_date;
	}

	public void setWrk_date(String wrkDate) {
		wrk_date = wrkDate;
	}

}
