package com.muchinfo.mtp3pojos.entity;

import com.baomidou.mybatisplus.annotation.TableField;
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.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

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

/**
 * <p>
 * 资金账户报表表
 * </p>
 *
 * @author XKF
 * @since 2024-08-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("REPORT_TAACCOUNT")
@ApiModel(value="ReportTaaccount对象", description="资金账户报表表")
public class ReportTaaccount extends Model<ReportTaaccount> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "资金账户ID")
    private Long accountid;

    @ApiModelProperty(value = "周期类型 - 1:月 2:季 3:年 4:周 5:全报表")
    @TableField("CYCLETYPE")
    private Integer cycletype;

    @ApiModelProperty(value = "周期时间 月(YYYYMM)  季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)")
    @TableField("CYCLETIME")
    private String cycletime;

    @ApiModelProperty(value = "更新时间")
    @TableField("UPDATETIME")
    private Date updatetime;

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

    @ApiModelProperty(value = "是否母账号 0:不是母账户 1:是母账户")
    @TableField("ISMAIN")
    private Integer ismain;

    @ApiModelProperty(value = "所属根账户")
    @TableField("PARENTACCOUNTID")
    private Long parentaccountid;

    @ApiModelProperty(value = "外部/内部账号 - 1:外部账号 2:内部账号")
    @TableField("TAACCOUNTTYPE")
    private Integer taaccounttype;

    @ApiModelProperty(value = "货币ID")
    @TableField("CURRENCYID")
    private Long currencyid;

    @ApiModelProperty(value = "期初余额")
    @TableField("BALANCE")
    private BigDecimal balance;

    @ApiModelProperty(value = "期初冻结保证金")
    @TableField("ORIFREEZEMARGIN")
    private BigDecimal orifreezemargin;

    @ApiModelProperty(value = "期初占用保证金")
    @TableField("ORIUSEDMARGIN")
    private BigDecimal oriusedmargin;

    @ApiModelProperty(value = "期初其他冻结保证金(出金冻结资金 交割买方冻结 申购冻结 全款买入 商城买入)")
    @TableField("ORIOTHERFREEZEMARGIN")
    private BigDecimal oriotherfreezemargin;

    @ApiModelProperty(value = "期初手续费冻结")
    @TableField("ORIFREEZECHARGE")
    private BigDecimal orifreezecharge;

    @ApiModelProperty(value = "期初授信金额")
    @TableField("ORIMORTGAGECREDIT")
    private BigDecimal orimortgagecredit;

    @ApiModelProperty(value = "期初其它授信金额")
    @TableField("ORIOTHERCREDIT")
    private BigDecimal oriothercredit;

    @ApiModelProperty(value = "期初出金冻结")
    @TableField("ORIOUTAMOUNTFREEZE")
    private BigDecimal orioutamountfreeze;

    @ApiModelProperty(value = "期末余额")
    @TableField("CURRENTBALANCE")
    private BigDecimal currentbalance;

    @ApiModelProperty(value = "冻结保证金")
    @TableField("FREEZEMARGIN")
    private BigDecimal freezemargin;

    @ApiModelProperty(value = "占用保证金")
    @TableField("USEDMARGIN")
    private BigDecimal usedmargin;

    @ApiModelProperty(value = "其他冻结保证金(出金冻结资金 交割买方冻结 申购冻结 全款买入 商城买入)")
    @TableField("OTHERFREEZEMARGIN")
    private BigDecimal otherfreezemargin;

    @ApiModelProperty(value = "手续费冻结")
    @TableField("FREEZECHARGE")
    private BigDecimal freezecharge;

    @ApiModelProperty(value = "授信金额")
    @TableField("MORTGAGECREDIT")
    private BigDecimal mortgagecredit;

    @ApiModelProperty(value = "其它授信金额")
    @TableField("OTHERCREDIT")
    private BigDecimal othercredit;

    @ApiModelProperty(value = "出金冻结")
    @TableField("OUTAMOUNTFREEZE")
    private BigDecimal outamountfreeze;

    @ApiModelProperty(value = "本周期入金金额")
    @TableField("INAMOUNT")
    private BigDecimal inamount;

    @ApiModelProperty(value = "本周期出金金额")
    @TableField("OUTAMOUNT")
    private BigDecimal outamount;

    @ApiModelProperty(value = "本周期手续费支出")
    @TableField("PAYCHARGE")
    private BigDecimal paycharge;

    @ApiModelProperty(value = "本周期平仓盈亏")
    @TableField("CLOSEPL")
    private BigDecimal closepl;

    @ApiModelProperty(value = "本周期结算盈亏")
    @TableField("RECKONPL")
    private BigDecimal reckonpl;

    @ApiModelProperty(value = "本周期授信增加")
    @TableField("CREDITINCREASE")
    private BigDecimal creditincrease;

    @ApiModelProperty(value = "本周期授信减少")
    @TableField("CREDITDECREASE")
    private BigDecimal creditdecrease;

    @ApiModelProperty(value = "本周期其它授信增加")
    @TableField("OTHERCREDITINCREASE")
    private BigDecimal othercreditincrease;

    @ApiModelProperty(value = "本周期其它授信减少")
    @TableField("OTHERCREDITDECREASE")
    private BigDecimal othercreditdecrease;

    @ApiModelProperty(value = "其他支出(交割付款 申购付款 全款买入 商城买入 卖家退货)")
    @TableField("OTHERPAY")
    private BigDecimal otherpay;

    @ApiModelProperty(value = "其他收入(交割收款 申购收款 全款卖出 商城卖出 买家退货 会员手续费收入)")
    @TableField("OTHERINCOME")
    private BigDecimal otherincome;

    @ApiModelProperty(value = "本周期划转金额(母子账号资金划转，从账号划入为正，从账号划出为负)")
    @TableField("TRANSFERAMOUNT")
    private BigDecimal transferamount;

    @ApiModelProperty(value = "出金阈值")
    @TableField("OUTTHRESHOLD")
    private BigDecimal outthreshold;

    @ApiModelProperty(value = "清算余额 = 期末余额 - 授信金额 - 其它授信金额")
    @TableField("CLEARBALANCE")
    private BigDecimal clearbalance;

    @ApiModelProperty(value = "本周期已收手续费分成")
    @TableField("DIVIDEDCHARGE")
    private BigDecimal dividedcharge;

    @ApiModelProperty(value = "本周期应付交易所手续费")
    @TableField("PAYEXCHCHARGE")
    private BigDecimal payexchcharge;

    @ApiModelProperty(value = "清算盈亏")
    @TableField("CLEARPL")
    private BigDecimal clearpl;

    @ApiModelProperty(value = "本周期三方入金")
    @TableField("THIRDINAMOUNT")
    private BigDecimal thirdinamount;

    @ApiModelProperty(value = "本周期交易手续费支出 [101,102]")
    @TableField("TRADECHARGE")
    private BigDecimal tradecharge;

    @ApiModelProperty(value = "本周期递延费支出[103, 104]")
    @TableField("INTERESTCHARGE")
    private BigDecimal interestcharge;

    @ApiModelProperty(value = "本周期交收手续费支出 [105,106]")
    @TableField("DELIVERYCHARGE")
    private BigDecimal deliverycharge;

    @ApiModelProperty(value = "本周期持仓过夜费支出[108,109, 110]")
    @TableField("HOLDCHARGE")
    private BigDecimal holdcharge;

    @ApiModelProperty(value = "本周期三方出金")
    @TableField("THIRDOUTAMOUNT")
    private BigDecimal thirdoutamount;

    @ApiModelProperty(value = "本周期成交量")
    @TableField("TRADEQTY")
    private Long tradeqty;

    @ApiModelProperty(value = "本周期成交金额")
    @TableField("TRADEAMOUNT")
    private BigDecimal tradeamount;

    @ApiModelProperty(value = "本周期交收货款支出")
    @TableField("DELIVERYAMOUNTOUT")
    private BigDecimal deliveryamountout;

    @ApiModelProperty(value = "本周期交收货款收入")
    @TableField("DELIVERYAMOUNTIN")
    private BigDecimal deliveryamountin;

    @ApiModelProperty(value = "本周期交收补偿费支出")
    @TableField("DELIVERYCOMPENSATIONFEEOUT")
    private BigDecimal deliverycompensationfeeout;

    @ApiModelProperty(value = "本周期交收补偿费收入")
    @TableField("DELIVERYCOMPENSATIONFEEIN")
    private BigDecimal deliverycompensationfeein;

    @ApiModelProperty(value = "本周期本金余额[外部子账户实际出入金余额]")
    @TableField("CAPITALBALANCE")
    private BigDecimal capitalbalance;

    @ApiModelProperty(value = "平仓盈亏(逐笔)")
    @TableField("CLOSEPL2")
    private BigDecimal closepl2;

    @ApiModelProperty(value = "结算盈亏(逐笔) - 汇总取期末")
    @TableField("RECKONPL2")
    private BigDecimal reckonpl2;

    @ApiModelProperty(value = "净值  = 期末余额 + 所有权市值")
    @TableField("NETVALUE")
    private BigDecimal netvalue;

    @ApiModelProperty(value = "今日手续费支出(外部配置)")
    @TableField("PAYCHARGE2")
    private BigDecimal paycharge2;

    @ApiModelProperty(value = "本周期递延费2支出[111, 112]")
    @TableField("DEFERCHARGE")
    private BigDecimal defercharge;

    @ApiModelProperty(value = "所属上级账户")
    @TableField("FROMACCOUNTID")
    private Long fromaccountid;

    @ApiModelProperty(value = "账号层级路径(逗号分隔,首尾加逗号)")
    @TableField("SUBLEVELPATH")
    private String sublevelpath;

    @ApiModelProperty(value = "关联用户")
    @TableField("RELATEUSERID")
    private BigDecimal relateuserid;

    @ApiModelProperty(value = "所有权市值")
    @TableField("OWNERSHIPVALUE")
    private BigDecimal ownershipvalue;

    @ApiModelProperty(value = "现货市值-统计服务更新")
    @TableField("SPOTVALUE")
    private BigDecimal spotvalue;

    @ApiModelProperty(value = "今日账户盈亏 = 今日净值-昨日净值+今日出金-今日入金-今日划转+今日授信减少-今日授信增加+今日其它授信减少-今日其它授信增加+今日三方出金-今日三方入金; 由统计服务更新")
    @TableField("ACCOUNTPL")
    private BigDecimal accountpl;

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

    @ApiModelProperty(value = "期初欠款【期初】")
    @TableField("ORIDEBT")
    private BigDecimal oridebt;

    @ApiModelProperty(value = "期末欠款【期末】")
    @TableField("CURDEBT")
    private BigDecimal curdebt;

    @ApiModelProperty(value = "可用资金【期末】")
    @TableField("AVAIABLEMONEY")
    private BigDecimal avaiablemoney;

    @ApiModelProperty(value = "可出资金【期末】")
    @TableField("AVAIABLEOUTMONEY")
    private BigDecimal avaiableoutmoney;

    @ApiModelProperty(value = "浮动盈亏【期末】")
    @TableField("FLOATPL")
    private BigDecimal floatpl;

    @ApiModelProperty(value = "浮动净值【期末】")
    @TableField("FLOATNETVALUE")
    private BigDecimal floatnetvalue;

    @ApiModelProperty(value = "风险率【期末】")
    @TableField("RISKRATE")
    private BigDecimal riskrate;


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

}
