package com.energy.manage.service.service.wavedic.impl;

import com.energy.manage.service.domain.vo.detectionpointdic.DetectionPointDicVo;
import com.energy.manage.service.mappers.detectionpointdic.DetectionPointDicMapper;
import com.energy.manage.service.mappers.windenginemill.WindEngineMillMapper;
import com.energy.manage.service.service.wavedic.WaveDicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * @author chy
 * @date 2024/11/21 09:28
 * @desc
 */
@Service
public class WaveDicServiceImpl implements WaveDicService {

    @Autowired
    private WindEngineMillMapper windEngineMillMapper;


    @Autowired
    private DetectionPointDicMapper detectionPointDicMapper;

    /**
     * 根据风机编号查询测点
     *
     * @param engineCodes
     * @return
     */
    @Override
    public Set<DetectionPointDicVo> queryWaveDic(List<String> engineCodes) {
        List<Integer> driveMode = windEngineMillMapper.selectCurvedMotionTypeByEngineCode(engineCodes);
        Set<DetectionPointDicVo> detectionPointDicVos = new HashSet<>();
        driveMode.stream().forEach(item-> detectionPointDicVos.addAll(detectionPointDicMapper.selectByCondition(item.toString())));
        return detectionPointDicVos;
    }
}
