package com.m2pool.lease.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.m2pool.lease.dto.v2.CoinAndAlgorithmDto;
import com.m2pool.lease.entity.LeaseGpuConfig;
import com.m2pool.lease.netty.message.GpuMessage;
import com.m2pool.lease.task.info.BlockInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;

/**
 * <p>
 * GPU对应币种挖矿算力(只要gpu类型相同那么就使用这个配置) Mapper 接口
 * </p>
 *
 * @author yyb
 * @since 2025-11-27
 */
@Mapper
public interface LeaseGpuConfigMapper extends BaseMapper<LeaseGpuConfig> {
    /**
     * 批量插入或更新
     * @param gpuMessages
     * @return
     */
    int insertOrUpdateBatchByGpuInfo(@Param("list") List<CoinAndAlgorithmDto> gpuMessages);

    /**
     * 通过实体类批量插入或更新
     * @param leaseGpuConfigs
     * @return
     */
    int insertOrUpdateBatchByEntity(@Param("list") List<LeaseGpuConfig> leaseGpuConfigs);

}
