diff --git a/src/main/java/com/chint/infrastructure/repository/SystemAnnouncementRepositoryImpl.java b/src/main/java/com/chint/infrastructure/repository/SystemAnnouncementRepositoryImpl.java index d54117f3..9686d8b1 100644 --- a/src/main/java/com/chint/infrastructure/repository/SystemAnnouncementRepositoryImpl.java +++ b/src/main/java/com/chint/infrastructure/repository/SystemAnnouncementRepositoryImpl.java @@ -33,7 +33,7 @@ public class SystemAnnouncementRepositoryImpl implements SystemAnnouncementRepos @Override public Optional findNew() { - return jdbcSystemAnnouncementRepository.findTopByOrderByAnnouncementIdDesc(); + return jdbcSystemAnnouncementRepository.findTopByStatusOrderByAnnouncementIdDesc("1"); } @Override diff --git a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcSystemAnnouncementRepository.java b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcSystemAnnouncementRepository.java index e77f117b..5bfa9e07 100644 --- a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcSystemAnnouncementRepository.java +++ b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcSystemAnnouncementRepository.java @@ -9,7 +9,7 @@ import java.util.Optional; @Repository public interface JdbcSystemAnnouncementRepository extends CrudRepository { - Optional findTopByOrderByAnnouncementIdDesc(); + Optional findTopByStatusOrderByAnnouncementIdDesc(String status); List findByStatus(String status); }