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.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

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

/**
 * <p>
 * 期权行权明细表 - 导历史
 * </p>
 *
 * @author XKF
 * @since 2024-11-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("TRADE_EXERCISEDETAIL")
@ApiModel(value="TradeExercisedetail对象", description="期权行权明细表 - 导历史")
public class TradeExercisedetail extends Model<TradeExercisedetail> {

    private static final long serialVersionUID = 1L;

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

    @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("BUYERACCOUNTID")
    private Long buyeraccountid;

    @ApiModelProperty(value = "卖方账号ID")
    @TableField("SELLERACCOUNTID")
    private Long selleraccountid;

    @ApiModelProperty(value = "融货方ID")
    @TableField("MIDDLEUSERID")
    private Long middleuserid;

    @ApiModelProperty(value = "融货方资金账号")
    @TableField("MIDDLEACCOUNTID")
    private Long middleaccountid;

    @ApiModelProperty(value = "行权价")
    @TableField("OPENPRICE")
    private BigDecimal openprice;

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

    @ApiModelProperty(value = "权利金")
    @TableField("PREMIUM")
    private BigDecimal premium;

    @ApiModelProperty(value = "市场价")
    @TableField("MARKETPRICE")
    private BigDecimal marketprice;

    @ApiModelProperty(value = "期权类型 - 1:认购(看涨) 2:认沽(看跌) ")
    @TableField("OPTIONTYPE")
    private Integer optiontype;

    @ApiModelProperty(value = "买方应付")
    @TableField("BUYEROUT")
    private BigDecimal buyerout;

    @ApiModelProperty(value = "买方应收")
    @TableField("BUYERIN")
    private BigDecimal buyerin;

    @ApiModelProperty(value = "卖方应付")
    @TableField("SELLEROUT")
    private BigDecimal sellerout;

    @ApiModelProperty(value = "卖方应收")
    @TableField("SELLERIN")
    private BigDecimal sellerin;

    @ApiModelProperty(value = "融货方应收")
    @TableField("MIDDLEIN")
    private BigDecimal middlein;

    @ApiModelProperty(value = "履约计划模板ID")
    @TableField("PERFORMANCETEMPLATEID")
    private Long performancetemplateid;

    @ApiModelProperty(value = "处理状态 - 1:冻结卖方货款节点 2:解冻买方货款节点 3:确认行权平仓 4:资金划转 5:违约处理 6:确认行权成功 7:确认行权失败 8:违约现金行权")
    @TableField("HANDLESTATUS")
    private Integer handlestatus;

    @ApiModelProperty(value = "履约状态 - 1:未履约 2:履约中 3:履约完成")
    @TableField("PERFORMANCESTATUS")
    private Integer performancestatus;

    @ApiModelProperty(value = "买方处理状态 - 1:未处理 2:处理成功 3:处理失败")
    @TableField("BUYERHANDLESTATUS")
    private Integer buyerhandlestatus;

    @ApiModelProperty(value = "卖方处理状态 - 1:未处理 2:处理成功 3:处理失败")
    @TableField("SELLERHANDLESTATUS")
    private Integer sellerhandlestatus;

    @ApiModelProperty(value = "融货方处理状态 - 1:未处理 2:处理成功 3:处理失败")
    @TableField("MIDDLEHANDLESTATUS")
    private Integer middlehandlestatus;


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

}
