From 4b088c467ece23bac5be764a9173bd65f973db7e Mon Sep 17 00:00:00 2001 From: Javier Ferreira Date: Thu, 4 Nov 2021 08:47:02 -0300 Subject: [PATCH] filtro personas con experencia mayor a un año --- curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteRepository.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteRepository.java b/curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteRepository.java index 5922701..c3ad942 100644 --- a/curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteRepository.java +++ b/curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteRepository.java @@ -11,4 +11,11 @@ public interface PostulanteRepository extends JpaRepository { @Query("select p from Postulante p join p.estudios e on e.institucion LIKE %?1%") public List findByInstitucionEstudio(String institucion); + @Query(value = "select p" + + "from postulante p join experiencia x on x.postulante_id= p.id" + + "group by p.id" + + "having sum(fecha_hasta-fecha_desde)>?1 * INTERVAL '1' month", + nativeQuery = true ) + public List personasConExperienciaMayor(long meses); + } -- libgit2 0.26.0