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.dao.alarm.ScadaBJDao;
import com.gyee.wisdom.dao.sql.alarm.repository.ScadaBJRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class JpaScadaBJDao implements ScadaBJDao {
    @Autowired
    private ScadaBJRepository scadaBJRepository;

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

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



}
