package com.jeequan.jeepay.db.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jeequan.jeepay.core.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * <p>
 * 钱包流水表
 * </p>
 *
 * @author [mybatis plus generator]
 * @since 2022-03-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_info_account_history")
public class InfoAccountHistory extends BaseModel  {


    public static final LambdaQueryWrapper<InfoAccountHistory> gw(){
        return new LambdaQueryWrapper<>();
    }

    /** 变更账户类型： 1-钱包账户, 2-在途账户 **/
    public static final byte OP_ACCOUNT_TYPE_BALANCE = 1;
    public static final byte OP_ACCOUNT_TYPE_AUDIT_PROFIT = 2;

    /**
     * 关联订单类型： 1-支付订单号, 2-退款订单号, 3-提现单号, 4-转账单号
     **/
    public static final byte ORDER_TYPE_PAY = 1;
    public static final byte ORDER_TYPE_REFUND = 2;
    public static final byte ORDER_TYPE_CASHOUT = 3;
    public static final byte ORDER_TYPE_TRANSFER = 4;


    /** 业务类型： 1-订单佣金计算, 2-退款轧差, 3-佣金提现, 4-人工调账 **/
    public static final byte BIZ_TYPE_PAY = 1;
    public static final byte BIZ_TYPE_REFUND = 2;
    public static final byte BIZ_TYPE_CASHOUT = 3;
    public static final byte BIZ_TYPE_PLATFORM_CHANGE = 4;

    private static final long serialVersionUID=1L;

    /**
     * 记录ID
     */
    @TableId(value = "hid", type = IdType.AUTO)
    private Long hid;

    /**
     * 运营平台标识/服务商号
     */
    private String infoId;

    /**
     * 系统类型： 参考：SYS_TYPE
     */
    private String infoType;

    /**
     * 名称快照
     */
    private String infoName;

    /**
     * 变更账户类型： 1-钱包账户, 2-在途账户
     */
    private Byte opAccountType;

    /**
     * 变动前账户余额, 单位：分
     */
    private Long opBeforeAmount;

    /**
     * 变动金额, 单位：分
     */
    private Long opAmount;

    /**
     * 变动后账户余额, 单位：分
     */
    private Long opAfterAmount;

    /**
     * 业务类型： 1-订单佣金计算, 2-退款轧差, 3-佣金提现
     */
    private Byte bizType;

    /**
     * 关联订单类型： 1-支付订单号, 2-退款订单号, 3-提现单号, 4-转账单号
     */
    private Byte relaBizOrderType;

    /**
     * 关联订单号
     */
    private String relaBizOrderId;

    /**
     * 关联结算记录ID
     */
    private Long settId;

    /**
     * 备注
     */
    private String remark;

    /**
     * 创建时间
     */
    private Date createdAt;

    /**
     * 更新时间
     */
    private Date updatedAt;


}
