betweendateWithFilter
betweendateWithFilter
Permite hacer multiples filtros con las fechas
public String betweenDateWithFiter(String type) {
try {
filterToString =
"("
+ rf.getMessage("filter.desde")
+ DateUtil.isoDateToString(startDate)
+ rf.getMessage("filter.hasta")
+ DateUtil.isoDateToString(endDate)
+ ")";
switch (type) {
case "user":
filterToString +=
" "
+ rf.getMessage("filter.and")
+ " "
+ rf.getMessage("filter.colaborador")
+ " "
+ rf.getMessage("filter.eq")
+ " "
+ userSelected.getName();
boletasList =
boletasServices.betweendateWithFilter(
"fechainicial",
DateUtil.isoDateToString(startDate),
"fechafinal",
DateUtil.isoDateToString(endDate),
"user.username",
userSelected.getUsername(),
"String");
break;
case "departament":
filterToString +=
" "
+ rf.getMessage("filter.and")
+ " "
+ rf.getMessage("filter.departamento")
+ " "
+ rf.getMessage("filter.eq")
+ " "
+ departamentSelected.getDepartament();
boletasList =
boletasServices.betweendateWithFilter(
"fechainicial",
DateUtil.isoDateToString(startDate),
"fechafinal",
DateUtil.isoDateToString(endDate),
"departament.iddepartament",
departamentSelected.getIddepartament().toString(),
"Integer");
case "captadoensistemaaistencia":
String value = "false";
if (captadoensistemaaistenciaSelected) {
value = "true";
}
filterToString +=
" "
+ rf.getMessage("filter.and")
+ " "
+ rf.getMessage("filter.captadoensistemaaistencia")
+ " "
+ rf.getMessage("filter.eq")
+ " "
+ value;
boletasList =
boletasServices.betweendateWithFilter(
"fechainicial",
DateUtil.isoDateToString(startDate),
"fechafinal",
DateUtil.isoDateToString(endDate),
"captadoensistemaaistencia",
value,
"Boolean");
break;
}
if (boletasList == null || boletasList.isEmpty()) {
JsfUtil.successMessage(rf.getMessage("warning.nohayboletasentrefechas"));
}
boletasDataModel = new BoletasDataModel(boletasList);
} catch (Exception e) {
JsfUtil.errorDialog(JsfUtil.nameOfMethod(), e.getLocalizedMessage());
}
return "";
}
// </editor-fold>
PreviousBusqueda entre Fechas filterBetweenDate()/filterBetweenDateWithoutHours()NextBúsquedas por Día filterDayWithoutHour()
Last updated
Was this helpful?