package cn.estsh.i3plus.pojo.platform.bean;

import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.bean.BaseConstWords;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

/**
 * @Description : 用户详细
 * @Reference   :
 * @Author      : wei.peng
 * @Date        : 2018-10-22 16:58:43.910
 * @Modify      :
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="SYS_USER_INFO")
@Api(value="用户详细",description = "用户详细")
public class  SysUserInfo extends BaseBean {

    private static final long serialVersionUID = 3876318482048754222L;

    @Column(name="USER_ID")
    @ApiParam(value ="账号ID" , example = "-1")
    @JsonSerialize(using = ToStringSerializer.class)
    @AnnoOutputColumn(hidden = true)
    private Long userId;

    @Column(name="NAME")
    @ApiParam(value ="名称" , access ="名称")
    private String name;

    @Column(name="USER_EMP_NO")
    @ApiParam(value ="工号")
    private String userEmpNo;

    @Column(name="USER_EMPLOYEE_TYPE")
    @ApiParam(value ="员工类型", access ="实习、试用期、正式")
    @AnnoOutputColumn(refClass = SysDictionary.class,value = "name",refForeignKey = BaseConstWords.DICTIONARY_EMPLOYEE_TYPE)
    private Integer userEmployeeType;

    @Column(name="USER_GRADE")
    @ApiParam(value ="员工等级")
    @AnnoOutputColumn(refClass = SysDictionary.class,value = "name",refForeignKey = BaseConstWords.DICTIONARY_EMPLOYEE_GRADE)
    private Integer userGrade;

    @Column(name="USER_JOIN_DATE")
    @ApiParam(value ="入职日期" , access ="默认当前时间")
    private String userJoinDate;

    @Column(name="USER_RESIGNATION_DATE")
    @ApiParam(value ="离职日期" , access ="默认当前时间")
    private String userResignationDate;

    @Column(name="USER_CARD_TYPE")
    @ApiParam(value ="证件类型")
    @AnnoOutputColumn(refClass = SysDictionary.class,value = "name",refForeignKey = BaseConstWords.DICTIONARY_CERTIFICATE_TYPE)
    private Integer userCardType;

    @Column(name="USER_CARD_NUMBER")
    @ApiParam(value ="证件编号")
    private String userCardNumber;

    @Column(name="USER_SCHOOL")
    @ApiParam(value ="毕业院校")
    private String userSchool;

    @Column(name="USER_SCHOOL_PROFESSION")
    @ApiParam(value ="毕业专业")
    private String userSchoolProfession;

    @Column(name="USER_SCHOOL_LEAVE_DATE")
    @ApiParam(value ="毕业时间")
    private String userSchoolLeaveDate;

    @Column(name="user_School_Education")
    @ApiParam(value ="学历")
    @AnnoOutputColumn(refClass = SysDictionary.class,value = "name",refForeignKey = BaseConstWords.DICTIONARY_EDUCATION)
    private Integer userSchoolEducation;

    @Column(name="USER_SEX")
    @ApiParam(value ="性别（1.男，2.女）" , example ="1" , access ="性别（1.男，2.女）")
    @AnnoOutputColumn(refClass = SysDictionary.class,value = "name",refForeignKey = BaseConstWords.DICTIONARY_SEX)
    private Integer userSex;

    @Column(name="USER_BIRTHPLACE")
    @ApiParam(value ="籍贯")
    private String userBirthplace;

    @Column(name="USER_RACE")
    @ApiParam(value ="民族")
    @AnnoOutputColumn(refClass = SysDictionary.class,value = "name",refForeignKey = BaseConstWords.DICTIONARY_NATIONALITY)
    private Integer userRace;

    @Column(name="USER_MARRIAGE")
    @ApiParam(value ="婚姻" , example ="1" , access ="性别（1.未知，2.已婚,3未婚）")
    @AnnoOutputColumn(refClass = SysDictionary.class,value = "name",refForeignKey = BaseConstWords.DICTIONARY_MARRIAGE)
    private Integer userMarriage;

    @Column(name="USER_EMERGENCY_CONTACT")
    @ApiParam(value ="紧急联系人")
    private String userEmergencyContact;

    @Column(name="USER_EMERGENCY_PHONE")
    @ApiParam(value ="紧急联系人-电话")
    private String userEmergencyPhone;

    @Column(name="USER_FAMILY_ADDRESS")
    @ApiParam(value ="家庭地址")
    private String userFamilyAddress;

    @Column(name="USER_BORN_DATE")
    @ApiParam(value ="出生日期")
    private String userBornDate;

    @Column(name="USER_POLITICAL_STATUS")
    @ApiParam(value ="政治面貌")
    @AnnoOutputColumn(refClass = SysDictionary.class,value = "name",refForeignKey = BaseConstWords.DICTIONARY_POLITICAL_STATUS)
    private Integer userPoliticalStatus;

    @Column(name="USER_HOBBY")
    @ApiParam(value ="兴趣爱好")
    private String userHobby;

    @Column(name="USER_INFO_STATUS")
    @ApiParam(value ="用户状态" , example ="-1")
    @AnnoOutputColumn(refClass = CommonEnumUtil.USER_STATUS.class)
    private Integer userInfoStatus;

    @Column(name="USER_LOGIN_NUM")
    @ApiParam(value ="登录次数",example = "0")
    private Integer userLoginNum;

    @Column(name="USER_LOGIN_LAST_DATE_TIME")
    @ApiParam(value ="用户最后登录时间")
    private String userLoginLastDateTime;

/********************************** 关系信息 ********************************/

    @Column(name="USER_IMAGE_ID")
    @ApiParam(value ="用户图像" , example = "-1")
    @JsonSerialize(using = ToStringSerializer.class)
    @AnnoOutputColumn(hidden = true)
    private Long userImageId;

    @Column(name="DEPARTMENT_ID")
    @ApiParam(value ="部门ID" , example ="-1")
    @JsonSerialize(using = ToStringSerializer.class)
    @AnnoOutputColumn(hidden = true)
    private Long departmentId;

    @Column(name="POSITION_ID")
    @ApiParam(value ="岗位ID" , example ="-1")
    @JsonSerialize(using = ToStringSerializer.class)
    @AnnoOutputColumn(hidden = true)
    private Long positionId;

    @Column(name="ORGANIZE_ID")
    @ApiParam(value ="组织ID" , example = "0")
    @JsonSerialize(using = ToStringSerializer.class)
    @AnnoOutputColumn(hidden = true)
    private Long organizeId;

/********************************** 冗余信息 ********************************/

    @Column(name="DEPARTMENT_NAME_RDD")
    @ApiParam(value ="部门名称" , access ="部门名称")
    private String departmentNameRdd;

//    @Column(name="DEPARTMENT_NAMES_RDD")
//    @ApiParam(value ="部门集合" , access ="部门集合")
//    @AnnoOutputColumn(hidden = true)
//    private String departmentNamesRdd;

    @Column(name="POSITION_NAME_RDD")
    @ApiParam(value ="岗位名称" , access ="岗位名称")
    private String positionNameRdd;

//    @Column(name="POSITION_NAMES_RDD")
//    @ApiParam(value ="岗位集合" , access ="岗位集合")
//    @AnnoOutputColumn(hidden = true)
//    private String positionNamesRdd;

    @Column(name="ORGANIZE_NAME_RDD")
    @ApiParam(value ="组织名称" , access ="组织名称")
    private String organizeNameRdd;

//    @Column(name="ORGANIZE_NAMES_RDD")
//    @ApiParam(value ="组织集合" , access ="组织集合")
//    @AnnoOutputColumn(hidden = true)
//    private String organizeNamesRdd;

/********************************** 非数据库信息 ********************************/

    @Transient
    @ApiParam(value ="用户所有部门信息")
    @AnnoOutputColumn(hidden = true)
    private List<SysDepartment> departmentList;

    @Transient
    @ApiParam(value ="用户所有部门Id信息")
    @AnnoOutputColumn(hidden = true)
    private List<String> departmentIdList;

    @Transient
    @ApiParam(value ="用户所有岗位信息")
    @AnnoOutputColumn(hidden = true)
    private List<SysPosition> positionList;

    @Transient
    @ApiParam(value ="用户所有组织信息")
    @AnnoOutputColumn(hidden = true)
    private List<SysOrganize> organizeList;

    @Transient
    @ApiParam(value ="用户所有组织Id信息")
    @AnnoOutputColumn(hidden = true)
    private List<String> organizeIdList;

    @Transient
    @ApiParam(value ="用户部门信息")
    @AnnoOutputColumn(hidden = true)
    private SysDepartment department;

    @Transient
    @ApiParam(value ="用户组织信息")
    @AnnoOutputColumn(hidden = true)
    private SysOrganize organize;

    @Transient
    @ApiParam(value = "岗位信息")
    @AnnoOutputColumn(hidden = true)
    private SysPosition position;

    @Transient
    @ApiParam(value = "图像信息")
    @AnnoOutputColumn(hidden = true)
    private String imageFileUrl;
}
