package cn.pluss.platform.mapper;

import cn.pluss.platform.entity.MerchantRateNewRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 商户费率表(新) Mapper 接口
 * </p>
 *
 * @author Djh
 * @since 2021-08-09
 */
public interface MerchantRateNewRecordMapper extends BaseMapper<MerchantRateNewRecord> {

    MerchantRateNewRecord selectLastExaminedDataByUserId(@Param("userId") String userId, @Param("channel") String channel);

    MerchantRateNewRecord selectLastExaminedDataByMerchantCode(@Param("merchantCode") String merchantCode, @Param("channel") String channel);

    MerchantRateNewRecord selectValidDataByMerchantCode(@Param("merchantCode") String merchantCode, @Param("channel") String channel);

    /**
     * 获取需要修改瑞银信费率的记录
     * <p>
     *     前一天的费率修改记录，第二天凌晨2点以后修改。
     *     所以这里只获取前一天的费率修改记录
     * </p>
     * @return 前一天的费率修改记录
     */
    List<MerchantRateNewRecord> selectRyxRateChangeList();

    List<MerchantRateNewRecord> selectSxfRateChangeList();
}
