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;

/**
 * <p>
 * 持仓头寸表 - 导历史
 * </p>
 *
 * @author XKF
 * @since 2024-07-31
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("TRADEPOSITION")
@ApiModel(value="Tradeposition对象", description="持仓头寸表 - 导历史")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Tradeposition extends Model<Tradeposition> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "账号Id")
      @TableId(value = "ACCOUNTID")
    private Long accountid;

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

    @ApiModelProperty(value = "持仓类别 - 1:单边持仓 2:双边持仓")
    @TableField("HOLDERTYPE")
    private Integer holdertype;

    @ApiModelProperty(value = "买期初持仓数量")
    @TableField("BUYPOSITIONQTY")
    private Long buypositionqty;

    @ApiModelProperty(value = "买期初持仓总金额[商品币种]")
    @TableField("BUYHOLDERAMOUNT")
    private BigDecimal buyholderamount;

    @ApiModelProperty(value = "买当前持仓总数量")
    @TableField("BUYCURPOSITIONQTY")
    private Long buycurpositionqty;

    @ApiModelProperty(value = "买当前持仓总金额[商品币种]")
    @TableField("BUYCURHOLDERAMOUNT")
    private BigDecimal buycurholderamount;

    @ApiModelProperty(value = "买持仓冻结数量")
    @TableField("BUYFROZENQTY")
    private Long buyfrozenqty;

    @ApiModelProperty(value = "买持仓其他冻结数量(交割冻结) ")
    @TableField("BUYOTHERFROZENQTY")
    private Long buyotherfrozenqty;

    @ApiModelProperty(value = "买开仓申请数量(用于比较最大持仓数量)")
    @TableField("BUYOPENREQQTY")
    private Long buyopenreqqty;

    @ApiModelProperty(value = "今日买开仓总数量")
    @TableField("BUYOPENTOTALQTY")
    private Long buyopentotalqty;

    @ApiModelProperty(value = "今日买平仓总数量")
    @TableField("BUYCLOSETOTALQTY")
    private Long buyclosetotalqty;

    @ApiModelProperty(value = "卖期初持仓数量")
    @TableField("SELLPOSITIONQTY")
    private Long sellpositionqty;

    @ApiModelProperty(value = "卖期初持仓总金额[商品币种]")
    @TableField("SELLHOLDERAMOUNT")
    private BigDecimal sellholderamount;

    @ApiModelProperty(value = "卖当前持仓数量")
    @TableField("SELLCURPOSITIONQTY")
    private Long sellcurpositionqty;

    @ApiModelProperty(value = "卖当前持仓总金额[商品币种]")
    @TableField("SELLCURHOLDERAMOUNT")
    private BigDecimal sellcurholderamount;

    @ApiModelProperty(value = "卖持仓冻结")
    @TableField("SELLFROZENQTY")
    private Long sellfrozenqty;

    @ApiModelProperty(value = "卖持仓其他冻结(交割冻结) ")
    @TableField("SELLOTHERFROZENQTY")
    private Long sellotherfrozenqty;

    @ApiModelProperty(value = "卖开仓申请数量(用于比较最大持仓数量)")
    @TableField("SELLOPENREQQTY")
    private Long sellopenreqqty;

    @ApiModelProperty(value = "今日卖开仓总数量")
    @TableField("SELLOPENTOTALQTY")
    private Long sellopentotalqty;

    @ApiModelProperty(value = "今日卖平仓总数量")
    @TableField("SELLCLOSETOTALQTY")
    private Long sellclosetotalqty;

    @ApiModelProperty(value = "占用保证金[商品币种]")
    @TableField("USEDMARGIN")
    private BigDecimal usedmargin;

    @ApiModelProperty(value = "交易属性")
    @TableField("TRADEPROPERTY")
    private Integer tradeproperty;

    @ApiModelProperty(value = "买T+N冻结总量")
    @TableField("BUYTNQTY")
    private Long buytnqty;

    @ApiModelProperty(value = "买T+N使用量(可以使用T+N的冻结数量)")
    @TableField("BUYTNUSEDQTY")
    private Long buytnusedqty;

    @ApiModelProperty(value = "卖T+N冻结总量")
    @TableField("SELLTNQTY")
    private Long selltnqty;

    @ApiModelProperty(value = "卖T+N使用量(可以使用T+N的冻结数量)")
    @TableField("SELLTNUSEDQTY")
    private Long selltnusedqty;

    @ApiModelProperty(value = "买期末今日头寸")
    @TableField("BUYCURTDPOSITION")
    private Long buycurtdposition;

    @ApiModelProperty(value = "买冻结今日头寸")
    @TableField("BUYFRETDPOSITION")
    private Long buyfretdposition;

    @ApiModelProperty(value = "卖期末今日头寸")
    @TableField("SELLCURTDPOSITION")
    private Long sellcurtdposition;

    @ApiModelProperty(value = "卖冻结今日头寸")
    @TableField("SELLFRETDPOSITION")
    private Long sellfretdposition;


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

}
