From 88a4034a6bb703190860a7117687b2cb2f0c47e2 Mon Sep 17 00:00:00 2001 From: JH <935007339@qq.com> Date: Tue, 20 Feb 2024 20:38:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E6=9C=9F=E5=88=8A=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/luoo/music/service/CMSJournalService.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/luoo_music/src/main/java/com/luoo/music/service/CMSJournalService.java b/luoo_music/src/main/java/com/luoo/music/service/CMSJournalService.java index 30719c3..c5681ef 100644 --- a/luoo_music/src/main/java/com/luoo/music/service/CMSJournalService.java +++ b/luoo_music/src/main/java/com/luoo/music/service/CMSJournalService.java @@ -104,8 +104,11 @@ public class CMSJournalService { private Specification buildSearchSpecification(JournalQueryModel param, List ids) { return (Root root, CriteriaQuery query, CriteriaBuilder builder) -> { List predicateList = new ArrayList(); - if ("1".equals(param.getTab())) { - predicateList.add(builder.equal(root.get("isPublish"), "1")); + // 新建:0,已发布:1, 回收站:2 + if ("1".equals(param.getTab())) { + 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 {