|
@@ -6,6 +6,7 @@ import cn.com.qmth.stmms.biz.mark.model.ProblemHistory;
|
|
|
import cn.com.qmth.stmms.biz.mark.query.ProblemHistorySearchQuery;
|
|
|
import cn.com.qmth.stmms.biz.mark.service.ProblemHistoryService;
|
|
|
import cn.com.qmth.stmms.common.enums.HistoryStatus;
|
|
|
+
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
@@ -16,6 +17,7 @@ import javax.persistence.criteria.CriteriaBuilder;
|
|
|
import javax.persistence.criteria.CriteriaQuery;
|
|
|
import javax.persistence.criteria.Predicate;
|
|
|
import javax.persistence.criteria.Root;
|
|
|
+
|
|
|
import java.util.LinkedList;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -81,9 +83,18 @@ public class ProblemHistoryServiceImpl extends BaseQueryService<ProblemHistory>
|
|
|
if (query.getProblemId() != null) {
|
|
|
predicates.add(cb.equal(root.get("problemId"), query.getProblemId()));
|
|
|
}
|
|
|
- return predicates.isEmpty() ?
|
|
|
- cb.conjunction() :
|
|
|
- cb.and(predicates.toArray(new Predicate[predicates.size()]));
|
|
|
+ if (StringUtils.isNotBlank(query.getSubjectCodeIn())) {
|
|
|
+ String[] list = query.getSubjectCodeIn().split(",");
|
|
|
+ if (list.length > 0) {
|
|
|
+ Predicate[] sub = new Predicate[list.length];
|
|
|
+ for (int i = 0; i < list.length; i++) {
|
|
|
+ sub[i] = cb.equal(root.get("subjectCode"), list[i]);
|
|
|
+ }
|
|
|
+ predicates.add(cb.or(sub));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return predicates.isEmpty() ? cb.conjunction() : cb.and(predicates.toArray(new Predicate[predicates
|
|
|
+ .size()]));
|
|
|
}
|
|
|
};
|
|
|
}
|