package com.muchinfo.mtp3pojos.entity;

import com.baomidou.mybatisplus.annotation.IdType;
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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

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

/**
 * <p>
 * 登录账户表
 * </p>
 *
 * @author XKF
 * @since 2024-04-15
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("LOGINACCOUNT")
@ApiModel(value="Loginaccount对象", description="登录账户表")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Loginaccount extends Model<Loginaccount> implements Serializable{

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "登陆账号")
    @TableId(value = "LOGINID")
    private Long loginid;

    @ApiModelProperty(value = "用户ID")
    @TableField("USERID")
    private Long userid;

    @ApiModelProperty(value = "连续登录失败次数(登录成功时清零)")
    @TableField("LOGINFAILNUM")
    private Integer loginfailnum;

    @ApiModelProperty(value = "登陆密码")
    @TableField("PASSWORD")
    private String password;

    @ApiModelProperty(value = "登录账号类型 - 1:投资者 2:机构交易员")
    @TableField("LOGINUSERTYPE")
    private Integer loginusertype;

    @ApiModelProperty(value = "登录账号状态 1:正常 2:冻结(停用) 3:无效(注销)")
    @TableField("LOGINSTATUS")
    private Integer loginstatus;

    @ApiModelProperty(value = "最新登录时间")
    @TableField("LASTLOGINTIME")
    private Date lastlogintime;

    @ApiModelProperty(value = "最新登录方式(客户端类型) -  0:保留为未填终端类型 1:PC管理端 2:PC交易端 3:手机客户端_安卓 4:网页客户端 5:微信客户端 6:手机客户端_苹果 7:网上开户客户端 8:无效终端编号 9:报价终端(中江)")
    @TableField("LASTLOGINMODE")
    private Integer lastloginmode;

    @ApiModelProperty(value = "最新登录地址")
    @TableField("LASTLOGINIP")
    private String lastloginip;

    @ApiModelProperty(value = "最新登录端口")
    @TableField("LOGINPORT")
    private Long loginport;

    @ApiModelProperty(value = "最新登录描述")
    @TableField("LASTLOGINREMARK")
    private String lastloginremark;

    @ApiModelProperty(value = "修改时间")
    @TableField("MODIFYTIME")
    private Date modifytime;

    @ApiModelProperty(value = "修改人")
    @TableField("MODIFIERID")
    private Long modifierid;

    @ApiModelProperty(value = "密码错误次数")
    @TableField("PWDWRONGCOUNT")
    private Integer pwdwrongcount;

    @ApiModelProperty(value = "账户解冻时间")
    @TableField("UNFREEZETIME")
    private Date unfreezetime;

    @ApiModelProperty(value = "是否已登录 - 0:未登录 1:已登录")
    @TableField("HASLOGINED")
    private Integer haslogined;

    @ApiModelProperty(value = "是否已更改密码 - 0:未修改 1:已修改")
    @TableField("HASUPDATEDPWD")
    private Integer hasupdatedpwd;

    @ApiModelProperty(value = "登录代码")
    @TableField("LOGINCODE")
    private String logincode;

    @ApiModelProperty(value = "是否可出入金 - 0:不可 1:可")
    @TableField("CANOUTIN")
    private Integer canoutin;

    @ApiModelProperty(value = "终端角色ID")
    @TableField("CLIENTROLEID")
    private Long clientroleid;

    @ApiModelProperty(value = "资金账号权限类型 - 1:不选默认为所有权限 2:不选默认为无权限")
    @TableField("TAACCOUNTRIGHTTYPE")
    private Integer taaccountrighttype;

    @ApiModelProperty(value = "手机号码(加密存储)")
    @TableField("MOBILE")
    private String mobile;

    @ApiModelProperty(value = "账户名称")
    @TableField("ACCOUNTNAME")
    private String accountname;

    @ApiModelProperty(value = "修改人来源 - 1:管理端 2:终端")
    @TableField("MODIFYSRC")
    private Integer modifysrc;

    @ApiModelProperty(value = "关联用户ID(机构)")
    @TableField("RELATEDUSERID")
    private Long relateduserid;

    @ApiModelProperty(value = "所属部门(管理部门)")
    @TableField("SUBJECTID")
    private Long subjectid;

    @TableField(select = false)
    List<Long> accountIdS;

    @Override
    public Serializable pkVal() {
        return this.loginid;
    }

}
