Commit 840419e4 by Javier Ferreira

filtro personas con experencia mayor a un año

parent 4b088c46
package com.roshka.controller; package com.roshka.controller;
import java.util.List;
import javax.validation.ConstraintViolationException; import javax.validation.ConstraintViolationException;
import com.roshka.modelo.Disponibilidad; import com.roshka.modelo.Disponibilidad;
...@@ -18,6 +20,8 @@ import org.springframework.web.bind.MethodArgumentNotValidException; ...@@ -18,6 +20,8 @@ import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@Controller @Controller
public class PostulanteController { public class PostulanteController {
@Autowired @Autowired
...@@ -28,7 +32,12 @@ public class PostulanteController { ...@@ -28,7 +32,12 @@ public class PostulanteController {
@RequestMapping("/") @RequestMapping("/")
public String index() { public String index() {
return "index"; List<Postulante> j= post.personasConExperienciaMayor(30);
for (Postulante postulante : j) {
System.out.println(postulante.getNombre());
}
return "index";
} }
@RequestMapping("/postulante") @RequestMapping("/postulante")
......
...@@ -16,6 +16,5 @@ public interface PostulanteRepository extends JpaRepository<Postulante,Long> { ...@@ -16,6 +16,5 @@ public interface PostulanteRepository extends JpaRepository<Postulante,Long> {
"group by p.id" + "group by p.id" +
"having sum(fecha_hasta-fecha_desde)>?1 * INTERVAL '1' month", "having sum(fecha_hasta-fecha_desde)>?1 * INTERVAL '1' month",
nativeQuery = true ) nativeQuery = true )
public List<Postulante> personasConExperienciaMayor(long meses); public List<Postulante> personasConExperienciaMayor(long meses);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment