package com.muchinfo.mtp3pojos.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.muchinfo.mtp3pojos.vo.investor.FeesConfigVo;
import com.muchinfo.mtp3pojos.vo.investor.RulesConfigVo;
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;
import java.util.List;

/**
 * <p>
 * 账户交易参数配置表
 * </p>
 *
 * @author XKF
 * @since 2024-09-10
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("ACCOUNTTRADECONFIG")
@ApiModel(value="Accounttradeconfig对象", description="账户交易参数配置表")
@KeySequence(value = "SEQ_ACCOUNTTRADECONFIG")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Accounttradeconfig extends Model<Accounttradeconfig> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "自增ID")
    @TableId(value = "AUTOID", type = IdType.INPUT)
    private Long autoid;

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

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

    @ApiModelProperty(value = "所属会员ID")
    @TableField("MEMBERUSERID")
    private Long memberuserid;

    @ApiModelProperty(value = "商品ID")
    @TableField("GOODSID")
    private Long goodsid;

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

    @ApiModelProperty(value = "参数类型 -1.保证金类 2.交易规则 3.交易费用")
    @TableField("RULETYPE")
    private Integer ruletype;

    @ApiModelProperty(value = "个性化参数ID - 1. 参照交易模式规则费用对应-参考表 可个性化类型 2.保证金类保存交易所创建的投资者客户类别ID")
    @TableField("PARAMID")
    private Integer paramid;

    @ApiModelProperty(value = "费用算法 - 1：比率 2：固定")
    @TableField("FEEALGORITHM")
    private Integer feealgorithm;

    @ApiModelProperty(value = "参数值(保证金类此项为空)")
    @TableField("PARAMVALUE")
    private BigDecimal paramvalue;

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

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

    @ApiModelProperty(value = "交易类型[交易费用] - 1:投资者自营 2:做市")
    @TableField("TRADETYPE")
    private Integer tradetype;

    @TableField(select = false)
    private String goodsname;

    @TableField(select = false)
    private String accountname;

    @TableField(select = false)
    private String marketname;

    @TableField(select = false)
    private List<RulesConfigVo> druleList;

    @TableField(select = false)
    private List<FeesConfigVo> dfeeList;

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

}
