package com.muchinfo.mtp3pojos.entity;

import com.baomidou.mybatisplus.annotation.*;
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;
import java.util.Date;

/**
 * <p>
 * 商品组表\期货品种表(通道交易\场外期权)
 * </p>
 *
 * @author XKF
 * @since 2025-08-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("GOODSGROUP")
@ApiModel(value="Goodsgroup对象", description="商品组表期货品种表(通道交易场外期权)")
@KeySequence(value = "SEQ_GOODSGROUP")
public class Goodsgroup extends Model<Goodsgroup> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "期货品种ID(自增ID)")
    @TableId(value = "GOODSGROUPID", type = IdType.INPUT)
    private Long goodsgroupid;

    @ApiModelProperty(value = "期货品种名称")
    @TableField("GOODSGROUPNAME")
    private String goodsgroupname;

    @ApiModelProperty(value = "期货品种状态 - 1:正常 2:注销")
    @TableField("GOODSGROUPSTATUS")
    private Integer goodsgroupstatus;

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

    @ApiModelProperty(value = "创建时间")
    @TableField("CREATETIME")
    private Date createtime;

    @ApiModelProperty(value = "创建人")
    @TableField("CREATORID")
    private Long creatorid;

    @ApiModelProperty(value = "修改时间")
    @TableField("MODIFYTIME")
    private Date modifytime;

    @ApiModelProperty(value = "修改人")
    @TableField("MODIFIERID")
    private Long modifierid;

    @ApiModelProperty(value = "所属行情源分组ID[参考行情市场用通道交易]")
    @TableField("QUOTESOURCEGROUPID")
    private Long quotesourcegroupid;

    @ApiModelProperty(value = "外部商品组代码[通道交易]")
    @TableField("OUTERGROUPCODE")
    private String outergroupcode;

    @ApiModelProperty(value = "是否允许做空[通道交易] - 0:不能做空 1:可以做空")
    @TableField("CANSHORT")
    private Integer canshort;

    @ApiModelProperty(value = "外部交易所ID[通道交易]")
    @TableField("EXEXCHANGEID")
    private Long exexchangeid;

    @ApiModelProperty(value = "报价货币ID")
    @TableField("CURRENCYID")
    private Long currencyid;

    @ApiModelProperty(value = "期货种单位ID")
    @TableField("GOODUNITID")
    private Long goodunitid;

    @ApiModelProperty(value = "合约单位")
    @TableField("AGREEUNIT")
    private BigDecimal agreeunit;

    @ApiModelProperty(value = "报价小数位")
    @TableField("DECIMALPLACE")
    private Integer decimalplace;

    @ApiModelProperty(value = "行情最小变动单位 [整数，报价小数位一起使用]")
    @TableField("QUOTEMINUNIT")
    private Long quoteminunit;

    @ApiModelProperty(value = "内部成交方式[通道交易] - 1:净头寸 2:开平 3:平今")
    @TableField("INNERDEALMODE")
    private Integer innerdealmode;

    @ApiModelProperty(value = "外部成交方式[通道交易]- 1:净头寸 2:开平 3:平今")
    @TableField("OUTERDEALMODE")
    private Integer outerdealmode;

    @ApiModelProperty(value = "同步合约数[通道交易-投资管理用] - 0表示不限")
    @TableField("SYNCGOODSQTY")
    private Integer syncgoodsqty;

    @ApiModelProperty(value = "强平价格方式 - 1:市价 2:最新价 3:涨跌停（未实现）")
    @TableField("CLOSEPRICEMODE")
    private Integer closepricemode;

    @ApiModelProperty(value = "强平最新价浮动比例 - 方式为2时使用")
    @TableField("CLOSEPRICEPARAM")
    private BigDecimal closepriceparam;

    @ApiModelProperty(value = "成交量小数位")
    @TableField("QTYDECIMALPLACE")
    private Integer qtydecimalplace;

    @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 = "是否限制建仓量 - 0:不限制 1:限制")
    @TableField("ISBUYLIMITED")
    private Integer isbuylimited;

    @ApiModelProperty(value = "行情档位(1-10)")
    @TableField("QUOTEGEAR")
    private Integer quotegear;

    @ApiModelProperty(value = "报价商ID[场外期权]")
    @TableField("QUOTERID")
    private Long quoterid;

    @ApiModelProperty(value = "品种分类ID")
    @TableField("GROUPCATEGROYID")
    private Long groupcategroyid;

    @ApiModelProperty(value = "所属机构")
    @TableField("AREAUSERID")
    private Long areauserid;

    @ApiModelProperty(value = "主力合约ID")
    @TableField("MAINGOODSID")
    private Long maingoodsid;

    @ApiModelProperty(value = "缩略图片(1:1)(逗号分隔)")
    @TableField("THUMURLS")
    private String thumurls;


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

}
