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

/**
 * <p>
 * 仓单贸易成交表(买、卖双方各一张) - 导历史
 * </p>
 *
 * @author XKF
 * @since 2024-08-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("WRTRADE_TRADEDETAIL")
@ApiModel(value="WrtradeTradedetail对象", description="仓单贸易成交表(买、卖双方各一张) - 导历史")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class WrtradeTradedetail extends Model<WrtradeTradedetail> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "仓单贸易成交单ID(321+Unix秒时间戳(10位)+xxxxxx)")
    private Long wrtradedetailid;

    @ApiModelProperty(value = "仓单贸易类型 - 1:挂牌 2:摘牌 3:提货卖(文化中国) 4:提货买(文化中国) 5:现货合同")
    @TableField("WRTRADETYPE")
    private Integer wrtradetype;

    @ApiModelProperty(value = "买卖 - 0:买 1:卖 ")
    @TableField("BUYORSELL")
    private Integer buyorsell;

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

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

    @ApiModelProperty(value = "委托单ID")
    @TableField("WRTRADEORDERID")
    private Long wrtradeorderid;

    @ApiModelProperty(value = "资金账号")
    @TableField("ACCOUNTID")
    private Long accountid;

    @ApiModelProperty(value = "关联仓单ID")
    @TableField("WRID")
    private Long wrid;

    @ApiModelProperty(value = "仓单要素类型ID/商品ID(77)")
    @TableField("WRFACTORTYPEID")
    private Long wrfactortypeid;

    @ApiModelProperty(value = "对手账号")
    @TableField("MATCHACCOUNTID")
    private Long matchaccountid;

    @ApiModelProperty(value = "成交时间")
    @TableField("TRADETIME")
    private Date tradetime;

    @ApiModelProperty(value = "成交价格")
    @TableField("TRADEPRICE")
    private BigDecimal tradeprice;

    @ApiModelProperty(value = "成交数量")
    @TableField("TRADEQTY")
    private BigDecimal tradeqty;

    @ApiModelProperty(value = "成交金额")
    @TableField("TRADEAMOUNT")
    private BigDecimal tradeamount;

    @ApiModelProperty(value = "实际成交数量(算上溢短)")
    @TableField("REALTRADEQTY")
    private BigDecimal realtradeqty;

    @ApiModelProperty(value = "实际成交金额(算上溢短)")
    @TableField("REALTRADEAMOUNT")
    private BigDecimal realtradeamount;

    @ApiModelProperty(value = "首付比率 - 作废")
    @TableField("FIRSTRATIO")
    private BigDecimal firstratio;

    @ApiModelProperty(value = "实际首付金额 - 作废")
    @TableField("REALFIRSTAMOUNT")
    private BigDecimal realfirstamount;

    @ApiModelProperty(value = "履约金额(实际成交金额 - 实际首付金额)")
    @TableField("PERFORMANCEAMOUNT")
    private BigDecimal performanceamount;

    @ApiModelProperty(value = "履约计划ID/合同ID")
    @TableField("PERFORMANCEPLANID")
    private Long performanceplanid;

    @ApiModelProperty(value = "仓单受让用户 -  买摘牌是自己   卖摘牌是对手 ")
    @TableField("WRTRANSFERUSERID")
    private Long wrtransferuserid;

    @ApiModelProperty(value = "处理状态 - 1:待处理 2:已处理 3:处理失败 4:履约完成")
    @TableField("HANDLESTATUS")
    private Integer handlestatus;

    @ApiModelProperty(value = "是否已结算 - 0:未结算 1:已结算")
    @TableField("ISRECKONED")
    private Integer isreckoned;

    @ApiModelProperty(value = "手续费")
    @TableField("CHARGEVALUE")
    private BigDecimal chargevalue;

    @ApiModelProperty(value = "手续费收取方式 1：比率  2：固定")
    @TableField("CHARGEALGORITHM")
    private Integer chargealgorithm;

    @ApiModelProperty(value = "手续费设置值(交易所部分)")
    @TableField("CHARGEALGORITHMVALUE")
    private BigDecimal chargealgorithmvalue;

    @ApiModelProperty(value = "手续费设置值(会员部分)")
    @TableField("CHARGEALGORITHMVALUE2")
    private BigDecimal chargealgorithmvalue2;

    @ApiModelProperty(value = "交货模式 - 1:履约计划 2:分步履约 3:分步提货[文昌]")
    @TableField("PERFORMANCEWAY")
    private Integer performanceway;

    @ApiModelProperty(value = "买方释放比率[2:分步履约]")
    @TableField("BUYRELEASERATIO")
    private BigDecimal buyreleaseratio;

    @ApiModelProperty(value = "卖方释放比率[2:分步履约]")
    @TableField("SELLRELEASERATIO")
    private BigDecimal sellreleaseratio;

    @ApiModelProperty(value = "执行方式[2:分步履约] - 1:顺序执行 2:交叉执行")
    @TableField("EXECUTEMODE")
    private Integer executemode;

    @ApiModelProperty(value = "执行方[2:分步履约] - 1:买方 2:卖方")
    @TableField("EXECUTESIDE")
    private Integer executeside;

    @ApiModelProperty(value = "最小执行量[2:分步履约]")
    @TableField("MINQTY")
    private Integer minqty;

    @ApiModelProperty(value = "合同期限[2:分步履约]")
    @TableField("HOLDDAYS")
    private Integer holddays;

    @ApiModelProperty(value = "冻结金额")
    @TableField("FREEZEAMOUNT")
    private BigDecimal freezeamount;

    @ApiModelProperty(value = "是否有仓单 - 0:无仓单 1:有仓单")
    @TableField("HASWR")
    private Integer haswr;

    @ApiModelProperty(value = "交收月(yyyy-MM) [无仓单HasWR =0]")
    @TableField("DELIVERYMONTH")
    private String deliverymonth;

    @ApiModelProperty(value = "成交金额[商品币种]")
    @TableField("ORITRADEAMOUNT")
    private BigDecimal oritradeamount;

    @ApiModelProperty(value = "汇率")
    @TableField("EXCHANGERATE")
    private BigDecimal exchangerate;

    @ApiModelProperty(value = "关联预售申请ID[47:仓单预售]")
    @TableField("PRESALEAPPLYID")
    private Long presaleapplyid;

    @ApiModelProperty(value = "用户ID")
    @TableField("USERID")
    private Long userid;


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

}
