【fix】最新公告依然查询查询无效公告修复

This commit is contained in:
nixj 2024-05-29 14:53:20 +08:00
parent c253f1363e
commit 05f46be012
2 changed files with 2 additions and 2 deletions

View File

@ -33,7 +33,7 @@ public class SystemAnnouncementRepositoryImpl implements SystemAnnouncementRepos
@Override @Override
public Optional<SystemAnnouncement> findNew() { public Optional<SystemAnnouncement> findNew() {
return jdbcSystemAnnouncementRepository.findTopByOrderByAnnouncementIdDesc(); return jdbcSystemAnnouncementRepository.findTopByStatusOrderByAnnouncementIdDesc("1");
} }
@Override @Override

View File

@ -9,7 +9,7 @@ import java.util.Optional;
@Repository @Repository
public interface JdbcSystemAnnouncementRepository extends CrudRepository<SystemAnnouncement, Long> { public interface JdbcSystemAnnouncementRepository extends CrudRepository<SystemAnnouncement, Long> {
Optional<SystemAnnouncement> findTopByOrderByAnnouncementIdDesc(); Optional<SystemAnnouncement> findTopByStatusOrderByAnnouncementIdDesc(String status);
List<SystemAnnouncement> findByStatus(String status); List<SystemAnnouncement> findByStatus(String status);
} }