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;

/**
 * <p>
 * 现货品种表
 * </p>
 *
 * @author XKF
 * @since 2024-08-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("DELIVERYGOODS")
@ApiModel(value="Deliverygoods对象", description="现货品种表")
@AllArgsConstructor
@NoArgsConstructor
@Builder
@KeySequence(value = "SEQ_DELIVERYGOODS")
public class Deliverygoods extends Model<Deliverygoods> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "现货品种ID(SEQ_DELIVERYGOODS)")
    @TableId(value = "DELIVERYGOODSID", type = IdType.INPUT)
    private Long deliverygoodsid;

    @ApiModelProperty(value = "现货品种代码")
    @TableField("DELIVERYGOODSCODE")
    private String deliverygoodscode;

    @ApiModelProperty(value = "现货品种名称")
    @TableField("DELIVERYGOODSNAME")
    private String deliverygoodsname;

    @ApiModelProperty(value = "现货品种单位ID")
    @TableField("GOODSUNITID")
    private Integer goodsunitid;

    @ApiModelProperty(value = "现货品种类型: 1-整装不拆分 2-散装记录明细 3:整装拆分 4:散装不记录明细")
    @TableField("DELIVERYGOODSTYPE")
    private Integer deliverygoodstype;

    @ApiModelProperty(value = "标准数量(库位数量) [标准品特有]")
    @TableField("STANDARDQTY")
    private Long standardqty;

    @ApiModelProperty(value = "标准数量偏差范围 [标准品特有]")
    @TableField("STANDARDQTYRANGE")
    private BigDecimal standardqtyrange;

    @ApiModelProperty(value = "交割是否需要审核 - 0:不需要 1:需要审核   默认为0")
    @TableField("AUDITFLAG")
    private Integer auditflag;

    @ApiModelProperty(value = "是否有效 - 0:无效 1:有效")
    @TableField("ISVALID")
    private Integer isvalid;

    @ApiModelProperty(value = "是否拆分 - 0:不拆分 1:拆分 [整装]   0:不记录明细 1:记录明细 [散货] - 作废整装时不拆分，则标准数量=合约单位；拆分时标准数量为合约单位的整数倍；整装时必须记录明细表数据 ")
    @TableField("ISSPLIT")
    private Integer issplit;

    @ApiModelProperty(value = "合约单位[散货时默认为1， 整装时默认为标准数量]")
    @TableField("AGREEUNIT")
    private Long agreeunit;

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

    @ApiModelProperty(value = "类别ID(SEQ_WRCATEGORY)")
    @TableField("CATEGORYID")
    private Long categoryid;

    @ApiModelProperty(value = "品种状态 - 作废 - 0:未激活 1:正常")
    @TableField("DGSTATUS")
    private Integer dgstatus;

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

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


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

}
