년도목록수정

This commit is contained in:
Moon
2025-12-22 17:01:59 +09:00
parent 9cebf3c0b2
commit f2a0d8fc3c

View File

@@ -19,7 +19,9 @@ import com.querydsl.jpa.impl.JPAQueryFactory;
import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManager;
import jakarta.persistence.PersistenceContext; import jakarta.persistence.PersistenceContext;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import java.time.LocalDate;
import java.time.ZonedDateTime; import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.Optional; import java.util.Optional;
@@ -170,6 +172,8 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
} }
public List<Integer> findMapSheetMngYyyyList() { public List<Integer> findMapSheetMngYyyyList() {
/*
List<Integer> foundContent = List<Integer> foundContent =
queryFactory queryFactory
.select(mapSheetMngEntity.mngYyyy) .select(mapSheetMngEntity.mngYyyy)
@@ -177,6 +181,41 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
.where(mapSheetMngEntity.mngState.ne("COMPLETE")) .where(mapSheetMngEntity.mngState.ne("COMPLETE"))
.orderBy(mapSheetMngEntity.mngYyyy.desc()) .orderBy(mapSheetMngEntity.mngYyyy.desc())
.fetch(); .fetch();
*/
int currentYear = LocalDate.now().getYear();
List<Integer> foundContentCurrent =
queryFactory
.select(mapSheetMngEntity.mngYyyy)
.from(mapSheetMngEntity)
.where(mapSheetMngEntity.mngYyyy.eq(currentYear))
.orderBy(mapSheetMngEntity.mngYyyy.desc())
.fetch();
List<Integer> foundContent1 =
queryFactory
.select(mapSheetMngEntity.mngYyyy)
.from(mapSheetMngEntity)
.where(mapSheetMngEntity.mngYyyy.ne(currentYear)
.and(mapSheetMngEntity.mngState.ne("NOTYET")
.or(mapSheetMngEntity.mngState.ne("DELETE"))))
.orderBy(mapSheetMngEntity.mngYyyy.desc())
.fetch();
//if( foundContentCurrent == null || foundContentCurrent.size() == 0)
//{
//foundContent.add(currentYear);
//}
List<Integer> foundContent = new ArrayList<>();
foundContent.add(2025);
foundContent.add(2024);
foundContent.add(2023);
foundContent.add(2022);
return foundContent; return foundContent;
} }