package com.jeequan.jeepay.db.entity;

import com.baomidou.mybatisplus.annotation.TableField;
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 com.jeequan.jeepay.core.model.applyment.MchModifyApplymentModel;
import com.jeequan.jeepay.db.typehandler.EncryptTypeHandler;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 特约商户进件信息表
 * </p>
 *
 * @author [mybatis plus generator]
 * @since 2023-12-05
 */
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName(value = "t_mch_modify_applyment", autoResultMap = true)
public class MchModifyApplymentEntity extends BaseModel {

    /**
     * 商户变更系统申请单号
     */
    @TableId
    private String modifyApplyId;

    /**
     * 系统申请单号/进件商户号
     */
    private String applyId;

    /**
     * 渠道申请单号
     */
    private String channelApplyNo;

    /**
     * 通道商户号，收单机构编号
     */
    private String channelMchNo;

    /**
     * 商户号
     */
    private String mchNo;

    /**
     * 支付接口代码, 字段冗余
     */
    private String ifCode;

    /**
     * 接口名称, 字段冗余方便检索
     */
    private String ifName;

    /**
     * 商户本次变更前的数据（JSON类型）
     */
    @TableField(typeHandler = EncryptTypeHandler.class)
    private String originDetailInfo;

    /**
     * 商户变更详细信息（JSON类型）
     */
    @TableField(typeHandler = EncryptTypeHandler.class)
    private String applyDetailInfo;

    /**
     * 1、基本资料变更; 2、结算信息变更; 3、费率信息变更; 4、身份信息补充; 5、通用变更(待定)
     */
    private Byte modifyApplyType;

    private Byte state;

    private String remark;

    private String remainStep;

    /**
     * 上游接口返回参数
     */
    private String channelVar1;

    private String applyErrorInfo;

    private String applyPageType;

    private Long createdUid;

    private String createdBy;
    /**
     * 变更类型，1: 本地变更； 2: 变更并同步到上游通道;有值则代表是运营端或者服务商端代变更的数据
     */
    private String otherOperationType;

    private Date createdAt;

    private Date updatedAt;
    @TableField(exist = false)
    private Date firstDate;

    @TableField(exist = false)
    private Date lastDate;

    @TableField(exist = false)
    private String unionSearchId;

    @TableField(exist = false)
    private String mchFullName;

    @TableField(exist = false)
    private String mchUserName;

    @TableField(exist = false)
    private String agentName;


    @TableField(exist = false)
    private String agentNo;

    @TableField(exist = false)
    private Byte merchantType;

    @TableField(exist = false)
    private Long epUserId;

    @TableField(exist = false)
    private MchModifyApplymentModel modifyModel;

    @TableField(exist = false)
    private String mchShortName;

    @TableField(exist = false)
    private List<String> mchInfoList;

    public static LambdaQueryWrapper<MchModifyApplymentEntity> gw(MchModifyApplymentEntity modifyApplyment) {
        return new LambdaQueryWrapper<>(modifyApplyment);
    }

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