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;

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

    private static final long serialVersionUID = 1L;

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

    @ApiModelProperty(value = "账户类型 -  1:交易所 2:机构 3:会员子机构 4:经纪人 5:投资者 6:客户 7:企业成员(云平台) ")
    @TableField("USERTYPE")
    private Integer usertype;

    @ApiModelProperty(value = "变更状态 1 未变更 2 变更中 3 变更待审核 4 变更待复核(投资者)")
    @TableField("MODIFYSTATUS")
    @Builder.Default
    private Integer modifystatus = 0;

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

    @ApiModelProperty(value = "所属机构ID")
    @TableField("PARENTUSERID")
    private Long parentuserid;

    @ApiModelProperty(value = "所属经纪人ID(所属客户经理-千海金)")
    @TableField("BROKER")
    private Long broker;

    @ApiModelProperty(value = "子机构层级路径(逗号分隔,首尾加逗号)")
    @TableField("SUBAREALEVELPATH")
    private String subarealevelpath;

    @ApiModelProperty(value = "推荐人ID")
    @TableField("REFEREEUSERID")
    private Long refereeuserid;

    @ApiModelProperty(value = "所属会员ID")
    @TableField("MEMBERUSERID")
    private Long memberuserid;

    @ApiModelProperty(value = "code areastatus 账户状态  -  1:待激活 2:待审核 3:待复审 4:正常 5:审核拒绝 6:停用(注销) 7:注销(删除)")
    @TableField("ACCOUNTSTATUS")
    private Integer accountstatus;

    @ApiModelProperty(value = "默认结算资金账号ID(机构分润使用) 作废")
    @TableField("RECKONACCOUNTID")
    private Long reckonaccountid;

    @ApiModelProperty(value = "创建时间")
    @TableField("CREATETIME")
    private Date createtime;

    @ApiModelProperty(value = "创建人")
    @TableField("CREATORID")
    private Long creatorid;

    @ApiModelProperty(value = "审核时间")
    @TableField("AUDITTIME")
    private Date audittime;

    @ApiModelProperty(value = "审核人")
    @TableField("AUDITUSERID")
    private Long audituserid;

    @ApiModelProperty(value = "审核备注")
    @TableField("AUDITREMARK")
    private String auditremark;

    @ApiModelProperty(value = "销户时间")
    @TableField("CANCELTIME")
    private Date canceltime;

    @ApiModelProperty(value = "销户人")
    @TableField("CANCELUSERID")
    private Long canceluserid;

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

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

    @ApiModelProperty(value = "变更备注")
    @TableField("MODIFYREMARK")
    private String modifyremark;

    @ApiModelProperty(value = "最大用户数(经纪会员下投资者个数)")
    @TableField("MAXINVESTORNUM")
    private Long maxinvestornum;

    @ApiModelProperty(value = "是否已实名认证 - 0:未认证 1:已认证 2:已提交(待审核) 3:已拒绝")
    @TableField("HASAUTH")
    private Integer hasauth;

    @ApiModelProperty(value = "推荐总人数")
    @TableField("REFERCOUNT")
    private Long refercount;

    @ApiModelProperty(value = "推荐码")
    @TableField("REFERNUM")
    private String refernum;

    @ApiModelProperty(value = "是否匿名下单 - 0:否 1:是")
    @TableField("ISANONYMOUS")
    private Integer isanonymous;

    @ApiModelProperty(value = "上级顶级机构 [092=0,1时，默认为1， 092=2时若自已为顶级，则填入自己，自己不为顶级，填入ParentUserID的ParentTopUser]")
    @TableField("PARENTTOPUSER")
    private String parenttopuser;

    @ApiModelProperty(value = "子账户层数")
    @TableField("SUBACCOUNTLEVEL")
    private Long subaccountlevel;

    @ApiModelProperty(value = "申请来源 - 1:管理端 2:终端")
    @TableField("APPLYSRC")
    private Integer applysrc;

    @ApiModelProperty(value = "审核来源 - 1:管理端 2:终端")
    @TableField("AUDITSRC")
    private Integer auditsrc;

    @ApiModelProperty(value = "根用户ID")
    @TableField("ROOTUSERID")
    private Long rootuserid;

    @ApiModelProperty(value = "是否可推荐 - 0:不可 1;可 (是否推荐人)")
    @TableField("CANRECOMMEND")
    private Integer canrecommend;

    @ApiModelProperty(value = "创建交易日(yyyyMMdd)")
    @TableField("CREATETRADEDATE")
    private String createtradedate;

    @ApiModelProperty(value = "间接推荐总人数")
    @TableField("SECREFERCOUNT")
    private Long secrefercount;

    @ApiModelProperty(value = "是否已同步(千海金) 0:未同步 1;已同步")
    @TableField("HASUPLOADED")
    private Integer hasuploaded;

    @ApiModelProperty(value = "同步时间")
    @TableField("UPLOADEDTIME")
    private Date uploadedtime;

    @ApiModelProperty(value = "外部用户ID(千海金-外部门店ID)")
    @TableField("OUTERUSERID")
    private String outeruserid;

    @ApiModelProperty(value = "团队经理用户ID(千海金:门店代理)")
    @TableField("TEAMMANAGERUSERID")
    private Long teammanageruserid;

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

    @ApiModelProperty(value = "授信额度(金瑞)分拣室服务费(广钻)")
    @TableField("CREDITQUOTA")
    private BigDecimal creditquota;

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

    @ApiModelProperty(value = "送检账户(广钻)")
    @TableField("SJACCOUNTNO")
    private String sjaccountno;


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

}
