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


import com.gyee.wisdom.common.data.DataUtil;
import com.gyee.wisdom.common.data.alarm.ScadaBJ;
import com.gyee.wisdom.common.data.alarm.ScadaFault;
import com.gyee.wisdom.dao.alarm.ScadaBJDao;
import com.gyee.wisdom.dao.alarm.ScadaFaultDao;
import com.gyee.wisdom.dao.sql.alarm.repository.ScadaBJRepository;
import com.gyee.wisdom.dao.sql.alarm.repository.ScadaFaultRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class JpaScadaFaultDao implements ScadaFaultDao {
    @Autowired
    private ScadaFaultRepository scadaRepository;

    @Override
    public List<ScadaFault> findAll() {
        List<ScadaFault> result=DataUtil.convertDataList(scadaRepository.findAll());
        return result;
    }

    @Override
    public List<ScadaFault>  findByEnabled(boolean enbaled) {
        List<ScadaFault> result=DataUtil.convertDataList(scadaRepository.findByEnabled(enbaled));
        return result;
    }

    @Override
    public List<ScadaFault> getScadaFaultByCategory4Not(String c4) {
        return null;
    }


}
