package app.repositories; import app.entities.report.Report; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.data.repository.query.Param; public interface ReportRepository extends PagingAndSortingRepository { @Query(value = "select r from Report r where " + "(:authors_ne = true or position(r.a_steam2 in :authors) > 0) and " + "(:reportes_ne = true or position(r.r_steam2 in :reportes) > 0) and " + "(:begin_date is null or r.utime >= :begin_date) and " + "(:end_date is null or :end_date >= r.utime) and " + "(:server_id is null or r.srv like :server_id) order by r.id desc" ) Page getReports(Pageable pageable, @Param("authors_ne") boolean authors_ne,//a @Param("authors") String authors, @Param("reportes_ne") boolean reportes_ne,//r @Param("reportes") String reportes, // @Param("server_id") String server_id, @Param(value = "begin_date") Long begin_date, @Param(value = "end_date") Long end_date); }