|
|
|
@ -28,15 +28,11 @@ public class AlumnoService implements IAlumno{
|
|
|
|
|
if(secondaryOption.equalsIgnoreCase("Todo")){
|
|
|
|
|
return findAllPaginated(pageNum, size, sortField, sortDir);
|
|
|
|
|
}else if (secondaryOption.equals("Apellido")) {
|
|
|
|
|
return alumnoRepository.findAlumnoByApellido(query, PageRequest.of(pageNum - 1, size, Sort.by(sortField).ascending()));
|
|
|
|
|
return alumnoRepository.findAlumnoByApellidos(query, PageRequest.of(pageNum - 1, size, Sort.by(sortField).ascending()));
|
|
|
|
|
} else if(secondaryOption.equals("Nombre")) {
|
|
|
|
|
return alumnoRepository.findAlumnoByNombre(query, PageRequest.of(pageNum - 1, size, Sort.by(sortField).ascending()));
|
|
|
|
|
}else if(secondaryOption.equals("Keywords")) {
|
|
|
|
|
return alumnoRepository.findAlumnoByKeywords(query, PageRequest.of(pageNum - 1, size, Sort.by(sortField).ascending()));
|
|
|
|
|
}else if(secondaryOption.equals("Nia")) {
|
|
|
|
|
return alumnoRepository.findAlumnoByNia(query, PageRequest.of(pageNum - 1, size, Sort.by(sortField).ascending()));
|
|
|
|
|
}else if(secondaryOption.equals("Dni")) {
|
|
|
|
|
return alumnoRepository.findAlumnoByDni(query, PageRequest.of(pageNum - 1, size, Sort.by(sortField).ascending()));
|
|
|
|
|
}else if(secondaryOption.equals("Ciclo")) {
|
|
|
|
|
return alumnoRepository.findAlumnoByCiclo(query, PageRequest.of(pageNum - 1, size, Sort.by(sortField).ascending()));
|
|
|
|
|
} else {
|
|
|
|
@ -49,8 +45,6 @@ public class AlumnoService implements IAlumno{
|
|
|
|
|
return alumnoRepository.findAll();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Alumno findById(Long id) {
|
|
|
|
|
return alumnoRepository.findById(id).orElse(null);
|
|
|
|
|