package com.m2pool.lease.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.m2pool.lease.dto.MachinePayTypeDto;
import com.m2pool.lease.entity.LeaseMachinePrice;
import com.m2pool.lease.entity.LeaseProductMachinePrice;
import com.m2pool.lease.vo.OrderInfoVo;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 商品表对应的物品机器表 Mapper 接口
 * </p>
 *
 * @author yyb
 * @since 2025-11-25
 */
@Mapper
public interface LeaseMachinePriceMapper extends BaseMapper<LeaseMachinePrice> {
    /**
     * 获取机器价格通过id
     * @param machineIds
     * @return
     */
    List<MachinePayTypeDto> getMachinePriceByMachineIds(@Param("list") List<Long> machineIds);


    /**
     * 获取订单总金额 按照chain 和 分组 coin  -v2
     * @param orderInfoVoList
     * @return
     */
    @MapKey("machineId")
    Map<Long, LeaseMachinePrice> getOrderTotalPriceGroupByChainAndCoin(@Param("list") List<OrderInfoVo> orderInfoVoList);

}
