From 53906a59ddf4f0adefe7cc94fa3f278b2852955a Mon Sep 17 00:00:00 2001 From: Volodymyr_Rohach Date: Wed, 5 Jun 2024 16:37:10 +0300 Subject: [PATCH] MODSOURCE-773: Condition improved. --- .../src/main/java/org/folio/dao/util/RecordDaoUtil.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mod-source-record-storage-server/src/main/java/org/folio/dao/util/RecordDaoUtil.java b/mod-source-record-storage-server/src/main/java/org/folio/dao/util/RecordDaoUtil.java index ba7c093b1..3202f44b8 100644 --- a/mod-source-record-storage-server/src/main/java/org/folio/dao/util/RecordDaoUtil.java +++ b/mod-source-record-storage-server/src/main/java/org/folio/dao/util/RecordDaoUtil.java @@ -591,10 +591,11 @@ public static Condition filterRecordByUpdatedDateRange(Date updatedAfter, Date u * @return condition */ public static Condition filterRecordByDeleted(Boolean deleted) { + Condition condition = filterRecordByState(RecordState.ACTUAL.name()); if (deleted == null) { - return null; + condition = condition.or(filterRecordByState(RecordState.DELETED.name())) + .or(filterRecordByState(RecordState.ACTUAL.name())); } - Condition condition = filterRecordByState(RecordState.ACTUAL.name()); if (Boolean.TRUE.equals(deleted)) { condition = condition.or(filterRecordByState(RecordState.DELETED.name())) .or(filterRecordByState(RecordState.ACTUAL.name()).and(filterRecordByLeaderRecordStatus(DELETED_LEADER_RECORD_STATUS)));