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

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

/**
 * <p>
 * 商品表\期货合约表
 * </p>
 *
 * @author XKF
 * @since 2024-07-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("GOODS")
@ApiModel(value="Goods对象", description="商品表期货合约表")
@AllArgsConstructor
@NoArgsConstructor
@Builder
@KeySequence(value = "SEQ_GOODS")
public class Goods extends Model<Goods> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "期货合约ID(自增ID SEQ_GOODS)")
    @TableId(value = "GOODSID",type=IdType.INPUT)
    private Long goodsid;

    @ApiModelProperty(value = "期货合约代码(内部)")
    @TableField("GOODSCODE")
    private String goodscode;

    @ApiModelProperty(value = "期货合约名称")
    @TableField("GOODSNAME")
    private String goodsname;

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

    @ApiModelProperty(value = "期货品种ID")
    @TableField("GOODSGROUPID")
    private Long goodsgroupid;

    @ApiModelProperty(value = "商品状态- 1:待审核 2:未上市 3:上市 4:已注销 5:审核拒绝 6:退市 7:待退市")
    @TableField("GOODSSTATUS")
    private Integer goodsstatus;

    @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("LISTINGDATE")
    private Date listingdate;

    @ApiModelProperty(value = "最后交易日期")
    @TableField("LASTTRADEDATE")
    private Date lasttradedate;

    @ApiModelProperty(value = "实际退市时间(状态：待退市, 预售一口价、预售大宗直接改为退市)")
    @TableField("DELISTINGDATE")
    private Date delistingdate;

    @ApiModelProperty(value = "交割标志 - 0:不可交割  1:可交割")
    @TableField("DELIVERYFLAG")
    private Integer deliveryflag;

    @ApiModelProperty(value = "是否有报价商 - 0:无报价商 1:有报价商")
    @TableField("HASQUOTER")
    private Integer hasquoter;

    @ApiModelProperty(value = "行情保护时间(秒)")
    @TableField("HQPROTECTTIME")
    private Long hqprotecttime;

    @ApiModelProperty(value = "行情报价类型: 1:成交价 2:买卖中间价 3:含买价 4:含卖价 做市模式固定为3:含买价")
    @TableField("QUOTESHOWTYPE")
    private Integer quoteshowtype;

    @ApiModelProperty(value = "行情报价间隔时间(秒)(成交价时为0)")
    @TableField("QUOTESHOWTYPEINTERVAL")
    private Long quoteshowtypeinterval;

    @ApiModelProperty(value = "变更状态 - 1:未变更 2:变更中 3:待审核 4:已审核")
    @TableField("MODIFYSTATUS")
    private Integer modifystatus;

    @ApiModelProperty(value = "商品交易权限类型 - 1:可建可平 2:可建不可平 3:不可建可平 4:不可建不可平")
    @TableField("GOODSTRADETYPE")
    private Integer goodstradetype;

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

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

    @ApiModelProperty(value = "审核操作员账号")
    @TableField("AUDITACCOUNTID")
    private Long auditaccountid;

    @ApiModelProperty(value = "审核时间")
    @TableField("AUDITTIME")
    private Date audittime;

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

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

    @ApiModelProperty(value = "注销操作员账号")
    @TableField("CANCELACCOUNTID")
    private Long cancelaccountid;

    @ApiModelProperty(value = "备注")
    @TableField("REMARK")
    private String remark;

    @ApiModelProperty(value = "注销时间")
    @TableField("CANCELTIME")
    private Date canceltime;

    @ApiModelProperty(value = "退市方式 - 1:退市平仓 2:退市交收 3:不处理(仅期权币币兑换) 4：退市发货（所有权）")
    @TableField("DELISTINGMODE")
    private Integer delistingmode;

    @ApiModelProperty(value = "定期强平方式 - 1:无 2:每日 3:每周 4:每月[收益权]")
    @TableField("FORCECLOSEMODE")
    private Integer forceclosemode;

    @ApiModelProperty(value = "定期强平参数 [收益权]")
    @TableField("FORCECLOSEVALUE")
    private BigDecimal forceclosevalue;

    @ApiModelProperty(value = "斩仓方式 - 1:不斩仓 2:自动斩仓 3:半自动斩仓")
    @TableField("CUTMODE")
    private Integer cutmode;

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

    @ApiModelProperty(value = "是否限制建仓量 - 0:不限制 1:限制")
    @TableField("ISBUYLIMITED")
    private Integer isbuylimited;

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

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

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

    @ApiModelProperty(value = "强平最新价浮动比例 - 方式为2时使用  (<1)买 上浮 (1+x)*最新价卖 下浮 (1-x)*最新价")
    @TableField("CLOSEPRICEPARAM")
    private BigDecimal closepriceparam;

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

    @ApiModelProperty(value = "合约货币ID")
    @TableField("GOODSCURRENCYID")
    private Long goodscurrencyid;

    @ApiModelProperty(value = "合约报价类型: 1-直接报价  2-间接报价")
    @TableField("GOODSQUOTETYPE")
    private Integer goodsquotetype;

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

    @ApiModelProperty(value = "期货合约代码(外部)")
    @TableField("OUTGOODSCODE")
    private String outgoodscode;

    @ApiModelProperty(value = "游客是否可见 - 0:不可见 1:可见")
    @TableField("ISVISIBLE")
    private Integer isvisible;

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

    @ApiModelProperty(value = "商品图片(逗号)")
    @TableField("PICTUREURL")
    private String pictureurl;

    @ApiModelProperty(value = "参考商品ID")
    @TableField("REFGOODSID")
    private Long refgoodsid;

    @ApiModelProperty(value = "掉期天数")
    @TableField("SWAPDAYS")
    private Long swapdays;

    @ApiModelProperty(value = "参考商品代码")
    @TableField("REFGOODSCODE")
    private String refgoodscode;

    @ApiModelProperty(value = "发售方用户ID(49)供货商(50)")
    @TableField("PROVIDERUSERID")
    private Long provideruserid;

    @ApiModelProperty(value = "发售方资金账户ID(49)供货商资金账户ID(50)")
    @TableField("PROVIDERACCOUNTID")
    private Long provideraccountid;

    @ApiModelProperty(value = "转让定金比例(49)持仓定金(52)")
    @TableField("TRANSFERDEPOSITRATIO")
    private BigDecimal transferdepositratio;

    @ApiModelProperty(value = "发售价订货价(49)")
    @TableField("PRESALEPRICE")
    private BigDecimal presaleprice;

    @ApiModelProperty(value = "发售标识(49) - 1:未预售 2：预售完成 3:预售申请中 4:预售中")
    @TableField("PRESALEFLAG")
    private Integer presaleflag;

    @ApiModelProperty(value = "转让定金比例(新)(49\52)")
    @TableField("NEWTRANSFERDEPOSITRATIO")
    private BigDecimal newtransferdepositratio;

    @ApiModelProperty(value = "持仓定金方式(49) - 1:比率 2.固定(52)")
    @TableField("MARGINALGORITHM")
    private Integer marginalgorithm;

    @TableField(select = false)
    private String providerusername;

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

}
