后台期刊列表

main
JH 9 months ago
parent 8d897c4089
commit 88a4034a6b

@ -104,8 +104,11 @@ public class CMSJournalService {
private Specification<Journal> buildSearchSpecification(JournalQueryModel param, List<String> ids) { private Specification<Journal> buildSearchSpecification(JournalQueryModel param, List<String> ids) {
return (Root<Journal> root, CriteriaQuery<?> query, CriteriaBuilder builder) -> { return (Root<Journal> root, CriteriaQuery<?> query, CriteriaBuilder builder) -> {
List<Predicate> predicateList = new ArrayList<Predicate>(); List<Predicate> predicateList = new ArrayList<Predicate>();
// 新建0已发布1 回收站2
if ("1".equals(param.getTab())) { if ("1".equals(param.getTab())) {
predicateList.add(builder.equal(root.get("isPublish"), "1")); Predicate state = builder.equal(root.get("state"), "1");
Predicate isPublish = builder.equal(root.get("isPublish"), "1");
predicateList.add(builder.and(state, isPublish));
} else if ("2".equals(param.getTab())) { } else if ("2".equals(param.getTab())) {
predicateList.add(builder.equal(root.get("state"), "0")); predicateList.add(builder.equal(root.get("state"), "0"));
} else { } else {

Loading…
Cancel
Save