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-26
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("DELIVERYRELATION")
@ApiModel(value="Deliveryrelation对象", description="商品交割关系表")
public class Deliveryrelation extends Model<Deliveryrelation> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "交易合约ID")
    @TableId(value = "GOODSID")
    private Long goodsid;

    @ApiModelProperty(value = "交割方式 - 1:点选式 2:申报式 3:无仓单申报式 4:线下交收 (枚举:deliveryMode)")
    @TableField("DELIVERYMODE")
    private Integer deliverymode;

    @ApiModelProperty(value = "现货商品ID")
    @TableField("WRSTANDARDID")
    private Long wrstandardid;

    @ApiModelProperty(value = "现货品种ID")
    @TableField("DELIVERYGOODSID")
    private Long deliverygoodsid;

    @ApiModelProperty(value = "最小交割系数(K)")
    @TableField("MINDELIVERYQTY")
    private Long mindeliveryqty;

    @ApiModelProperty(value = "兑换系数(交易合约)(R1)")
    @TableField("RRATIO1")
    private Long rratio1;

    @ApiModelProperty(value = "兑换系数(现货商品)(R2)")
    @TableField("RRATIO2")
    private Long rratio2;

    @ApiModelProperty(value = "交割价规则- 1:行情价 2:建仓价")
    @TableField("DELIVERYPRICERULE")
    private Integer deliverypricerule;

    @ApiModelProperty(value = "起始日期(yyyyMMdd)")
    @TableField("BEGINDATE")
    private String begindate;

    @ApiModelProperty(value = "结束日期(yyyyMMdd)")
    @TableField("ENDDATE")
    private String enddate;

    @ApiModelProperty(value = "买履约计划模板ID")
    @TableField("BUYTEMPLATEID")
    private Long buytemplateid;

    @ApiModelProperty(value = "卖履约计划模板ID")
    @TableField("SELLTEMPLATEID")
    private Long selltemplateid;

    @ApiModelProperty(value = "交割模式 - 1:X交割 2:X+P交割 3:X+C交割 4:X+P+C交割")
    @TableField("DELIVERYTYPE")
    private Integer deliverytype;

    @ApiModelProperty(value = "交易合约系数(m)")
    @TableField("XDELIVERYRATIO")
    private Long xdeliveryratio;

    @ApiModelProperty(value = "P合约价格方式 - 1:商品价  2:固定值")
    @TableField("PPRICEMODE")
    private Integer ppricemode;

    @ApiModelProperty(value = "P合约价格(商品价时填写0，固定值时填写固定值)")
    @TableField("PDELIVERYPRICE")
    private BigDecimal pdeliveryprice;

    @ApiModelProperty(value = "P合约系数(n)")
    @TableField("PDELIVERYRATIO")
    private Long pdeliveryratio;

    @ApiModelProperty(value = "P合约ID")
    @TableField("PGOODSID")
    private Long pgoodsid;

    @ApiModelProperty(value = "P2合约价格方式 - 1:商品价  2:固定值")
    @TableField("P2PRICEMODE")
    private Integer p2pricemode;

    @ApiModelProperty(value = "P2合约价格(商品价时填写0，固定值时填写固定值)")
    @TableField("P2DELIVERYPRICE")
    private BigDecimal p2deliveryprice;

    @ApiModelProperty(value = "P2合约系数(p)")
    @TableField("P2DELIVERYRATIO")
    private Long p2deliveryratio;

    @ApiModelProperty(value = "P2合约ID")
    @TableField("P2GOODSID")
    private Long p2goodsid;

    @ApiModelProperty(value = "兑换系数(R)")
    @TableField("RRATIO")
    private Long rratio;


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

}
