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;
import java.util.Date;

/**
 * <p>
 * 产能预售申请表
 * </p>
 *
 * @author XKF
 * @since 2025-06-13
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("CPTRADE_PRESALEAPPLY")
@ApiModel(value="CptradePresaleapply对象", description="产能预售申请表")
public class CptradePresaleapply extends Model<CptradePresaleapply> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "申请ID(181+Unix秒时间戳(10位)+xxxxxx)")
    @TableId(value = "APPLYID")
    private Long applyid;

    @ApiModelProperty(value = "申请人ID")
    @TableField("USERID")
    private Long userid;

    @ApiModelProperty(value = "申请人账户ID")
    @TableField("ACCOUNTID")
    private Long accountid;

    @ApiModelProperty(value = "商品代码 - 系统自动生成  [#B(2位) + ApplyID十六进制(6位) ]")
    @TableField("GOODSCODE")
    private String goodscode;

    @ApiModelProperty(value = "商品名称")
    @TableField("GOODSNAME")
    private String goodsname;

    @ApiModelProperty(value = "关联交易合约ID")
    @TableField("RELATEDGOODSID")
    private Long relatedgoodsid;

    @ApiModelProperty(value = "预售数量")
    @TableField("PRESALEQTY")
    private Long presaleqty;

    @ApiModelProperty(value = "预售开始时间")
    @TableField("STARTTIME")
    private Date starttime;

    @ApiModelProperty(value = "预售结束时间")
    @TableField("ENDTIME")
    private Date endtime;

    @ApiModelProperty(value = "缩略图片(1:1)")
    @TableField("ATTACHMENTURL")
    private String attachmenturl;

    @ApiModelProperty(value = "申请状态 - 1:已提交 2:初审通过 3:初审拒绝 4:初审失败 5复审通过 6:复审拒绝 7:复审失败 8:已撤销")
    @TableField("APPLYSTATUS")
    private Integer applystatus;

    @ApiModelProperty(value = "处理状态")
    @TableField("HANDLESTATUS")
    private Integer handlestatus;

    @ApiModelProperty(value = "申请时间")
    @TableField("APPLYTIME")
    private Date applytime;

    @ApiModelProperty(value = "申请备注")
    @TableField("APPLYREMARK")
    private String applyremark;

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

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

    @ApiModelProperty(value = "初审人")
    @TableField("FIRSTAUDITID")
    private Long firstauditid;

    @ApiModelProperty(value = "初审时间")
    @TableField("FIRSTAUDITTIME")
    private Date firstaudittime;

    @ApiModelProperty(value = "初审备注")
    @TableField("FIRSTREMARK")
    private String firstremark;

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

    @ApiModelProperty(value = "复审人")
    @TableField("SECONDAUDITID")
    private Long secondauditid;

    @ApiModelProperty(value = "复审时间")
    @TableField("SECONDAUDITTIME")
    private Date secondaudittime;

    @ApiModelProperty(value = "复审备注")
    @TableField("SECONDREMARK")
    private String secondremark;

    @ApiModelProperty(value = "客户端流水号")
    @TableField("CLIENTTICKET")
    private String clientticket;

    @ApiModelProperty(value = "交易日(yyyyMMdd)")
    @TableField("TRADEDATE")
    private String tradedate;

    @ApiModelProperty(value = "详情[大宗式竞拍41]")
    @TableField("GOODSDETAIL")
    private String goodsdetail;

    @ApiModelProperty(value = "预售模式 - 1:一口价(40) 2:大宗式竞拍(41) 3:预售挂牌(71) 4:定金预售(大宗)48 5:定金预售(中签)51 枚举'presalemode'")
    @TableField("PRESALEMODE")
    private Integer presalemode;

    @ApiModelProperty(value = "参考价单价[一口价40定金预售(中签)51]")
    @TableField("REFPRICE")
    private BigDecimal refprice;

    @ApiModelProperty(value = "起拍价[大宗式竞拍41，48]")
    @TableField("STARTPRICE")
    private BigDecimal startprice;

    @ApiModelProperty(value = "底价[大宗式竞拍41，48]")
    @TableField("FLOORPRICE")
    private BigDecimal floorprice;

    @ApiModelProperty(value = "所属商品组ID")
    @TableField("GOODSGROUPID")
    private Long goodsgroupid;

    @ApiModelProperty(value = "购买上限 [71] - 0为不限")
    @TableField("BUYMAXQTY")
    private Long buymaxqty;

    @ApiModelProperty(value = "预售定金方式(48) - 1：比例  2：固定")
    @TableField("PRESALEDEPOSITALGORITHM")
    private Integer presaledepositalgorithm;

    @ApiModelProperty(value = "预售定金设置值(48)")
    @TableField("PRESALEDEPOSITVALUE")
    private BigDecimal presaledepositvalue;

    @ApiModelProperty(value = "详情图片(逗号分隔)(宽：1125)")
    @TableField("PICTUREURLS")
    private String pictureurls;

    @ApiModelProperty(value = "Banner图(逗号分隔)(2:1)")
    @TableField("BANNERPICURL")
    private String bannerpicurl;

    @ApiModelProperty(value = "中签基数")
    @TableField("BASEQTY")
    private Long baseqty;

    @ApiModelProperty(value = "单人最大申购量")
    @TableField("MAXBUYQTY")
    private Long maxbuyqty;

    @TableField(select = false)
    private Date Listingdate;
    @TableField(select = false)
    private Date Lasttradedate;

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

}
