|
|
@@ -10,7 +10,6 @@ import nju.seec.helper.entity.Slide;
|
|
|
import nju.seec.helper.service.MessageService;
|
|
|
import nju.seec.helper.service.QuizService;
|
|
|
import nju.seec.helper.service.util.AuthUtils;
|
|
|
-import nju.seec.helper.service.util.StringUtils;
|
|
|
import nju.seec.helper.util.enums.*;
|
|
|
import nju.seec.helper.util.exception.HelperException;
|
|
|
import nju.seec.helper.vo.quiz.QuizVO;
|
|
|
@@ -194,19 +193,21 @@ public class QuizServiceImpl implements QuizService {
|
|
|
private Page<Quiz> findByCourseIdInAndStateAndKey(Set<Long> courseIds, QuizState state, String key, Pageable pageable) {
|
|
|
return quizDAO.findAll(
|
|
|
(Specification<Quiz>) (root, query, cb) -> cb.and(
|
|
|
- root.get("course").get("id").in(courseIds),
|
|
|
- cb.equal(root.get("deleteAt"), 0L),
|
|
|
- cb.equal(root.get("state"), state),
|
|
|
- cb.like(root.get("name"), StringUtils.keyPattern(key))),
|
|
|
+ root.get("course").get("id").in(courseIds)
|
|
|
+ , cb.equal(root.get("deleteAt"), 0L)
|
|
|
+ , cb.equal(root.get("state"), state)
|
|
|
+// , cb.like(root.get("name"), StringUtils.keyPattern(key))
|
|
|
+ ),
|
|
|
pageable);
|
|
|
}
|
|
|
|
|
|
private Page<Quiz> findBySlideIdAndKey(Long slideId, String key, Pageable pageable) {
|
|
|
return quizDAO.findAll(
|
|
|
(Specification<Quiz>) (root, query, cb) -> cb.and(
|
|
|
- cb.equal(root.get("slide").get("id"), slideId),
|
|
|
- cb.equal(root.get("deleteAt"), 0L),
|
|
|
- cb.like(root.get("name"), StringUtils.keyPattern(key))),
|
|
|
+ cb.equal(root.get("slide").get("id"), slideId)
|
|
|
+ , cb.equal(root.get("deleteAt"), 0L)
|
|
|
+// , cb.like(root.get("name"), StringUtils.keyPattern(key))
|
|
|
+ ),
|
|
|
pageable);
|
|
|
}
|
|
|
|
|
|
@@ -214,10 +215,10 @@ public class QuizServiceImpl implements QuizService {
|
|
|
private Page<Quiz> findBySlideIdAndStateNotInAndKey(Long slideId, Set<QuizState> exclusiveStates, String key, Pageable pageable) {
|
|
|
return quizDAO.findAll(
|
|
|
(Specification<Quiz>) (root, query, cb) -> cb.and(
|
|
|
- cb.equal(root.get("slide").get("id"), slideId),
|
|
|
- cb.equal(root.get("deleteAt"), 0L),
|
|
|
- cb.like(root.get("name"), StringUtils.keyPattern(key)),
|
|
|
- cb.not(root.get("state").in(exclusiveStates))),
|
|
|
+ cb.equal(root.get("slide").get("id"), slideId)
|
|
|
+ , cb.equal(root.get("deleteAt"), 0L)
|
|
|
+// , cb.like(root.get("name"), StringUtils.keyPattern(key))
|
|
|
+ , cb.not(root.get("state").in(exclusiveStates))),
|
|
|
pageable);
|
|
|
}
|
|
|
}
|