package com.m2pool.lease.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.m2pool.common.datasource.annotation.Pool2DB;
import com.m2pool.lease.dto.*;
import com.m2pool.lease.entity.LeaseOrderItem;
import com.m2pool.lease.entity.LeaseProductMachine;
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-07-23
 */
@Mapper
public interface LeaseProductMachinePriceMapper extends BaseMapper<LeaseProductMachinePrice> {

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


    /**
     * 获取机器价格通过id
     * @param machineIds
     * @return
     */
   List<MachinePayTypeDto> getMachinePriceByMachineIds(@Param("list") List<Long> machineIds);

    @MapKey("productMachineId")
    Map<Long,LeaseProductMachinePrice> getPriceByOrderItems(@Param("list") List<LeaseOrderItem> orderInfoVoList);
}
