From 6a4c0ff89c7022c472d9eac4d64222c0fa326308 Mon Sep 17 00:00:00 2001 From: anhefti Date: Mon, 13 Jun 2022 16:46:23 +0200 Subject: [PATCH] SEBSERV-317 archived state filter and LMS activation handling --- .../webservice/servicelayer/dao/impl/ExamDAOImpl.java | 1 + .../webservice/servicelayer/dao/impl/ExamRecordDAO.java | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java index 287e0d25..cbd17475 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java @@ -228,6 +228,7 @@ public class ExamDAOImpl implements ExamDAO { this.examRecordMapper.updateByExampleSelective(examRecord) .where(ExamRecordDynamicSqlSupport.id, isIn(ids)) + .and(ExamRecordDynamicSqlSupport.status, isNotEqualTo(ExamStatus.ARCHIVED.name())) .build() .execute(); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamRecordDAO.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamRecordDAO.java index f36aadcd..c6a65cf9 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamRecordDAO.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamRecordDAO.java @@ -193,6 +193,11 @@ public class ExamRecordDAO { .and( ExamRecordDynamicSqlSupport.status, isInWhenPresent(stateNames)); + } else { + whereClause = whereClause + .and( + ExamRecordDynamicSqlSupport.status, + isNotEqualTo(ExamStatus.ARCHIVED.name())); } final List records = whereClause