/*
 * 该类为数据库表实体类
 */
package com.blueland.bpm.identity.model;

import com.blueland.bpm.common.base.BaseEntity;
import com.blueland.bpm.common.util.DateConvertUtils;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import javax.persistence.Id;
import java.util.Date;

/**
 * @author lw
 * @version 1.0
 * @since  
 */


public class User extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	//date formats
	public static final String FORMAT_USER_CREATE_TIME = DATE_FORMAT;
	//date formats
	public static final String FORMAT_USER_UPDATE_TIME = DATE_FORMAT;
	//columns START
    /**
     * 用户ID       数据字段: USER_ID 
     */ 	
	private String userId;
    /**
     * 用户编码       数据字段: USER_CODE 
     */ 	
	private String userCode;
    /**
     * 用户姓名       数据字段: USER_NAME 
     */ 	
	private String userName;
    /**
     * 用户性别       数据字段: USER_SEX 
     */ 	
	private String userSex;
    /**
     * 用户年龄       数据字段: USER_AGE 
     */ 	
	private Integer userAge;
	 /**
     * 直属单位编码       数据字段: COMPANY_ID 
     */ 	
	private String deptId;
	 /**
     * 直属单位编码       数据字段: COMPANY_ID 
     */ 	
	private String deptName;
    /**
     * 直属单位编码       数据字段: COMPANY_ID 
     */ 	
	private String companyId;
	 /**
     * 直属单位编码       数据字段: COMPANY_ID 
     */ 	
	private String companyName;
    /**
     * 所属单位编码       数据字段: ORG_ID 
     */ 	
	private String orgId;
	
	 /**
     * 所属单位名称       数据字段: ORG_NAME
     */ 	
	private String orgName;
    /**
     * 手机号码       数据字段: USER_MOBILE 
     */ 	
	private String userMobile;
	  /**
     * 用户邮箱       db_column: USER_MAIL 
     */	
	private String userMail;
    /**
     * 办公地址       数据字段: USER_WORK_ADDRESS 
     */ 	
	private String userWorkAddress;
    /**
     * 办公电话       数据字段: USER_WORK_PHONE 
     */ 	
	private String userWorkPhone;
    /**
     * 家庭地址       数据字段: USER_HOME_ADDREE 
     */ 	
	private String userHomeAddree;
    /**
     * 家庭电话       数据字段: USER_HOME_PHONE 
     */ 	
	private String userHomePhone;
    /**
     * 主要岗位       数据字段: POSITION_ID 
     */ 	
	private String positionId;
    /**
     * 兼职岗位       数据字段: PLURALITY_POSITION_ID 
     */ 	
	private String pluralityPositionId;
    /**
     * 主要职务       数据字段: TITLE_ID 
     */ 	
	private String titleId;
    /**
     * 兼职职务       数据字段: PLURALITY_TITLE_ID 
     */ 	
	private String pluralityTitleId;
    /**
     * 用户类别，(正式人员:ZS、试用人员:SY、离职人员:LZ、临时人员:LS、外部人员、WB)       数据字段: USER_TYPE 
     */ 	
	private String userType;
	
	private Integer userSort;
    /**
     * 用户状态（启用:QY、未启用:WQY）       数据字段: USER_STATUS 
     */ 	
	private String userStatus;
    /**
     * 用户密码       数据字段: USER_PWD 
     */ 	
	private String userPwd;
    /**
     * 创建时间       数据字段: USER_CREATE_TIME 
     */ 	
	private Date userCreateTime;
    /**
     * 更新时间       数据字段: USER_UPDATE_TIME 
     */ 	
	private Date userUpdateTime;
    /**
     * 创建人       数据字段: USER_CREATOR 
     */ 	
	private String userCreator;
    /**
     * 备注       数据字段: REMARK 
     */ 	
	private String remark;

	private com.blueland.bpm.identity.model.Org org;
	
	private String orgFullPath;
	public User(){
	}

	public User(
		String userId
	){
		this.userId = userId;
	}

	@Id
	public String getUserId() {
		return this.userId;
	}
	
	public void setUserId(String value) {
		this.userId = value;
	}
	
	public String getUserCode() {
		return this.userCode;
	}
	
	public void setUserCode(String value) {
		this.userCode = value;
	}
	
	public String getUserName() {
		return this.userName;
	}
	
	public void setUserName(String value) {
		this.userName = value;
	}
	
	public String getUserSex() {
		return this.userSex;
	}
	
	public void setUserSex(String value) {
		this.userSex = value;
	}
	
	public Integer getUserAge() {
		return this.userAge;
	}
	
	public void setUserAge(Integer value) {
		this.userAge = value;
	}
	
	public String getCompanyId() {
		return this.companyId;
	}
	
	public void setCompanyId(String value) {
		this.companyId = value;
	}
	
	public String getOrgId() {
		return this.orgId;
	}
	
	public void setOrgId(String value) {
		this.orgId = value;
	}
	
	public String getUserMobile() {
		return this.userMobile;
	}
	
	public void setUserMobile(String value) {
		this.userMobile = value;
	}
	
	public String getUserWorkAddress() {
		return this.userWorkAddress;
	}
	
	public void setUserWorkAddress(String value) {
		this.userWorkAddress = value;
	}
	
	public String getUserWorkPhone() {
		return this.userWorkPhone;
	}
	
	public void setUserWorkPhone(String value) {
		this.userWorkPhone = value;
	}
	
	public Integer getUserSort() {
		return userSort;
	}

	public void setUserSort(Integer userSort) {
		this.userSort = userSort;
	}

	public String getUserHomeAddree() {
		return this.userHomeAddree;
	}
	
	public void setUserHomeAddree(String value) {
		this.userHomeAddree = value;
	}
	
	public String getUserHomePhone() {
		return this.userHomePhone;
	}
	
	public void setUserHomePhone(String value) {
		this.userHomePhone = value;
	}
	
	public String getPositionId() {
		return this.positionId;
	}
	
	public void setPositionId(String value) {
		this.positionId = value;
	}
	
	public String getPluralityPositionId() {
		return this.pluralityPositionId;
	}
	
	public void setPluralityPositionId(String value) {
		this.pluralityPositionId = value;
	}
	
	public String getTitleId() {
		return this.titleId;
	}
	
	public void setTitleId(String value) {
		this.titleId = value;
	}
	
	public String getPluralityTitleId() {
		return this.pluralityTitleId;
	}
	
	public void setPluralityTitleId(String value) {
		this.pluralityTitleId = value;
	}
	
	public String getUserType() {
		return this.userType;
	}
	
	public void setUserType(String value) {
		this.userType = value;
	}
	
	public String getUserStatus() {
		return this.userStatus;
	}
	
	public void setUserStatus(String value) {
		this.userStatus = value;
	}
	
	public String getUserPwd() {
		return this.userPwd;
	}
	
	public void setUserPwd(String value) {
		this.userPwd = value;
	}
	
	
	public String getUserCreateTimeString() {
		return DateConvertUtils.format(getUserCreateTime(), FORMAT_USER_CREATE_TIME);
	}
	public void setUserCreateTimeString(String value) {
		setUserCreateTime(DateConvertUtils.parse(value, FORMAT_USER_CREATE_TIME,Date.class));
	}
	
	public Date getUserCreateTime() {
		return this.userCreateTime;
	}
	
	public void setUserCreateTime(Date value) {
		this.userCreateTime = value;
	}
	
	
	public String getOrgFullPath() {
		return orgFullPath;
	}

	public void setOrgFullPath(String orgFullPath) {
		this.orgFullPath = orgFullPath;
	}

	public String getUserUpdateTimeString() {
		return DateConvertUtils.format(getUserUpdateTime(), FORMAT_USER_UPDATE_TIME);
	}
	public void setUserUpdateTimeString(String value) {
		setUserUpdateTime(DateConvertUtils.parse(value, FORMAT_USER_UPDATE_TIME,Date.class));
	}
	
	public Date getUserUpdateTime() {
		return this.userUpdateTime;
	}
	
	public void setUserUpdateTime(Date value) {
		this.userUpdateTime = value;
	}
	
	public String getUserCreator() {
		return this.userCreator;
	}
	
	public void setUserCreator(String value) {
		this.userCreator = value;
	}
	
	public String getRemark() {
		return this.remark;
	}
	
	public void setRemark(String value) {
		this.remark = value;
	}

	public com.blueland.bpm.identity.model.Org getOrg() {
		return org;
	}

	public void setOrg(Org org) {
		this.org = org;
	}

	public String getUserMail() {
		return userMail;
	}

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

	public String getOrgName() {
		return orgName;
	}

	public void setOrgName(String orgName) {
		this.orgName = orgName;
	}
	
	public boolean isUserQyStatus() {
		return this.userStatus!=null?this.userStatus.equals("QY"):true;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}
	
	public String getDeptId() {
		return deptId;
	}


	public void setDeptId(String deptId) {
		this.deptId = deptId;
	}

	public String getDeptName() {
		return deptName;
	}

	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}

	public String toString() {
		return ToStringBuilder.reflectionToString(this,ToStringStyle.MULTI_LINE_STYLE);
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getUserId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof User == false) return false;
		if(this == obj) return true;
		User other = (User)obj;
		return new EqualsBuilder()
			.append(getUserId(),other.getUserId())
			.isEquals();
	}
	
}

