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

import com.jeesharp.business.modules.pay.payalipayconfig.entity.PayAlipayConfig;
import com.jeesharp.business.modules.pay.payalipayconfig.vo.PayAlipayConfigQueryVO;
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 PayAlipayConfigMapper extends BaseMapper<PayAlipayConfig, PayAlipayConfigQueryVO> {

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

    PayAlipayConfig findActivePlatform();

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

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

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

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