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