package com.chinaweal.aiccs.org.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

import com.chinaweal.aiccs.common.util.DateUtils;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author <a href="https://blog.lroyia.top">lroyia</a>
 * @since 2021-02-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_users")
public class TUsers extends Model<TUsers> {

    private static final long serialVersionUID=1L;

    @TableId("USERID")
    private String userid;

    @TableField("USERNAME")
    private String username;

    @TableField("PASSWORD")
    private String password;

    @TableField("REALNAME")
    private String realname;

    @TableField("LOCKED")
    private String locked;

    @TableField("DELETED")
    private String deleted;

    @TableField("ORGDEPTID")
    private String orgdeptid;

    @TableField("ORGUNITID")
    private String orgunitid;

    @TableField("ORGJOBID")
    private String orgjobid;

    @TableField("USERPROP")
    private Integer userprop;

    @TableField("USERSTATUS")
    private String userstatus;

    @TableField("GRADENUM")
    private Integer gradenum;

    @TableField("CUSTOMINDEX")
    private Integer customindex;

    @TableField("LIMITTNUM")
    private Integer limittnum; //限制用户登录次数

    @JsonFormat(pattern = DateUtils.DATETIME_DEFAULT_FORMAT, timezone = "GMT+8")
    @TableField("LASTERRORTIME")
    private LocalDateTime lasterrortime;//用户登录失败5次后的时间

    /**
     * 统一身份认证的用户编码
     */
    @TableField("IMSUSERCODE")
    private String imsusercode;



    @Override
    protected Serializable pkVal() {
        return this.userid;
    }

}
