package com.sysview.docauto.service.impl;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sysview.docauto.dao.BibliotecaDAO;
import com.sysview.docauto.dao.ClaseDAO;
import com.sysview.docauto.dao.PlataformaDAO;
import com.sysview.docauto.dao.SistemaDAO;
import com.sysview.docauto.model.Filter;
import com.sysview.docauto.service.FilterService;


@Service("filterService")
public class FilterServiceImpl implements FilterService {
	@Autowired PlataformaDAO plataformaDao;
	@Autowired SistemaDAO sistemaDao;
	@Autowired ClaseDAO claseDao;
	@Autowired BibliotecaDAO bibliotecaDao;
	
	private static final Logger log = LoggerFactory.getLogger(FilterServiceImpl.class);
	    
	@Override
	public Filter filterBySistema(String sistemaId){
		 
        Filter filter = new Filter();
        filter.setPlataformas(plataformaDao.filterBySistemas(sistemaId)); 
        filter.setBibliotecas(bibliotecaDao.filterBySistema(sistemaId)); 
        filter.setClases(claseDao.filterBySistema(sistemaId)); 
        return filter;
    }
	
	@Override
	public Filter filterByClase(String claseId){
		 
        Filter filter = new Filter();
        filter.setPlataformas(plataformaDao.filterByClase(claseId)); 
        filter.setSistemas(sistemaDao.filterByClase(claseId)); 
        filter.setBibliotecas(bibliotecaDao.filterByClase(claseId)); 
        return filter;
    }
	
	@Override
	public Filter filterByBiblioteca(String bibliotecaId){
		 
        Filter filter = new Filter();
        filter.setPlataformas(plataformaDao.filterByBiblioteca(bibliotecaId)); 
        filter.setSistemas(bibliotecaDao.filterByBiblioteca(bibliotecaId)); 
        filter.setClases(claseDao.filterByBiblioteca(bibliotecaId));
        return filter;
    }
	
	@Override
	public Filter filterByPlataforma(String plataformaId){
		
		Filter filter = new Filter();
        filter.setPlataformas(plataformaDao.filterByBiblioteca(plataformaId)); 
        filter.setSistemas(sistemaDao.filterByBiblioteca(plataformaId)); 
        filter.setClases(claseDao.filterByBiblioteca(plataformaId));
        return filter;
	}

	@Override
	public void initialize() {
		// TODO Auto-generated method stub
		
	}
}

@@ -1719,25 +1719,22 @@
 istemas(
-bibliotec
+sistem
 aDao.fil
@@ -1938,12 +1938,12 @@
 )%7B%0A%09
-%09%0A%09%09
+    
 Filt
@@ -1960,36 +1960,33 @@
 = new Filter();%0A
-    
+%09
     filter.setPl
@@ -1983,37 +1983,37 @@
 lter.set
-Plataformas(plataform
+Bibliotecas(bibliotec
 aDao.fil
@@ -2013,33 +2013,33 @@
 Dao.filterBy
-Bibliotec
+Plataform
 a(plataforma
@@ -2037,36 +2037,33 @@
 lataformaId)); %0A
-    
+%09
     filter.setSi
@@ -2084,33 +2084,33 @@
 Dao.filterBy
-Bibliotec
+Plataform
 a(plataforma
@@ -2108,36 +2108,33 @@
 lataformaId)); %0A
-    
+%09
     filter.setCl
@@ -2155,25 +2155,25 @@
 filterBy
-Bibliotec
+Plataform
 a(plataf
@@ -2178,24 +2178,28 @@
 aformaId));%0A
+    
         retu

fix FilterServiceImpl.filterByPlataforma