영상관리 상세 추가

This commit is contained in:
Moon
2025-12-17 09:38:12 +09:00
parent 29f88e4476
commit ea6fcb2364
5 changed files with 136 additions and 3 deletions

View File

@@ -42,6 +42,10 @@ public class MapSheetMngCoreService {
return mapSheetMngRepository.findMapSheetMngList(searchReq);
}
public MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy) {
return mapSheetMngRepository.findMapSheetMng(mngYyyy);
}
public MapSheetMngDto.DmlReturn uploadProcess(@Valid List<Long> hstUidList) {
int count = 0;
if (!Objects.isNull(hstUidList) && !hstUidList.isEmpty()) {

View File

@@ -10,6 +10,8 @@ public interface MapSheetMngRepositoryCustom {
Page<MapSheetMngDto.MngDto> findMapSheetMngList(MapSheetMngDto.MngSearchReq searchReq);
MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy);
Optional<MapSheetMngHstEntity> findMapSheetMngHstInfo(Long hstUid);
int insertMapSheetOrgDataToMapSheetMngHst(int mngYyyy);

View File

@@ -171,6 +171,106 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
return new PageImpl<>(foundContent, pageable, countQuery);
}
public MapSheetMngDto.MngDto findMapSheetMng(int mngYyyy){
BooleanBuilder whereBuilder = new BooleanBuilder();
whereBuilder.and(mapSheetMngEntity.mngYyyy.eq(mngYyyy));
MapSheetMngDto.MngDto foundContent =
queryFactory
.select(
Projections.constructor(
MapSheetMngDto.MngDto.class,
Expressions.numberTemplate(
Integer.class,
"row_number() over(order by {0} desc)",
mapSheetMngEntity.createdDttm),
mapSheetMngEntity.mngYyyy,
mapSheetMngEntity.mngState,
mapSheetMngEntity.syncState,
mapSheetMngEntity.syncCheckState,
mapSheetMngHstEntity.count(),
new CaseBuilder()
.when(mapSheetMngHstEntity.dataState.eq("DONE"))
.then(1L)
.otherwise(0L)
.sum()
.as("syncStateDoneCnt"),
new CaseBuilder()
.when(mapSheetMngHstEntity.syncState.ne("NOTYET"))
.then(1L)
.otherwise(0L)
.sum(),
new CaseBuilder()
.when(
mapSheetMngHstEntity
.syncState
.eq("NOFILE")
.or(mapSheetMngHstEntity.syncState.eq("NOTPAIR")))
.then(1L)
.otherwise(0L)
.sum(),
new CaseBuilder()
.when(
mapSheetMngHstEntity
.syncCheckState
.eq("DONE")
.and(
mapSheetMngHstEntity
.syncState
.eq("NOFILE")
.or(mapSheetMngHstEntity.syncState.eq("NOTPAIR"))))
.then(1L)
.otherwise(0L)
.sum(),
new CaseBuilder()
.when(mapSheetMngHstEntity.syncState.eq("DUPLICATE"))
.then(1L)
.otherwise(0L)
.sum(),
new CaseBuilder()
.when(
mapSheetMngHstEntity
.syncCheckState
.eq("DONE")
.and(mapSheetMngHstEntity.syncState.eq("DUPLICATE")))
.then(1L)
.otherwise(0L)
.sum(),
new CaseBuilder()
.when(
mapSheetMngHstEntity
.syncState
.eq("TYPEERROR")
.or(mapSheetMngHstEntity.syncState.eq("SIZEERROR")))
.then(1L)
.otherwise(0L)
.sum(),
new CaseBuilder()
.when(
mapSheetMngHstEntity
.syncCheckState
.eq("DONE")
.and(
mapSheetMngHstEntity
.syncState
.eq("TYPEERROR")
.or(mapSheetMngHstEntity.syncState.eq("SIZEERROR"))))
.then(1L)
.otherwise(0L)
.sum(),
mapSheetMngEntity.createdDttm,
mapSheetMngHstEntity.syncEndDttm.max()))
.from(mapSheetMngEntity)
.leftJoin(mapSheetMngHstEntity)
.on(mapSheetMngEntity.mngYyyy.eq(mapSheetMngHstEntity.mngYyyy))
.where(whereBuilder)
.groupBy(mapSheetMngEntity.mngYyyy)
.fetchOne();
return foundContent;
}
@Override
public Page<MapSheetMngDto.ErrorDataDto> findMapSheetErrorList(
MapSheetMngDto.@Valid ErrorSearchReq searchReq) {