This commit is contained in:
@@ -90,9 +90,18 @@ public class ViolationService {
|
||||
cb.between(root.get("createdDate"), startDate, endDate));
|
||||
}
|
||||
|
||||
List<String> allStatuses = Arrays.asList(
|
||||
"NEW", "SHOWED", "LEGAL_IN_WORK",
|
||||
"COMPLAINT_IN_WORK", "COMPLAINT_AND_LEGAL_IN_WORK",
|
||||
"AUTHORIZED_USE"
|
||||
);
|
||||
|
||||
if (status != null && !status.isEmpty()) {
|
||||
spec = spec.and((root, query, cb) ->
|
||||
cb.equal(root.get("status"), status));
|
||||
} else {
|
||||
spec = spec.and((root, query, cb) ->
|
||||
root.get("status").in(allStatuses));
|
||||
}
|
||||
|
||||
Sort sort = Sort.by("ASC".equalsIgnoreCase(sortDirection) ?
|
||||
|
||||
Reference in New Issue
Block a user