package com.xkrs.model.entity;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;


/**
 * SysUser 表实体类
 * @author tajochen
 * 用户信息
 */
@Entity
@Table(name="sys_user")
public class SysUserEntity implements Serializable {

    /**
     * 指定主键，建立自增序列，主键值取自序列
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    //@SequenceGenerator(name = "sys_user_seq_gen", sequenceName = "sys_user_id_seq",allocationSize = 1)
    private Integer id;

    /**
     * 用户名
     */
    @Column(length = 16, nullable = false, unique = true, columnDefinition = "varchar(16)")
    private String userName;

    /**
     * 用户昵称
     */
    @Column(length = 32, columnDefinition = "varchar(32)")
    private String nickName;

    /**
     * 密码
     */
    @Column(length = 64, nullable = false, columnDefinition = "varchar(64)")
    private String password;

    @Column(length = 32, nullable = false, columnDefinition = "varchar(32)")
    private String salt;

    @Column(length = 16, unique = true, columnDefinition = "varchar(16)")
    private String telephone;

    @Column(columnDefinition = "varchar(192)")
    private String signature;

    @Column(nullable = false)
    private Integer activeFlag;

    @Column(nullable = false,columnDefinition = "smallint")
    private Integer statusCode;

    @Column(nullable = false)
    private LocalDateTime addTime;

    private LocalDateTime lastEntryTime;

    @Column(nullable = false)
    private Integer deleteFlag;

    @Column(columnDefinition = "varchar(64)")
    private String lastEntryIp;

    /**
     * 用户头像
     */
    private String avatar;

    /**
     * 省
     */
    @Column(columnDefinition = "varchar(32)")
    private String province;

    /**
     * 市
     */
    @Column(columnDefinition = "varchar(32)")
    private String city;

    /**
     * 区
     */
    @Column(columnDefinition = "varchar(32)")
    private String county;

    /**
     * 识别码，身份id
     */
    private String identifier;

    /**
     * 用户身份
     */
    private String identity;

    public Integer getId() {
        return id;
    }

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

    public String getUserName() {
        return userName;
    }

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

    public String getNickName() {
        return nickName;
    }

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

    public String getPassword() {
        return password;
    }

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

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getTelephone() {
        return telephone;
    }

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

    public String getSignature() {
        return signature;
    }

    public void setSignature(String signature) {
        this.signature = signature;
    }

    public Integer getActiveFlag() {
        return activeFlag;
    }

    public void setActiveFlag(Integer activeFlag) {
        this.activeFlag = activeFlag;
    }

    public Integer getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(Integer statusCode) {
        this.statusCode = statusCode;
    }

    public LocalDateTime getAddTime() {
        return addTime;
    }

    public void setAddTime(LocalDateTime addTime) {
        this.addTime = addTime;
    }

    public LocalDateTime getLastEntryTime() {
        return lastEntryTime;
    }

    public void setLastEntryTime(LocalDateTime lastEntryTime) {
        this.lastEntryTime = lastEntryTime;
    }

    public Integer getDeleteFlag() {
        return deleteFlag;
    }

    public void setDeleteFlag(Integer deleteFlag) {
        this.deleteFlag = deleteFlag;
    }

    public String getLastEntryIp() {
        return lastEntryIp;
    }

    public void setLastEntryIp(String lastEntryIp) {
        this.lastEntryIp = lastEntryIp;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCounty() {
        return county;
    }

    public void setCounty(String county) {
        this.county = county;
    }

    public String getIdentifier() {
        return identifier;
    }

    public void setIdentifier(String identifier) {
        this.identifier = identifier;
    }

    public String getIdentity() {
        return identity;
    }

    public void setIdentity(String identity) {
        this.identity = identity;
    }

    @Override
    public String toString() {
        return "SysUserEntity{" +
                "id=" + id +
                ", userName='" + userName + '\'' +
                ", nickName='" + nickName + '\'' +
                ", password='" + password + '\'' +
                ", salt='" + salt + '\'' +
                ", telephone='" + telephone + '\'' +
                ", signature='" + signature + '\'' +
                ", activeFlag=" + activeFlag +
                ", statusCode=" + statusCode +
                ", addTime=" + addTime +
                ", lastEntryTime=" + lastEntryTime +
                ", deleteFlag=" + deleteFlag +
                ", lastEntryIp='" + lastEntryIp + '\'' +
                ", avatar='" + avatar + '\'' +
                ", province='" + province + '\'' +
                ", city='" + city + '\'' +
                ", county='" + county + '\'' +
                ", identifier='" + identifier + '\'' +
                ", identity='" + identity + '\'' +
                '}';
    }
}
