package es.uv.saic.domain;


import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface InformeRepository extends JpaRepository<Informe, Integer> {
	
	@Query(value=("SELECT * FROM informes WHERE grup_web = ?1 ORDER BY ordre ASC"), nativeQuery=true)
	public List<Informe> findByGrupWeb(String grupWeb);
	
	@Query(value=("SELECT * FROM informes WHERE grup_web = ?1 AND tambit IN('A', ?2) ORDER BY ordre ASC"), nativeQuery=true)
	public List<Informe> findByGrupWebTambit(String grupWeb, String tambit);
	
	@Query(value=("SELECT * FROM informes WHERE NOT combinat ORDER BY ordre ASC"), nativeQuery=true)
	public List<Informe> getNonCombined();
}

