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-10-15
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("TRADE_HOLDERDETAILEX")
@ApiModel(value="TradeHolderdetailex对象", description="交易持仓扩展表")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class TradeHolderdetailex extends Model<TradeHolderdetailex> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "成交单号(101+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)")
    private Long tradeid;

    @ApiModelProperty(value = "方向 - 0:买 1:卖")
    @TableField("BUYORSELL")
    private Integer buyorsell;

    @ApiModelProperty(value = "交易日(yyyyMMdd)")
    @TableField("TRADEDATE")
    private String tradedate;

    @ApiModelProperty(value = "市场ID")
    @TableField("MARKETID")
    private Long marketid;

    @ApiModelProperty(value = "商品ID")
    @TableField("GOODSID")
    private Long goodsid;

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

    @ApiModelProperty(value = "账号ID")
    @TableField("ACCOUNTID")
    private Long accountid;

    @ApiModelProperty(value = "对手用户ID")
    @TableField("MATCHUSERID")
    private Long matchuserid;

    @ApiModelProperty(value = "对手账号ID")
    @TableField("MATCHACCOUNTID")
    private Long matchaccountid;

    @ApiModelProperty(value = "建仓数量")
    @TableField("OPENQTY")
    private Long openqty;

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

    @ApiModelProperty(value = "建仓价格")
    @TableField("OPENPRICE")
    private BigDecimal openprice;

    @ApiModelProperty(value = "持仓数量")
    @TableField("HOLDERQTY")
    private Long holderqty;

    @ApiModelProperty(value = "持仓金额")
    @TableField("HOLDERAMOUNT")
    private BigDecimal holderamount;

    @ApiModelProperty(value = "持仓价格")
    @TableField("HOLDERPRICE")
    private BigDecimal holderprice;

    @ApiModelProperty(value = "冻结数量")
    @TableField("FREEZEQTY")
    private Long freezeqty;

    @ApiModelProperty(value = "交收手数(已交收)")
    @TableField("DELIVERYQTY")
    private Long deliveryqty;

    @ApiModelProperty(value = "持仓天数")
    @TableField("HOLDDAYS")
    private Integer holddays;

    @ApiModelProperty(value = "已付定金占用")
    @TableField("PAYEDDEPOSIT")
    private BigDecimal payeddeposit;

    @ApiModelProperty(value = "补充定金追加")
    @TableField("RESTOCKDEPOSIT")
    private BigDecimal restockdeposit;

    @ApiModelProperty(value = "滞纳金起计天数")
    @TableField("LATEFEEDAYS")
    private Integer latefeedays;

    @ApiModelProperty(value = "滞纳金收取方式 1：比率  2：固定")
    @TableField("LATEFEEALGORITHM")
    private Integer latefeealgorithm;

    @ApiModelProperty(value = "滞纳金收取值")
    @TableField("LATEFEEVALUE")
    private BigDecimal latefeevalue;

    @ApiModelProperty(value = "已计滞纳金")
    @TableField("CALLATEFEE")
    private BigDecimal callatefee;

    @ApiModelProperty(value = "提示定金率")
    @TableField("PROMPTDEPOSITRATE")
    private BigDecimal promptdepositrate;

    @ApiModelProperty(value = "斩仓定金率")
    @TableField("CUTDEPOSITRATE")
    private BigDecimal cutdepositrate;

    @ApiModelProperty(value = "提示价格")
    @TableField("PROMPTPRICE")
    private BigDecimal promptprice;

    @ApiModelProperty(value = "斩仓价格")
    @TableField("CUTPRICE")
    private BigDecimal cutprice;

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

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

    @ApiModelProperty(value = "订单定金率")
    @TableField("DEPOSITRATE")
    private BigDecimal depositrate;

    @ApiModelProperty(value = "可退定金")
    @TableField("REFUNDABLEDEPOSIT")
    private BigDecimal refundabledeposit;

    @ApiModelProperty(value = "已付滞纳金")
    @TableField("PAYEDLATEFEE")
    private BigDecimal payedlatefee;

    @ApiModelProperty(value = "交易时间")
    @TableField("TRADETIME")
    private Date tradetime;

    @ApiModelProperty(value = "处理状态")
    @TableField("HANDLESTATUS")
    private Integer handlestatus;

    @ApiModelProperty(value = "初始已付定金")
    @TableField("ORIPAYEDDEPOSIT")
    private BigDecimal oripayeddeposit;

    @ApiModelProperty(value = "累计补充定金")
    @TableField("ORIRESTOCKDEPOSIT")
    private BigDecimal orirestockdeposit;

    @ApiModelProperty(value = "是否允许自动追加定金: 0-否 1-是(52)")
    @TableField("CANAUTOADDDEPOSIT")
    private Integer canautoadddeposit;

    @ApiModelProperty(value = "自动追加定金率(52) - 允许时显示")
    @TableField("ADDDEPOSITRATE")
    private BigDecimal adddepositrate;

    @ApiModelProperty(value = "是否允许自动退还定金: 0-否 1-是(52)")
    @TableField("CANAUTOREFUNDDEPOSIT")
    private Integer canautorefunddeposit;


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

}
