|
@@ -139,8 +139,6 @@ public class StudentSpecification extends PagingAndSortingSpecification {
|
|
|
List<Predicate> predicates = new ArrayList<Predicate>();
|
|
|
List<Predicate> listPermission = new ArrayList<>();
|
|
|
List<Predicate> listPermission1 = new ArrayList<>();
|
|
|
- List<Predicate> listPermission2 = new ArrayList<>();
|
|
|
- List<Predicate> listPermission3 = new ArrayList<>();
|
|
|
predicates.add(cb.equal(root.get("test"), String.valueOf(TrialEnum.DEFAULT.getId())));
|
|
|
if (!StringUtils.isEmpty(getStudentName())) {
|
|
|
predicates.add(cb.like(root.get("name"), "%" + getStudentName() + "%"));
|
|
@@ -156,17 +154,10 @@ public class StudentSpecification extends PagingAndSortingSpecification {
|
|
|
}
|
|
|
|
|
|
if ("ONE".equals(getSubject())) {
|
|
|
- listPermission1.add(cb.equal(root.get("scMissing"), true));
|
|
|
- listPermission1.add(cb.equal(root.get("sxMissing"), false));
|
|
|
- listPermission1.add(cb.equal(root.get("smMissing"), false));
|
|
|
+ listPermission1.add(cb.equal(root.get("uploadStatus"), "SX:1,SC:1,SM:0"));
|
|
|
+ listPermission1.add(cb.equal(root.get("uploadStatus"), "SX:1,SC:0,SM:1"));
|
|
|
+ listPermission1.add(cb.equal(root.get("uploadStatus"), "SX:0,SC:1,SM:1"));
|
|
|
|
|
|
- listPermission2.add(cb.equal(root.get("scMissing"), false));
|
|
|
- listPermission2.add(cb.equal(root.get("sxMissing"), true));
|
|
|
- listPermission2.add(cb.equal(root.get("smMissing"), false));
|
|
|
-
|
|
|
- listPermission3.add(cb.equal(root.get("scMissing"), false));
|
|
|
- listPermission3.add(cb.equal(root.get("sxMissing"), false));
|
|
|
- listPermission3.add(cb.equal(root.get("smMissing"), true));
|
|
|
} else {
|
|
|
if (getIsAbsent() != null) {
|
|
|
// predicates.add(cb.equal(root.get("isAbsent"), getIsAbsent()));
|
|
@@ -211,12 +202,9 @@ public class StudentSpecification extends PagingAndSortingSpecification {
|
|
|
}
|
|
|
Predicate Pre_And = cb.and(predicates.toArray(new Predicate[predicates.size()]));
|
|
|
if ("ONE".equals(getSubject())) {
|
|
|
- if (!CollectionUtils.isEmpty(listPermission1) && !CollectionUtils.isEmpty(listPermission2) && !CollectionUtils.isEmpty(listPermission3)) {
|
|
|
- Predicate Pre_Or1 = cb.and(listPermission1.toArray(new Predicate[listPermission1.size()]));
|
|
|
- Predicate Pre_Or2 = cb.and(listPermission2.toArray(new Predicate[listPermission2.size()]));
|
|
|
- Predicate Pre_Or3 = cb.and(listPermission3.toArray(new Predicate[listPermission3.size()]));
|
|
|
- Predicate preOrAll = cb.or(Pre_Or1, Pre_Or2, Pre_Or3);
|
|
|
- return query.where(Pre_And, preOrAll).getRestriction();
|
|
|
+ if (!CollectionUtils.isEmpty(listPermission1)) {
|
|
|
+ Predicate Pre_Or1 = cb.or(listPermission1.toArray(new Predicate[listPermission1.size()]));
|
|
|
+ return query.where(Pre_And, Pre_Or1).getRestriction();
|
|
|
}
|
|
|
} else {
|
|
|
if (!CollectionUtils.isEmpty(listPermission)) {
|