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-08
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("GOODSOPTIONPROPERTY")
@ApiModel(value="Goodsoptionproperty对象", description="商品期权属性表")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Goodsoptionproperty extends Model<Goodsoptionproperty> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "商品ID(自增ID)")
    @TableId(value = "GOODSID")
    private Long goodsid;

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

    @ApiModelProperty(value = "价格取整系数(按小数位位数计算)")
    @TableField("PRICEFATOR")
    private Long pricefator;

    @ApiModelProperty(value = "档位间矩(按小数位位数计算)")
    @TableField("STEPVALUE")
    private Long stepvalue;

    @ApiModelProperty(value = "看涨向上档位 - 使用行情买五档，因此看涨向上档位+看涨向下档位 <=4")
    @TableField("CUPPRICEGEAR")
    private Integer cuppricegear;

    @ApiModelProperty(value = "看涨向下价格档位 - 使用行情买五档，因此看涨向上档位+看涨向下档位 <=4")
    @TableField("CDOWNPRICEGEAR")
    private Integer cdownpricegear;

    @ApiModelProperty(value = "看跌向上价格档位 - 行情卖五档，看跌向上档位+看跌向下档位 <=4")
    @TableField("PUPPRICEGEAR")
    private Integer puppricegear;

    @ApiModelProperty(value = "看跌向下价格档位 - 行情卖五档，看跌向上档位+看跌向下档位 <=4")
    @TableField("PDOWNPRICEGEAR")
    private Integer pdownpricegear;

    @ApiModelProperty(value = "行权日类型 - 1:滚动行权 2:固定日行权")
    @TableField("EXPIRETYPE")
    private Integer expiretype;

    @ApiModelProperty(value = "行权周期(天) -  1:滚动行权时填写")
    @TableField("EXPIRECYCLE")
    private Integer expirecycle;

    @ApiModelProperty(value = "行权日(yyyyMMdd) - 2:固定日行权时填写")
    @TableField("EXPIREDATE")
    private String expiredate;

    @ApiModelProperty(value = "是否限制可售数量 - 0:不限制 1:限制")
    @TableField("ISLIMITED")
    private Integer islimited;

    @ApiModelProperty(value = "赔付上限方式 - 1:不限 2:权利金倍数[为2时，委托、成交按赔付上限冻结]")
    @TableField("PAYMODE")
    private Integer paymode;

    @ApiModelProperty(value = "赔付权利金倍数 [方式为2时可设，可为0]")
    @TableField("PAYVALUE")
    private Integer payvalue;

    @ApiModelProperty(value = "权利金自动方式 - 1:比率 2.固定")
    @TableField("PREMIUMAUTOMODE")
    private Integer premiumautomode;

    @ApiModelProperty(value = "权利金自动值 [与商品报价币种一致]")
    @TableField("PREMIUMAUTOVALUE")
    private BigDecimal premiumautovalue;

    @ApiModelProperty(value = "[期权、挂牌期权]发货方式 - 1:发货商品(中远) 2:融货方(烟台)")
    @TableField("SHIPPINGMODE")
    private Integer shippingmode;

    @ApiModelProperty(value = "融货方ID - ShippingMode=2时设置")
    @TableField("MIDDLEUSERID")
    private Long middleuserid;

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

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

    @ApiModelProperty(value = "行权类型-1:欧式期权 2:美式期权")
    @TableField("EXERCISETYPE")
    private Integer exercisetype;

    @ApiModelProperty(value = "权利金小数位[场外期权]")
    @TableField("PREMIUMDECIMALPLACE")
    private Integer premiumdecimalplace;

    @ApiModelProperty(value = "权利金点差方式[场外期权]  1:比率  2:固定")
    @TableField("PREMIUMSPREADALGORITHM")
    private Integer premiumspreadalgorithm;

    @ApiModelProperty(value = "权利金点差值[场外期权]")
    @TableField("PREMIUMSPREADVALUE")
    private BigDecimal premiumspreadvalue;

    @ApiModelProperty(value = "标的物代码")
    @TableField("TARGETCODE")
    private String targetcode;


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

}
