package com.gyee.wisdom.dao.sql.alarm;

import com.gyee.wisdom.common.data.DataUtil;
import com.gyee.wisdom.common.data.alarm.WindturbineTestingpointAi;
import com.gyee.wisdom.dao.alarm.WindturbinetestingpointAiDao;
import com.gyee.wisdom.dao.sql.alarm.repository.WindturbinetestingpointAiRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class JpaWindturbinetestingpointAiDao implements WindturbinetestingpointAiDao {

    @Autowired
    private WindturbinetestingpointAiRepository windturbinetestingpointAiRepository;

    @Override
    public List<WindturbineTestingpointAi> getWindturbinetestingpointAiByModelAndUniformcode(String model, String uniformcode) {
       return DataUtil.convertDataList(windturbinetestingpointAiRepository.getWindturbinetestingpointAiByModelAndUniformcode(model,uniformcode));
    }

    @Override
    public List<WindturbineTestingpointAi> getWindturbinetestingpointAiByModelAndUniformcodeIn(String model, String[] uniformcodes) {
        return DataUtil.convertDataList(windturbinetestingpointAiRepository.getWindturbinetestingpointAiByModelAndUniformcodeIn(model,uniformcodes));
    }
}
