package com.jeesharp.business.modules.pay.paypufaconfig.mapper;

import com.jeesharp.business.modules.pay.paypufaconfig.entity.PayPufaConfig;
import com.jeesharp.business.modules.pay.paypufaconfig.vo.PayPufaConfigQueryVO;
import com.jeesharp.framework.mybatis.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 浦发配置 Mapper。
 *
 * @author jeesharp
 * @since 2026-05-25
 */
@Mapper
public interface PayPufaConfigMapper extends BaseMapper<PayPufaConfig, PayPufaConfigQueryVO> {

    PayPufaConfig findActiveByTenantId(@Param("tenantId") String tenantId);

    PayPufaConfig findActivePlatform();

    PayPufaConfig findByConfigCode(@Param("configCode") String configCode);

    PayPufaConfig findByConfigCodeAndTenant(@Param("configCode") String configCode,
            @Param("tenantId") String tenantId);

    PayPufaConfig findByChannelConfigId(@Param("channelConfigId") String channelConfigId);

    int disableOtherActiveExcept(@Param("tenantId") String tenantId, @Param("keepId") String keepId,
            @Param("enabledStatus") Integer enabledStatus, @Param("disabledStatus") Integer disabledStatus);
}
