package com.gyee.runeconomy.service.base;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gyee.common.model.StringUtils;
import com.gyee.common.util.DateUtils;
import com.gyee.runeconomy.model.auto.ProBasicEquipment;
import com.gyee.runeconomy.model.auto.ProEconEquipmentInfoDay1;
import com.gyee.runeconomy.model.vo.LossPowerVo;
import com.gyee.runeconomy.service.auto.IProBasicEquipmentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.stream.Collectors;


@Slf4j
@Service
public class WindInfoService {

    @Resource
    private IProBasicEquipmentService equipmentService;

    public Map<String, Object> windsPosition(String wpids) {
        Map<String, Object> promise = null;
        try{
            promise = new HashMap<>();

            QueryWrapper<ProBasicEquipment> qw=new QueryWrapper<>();

            if (StringUtils.isNotEmpty(wpids)) {
                List<String> wpList = Arrays.asList(wpids.split(","));
                qw.in("id", wpList);
            }

            //风机表
            List<ProBasicEquipment> equipmentList = equipmentService.list(qw);

            promise.put("data", equipmentList);
        } catch (Exception e) {
            e.printStackTrace();
        }

        return promise;
    }
}
