package com.m2pool.lease.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.m2pool.common.datasource.annotation.HashRateDB;
import com.m2pool.lease.dto.ProductMachineDto;
import com.m2pool.lease.entity.LeaseNexaMachinePower;
import com.m2pool.lease.entity.LeaseProductMachine;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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

/**
 * <p>
 * 已售商品矿工实时算力表 Mapper 接口
 * </p>
 *
 * @author yyb
 * @since 2025-07-25
 */
@Mapper
public interface LeaseNexaMachinePowerMapper extends BaseMapper<LeaseNexaMachinePower> {

    /**
     * 获取指定时间段内指定表内指定矿工的实时算力
     * @param leaseProductMachines
     * @param pointDate
     * @param tableName
     * @return
     */
    @HashRateDB
    List<LeaseNexaMachinePower> getMachinePowerInHashRateById(@Param("leaseProductMachines") List<LeaseProductMachine> leaseProductMachines, @Param("pointDate")Date pointDate, @Param("tableName") String tableName);

    /**
     * 获取3天内算力总和
     * @param leaseProductMachines
     * @param coin
     * @return
     */
    @HashRateDB
    List<ProductMachineDto> getMachineThreePower(@Param("leaseProductMachines") List<LeaseProductMachine> leaseProductMachines, @Param("coin") String coin);


}
