feat: fix
This commit is contained in:
@@ -2,9 +2,12 @@ package com.kamco.cd.kamcoback.postgres.core;
|
||||
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.Dashboard;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.MapSheet;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapInkx5kEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataGeomEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.repository.Inference.InferenceResultRepository;
|
||||
import com.kamco.cd.kamcoback.postgres.repository.scene.MapInkx5kRepository;
|
||||
import jakarta.persistence.EntityNotFoundException;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
@@ -18,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
public class InferenceResultCoreService {
|
||||
|
||||
private final InferenceResultRepository inferenceResultRepository;
|
||||
private final MapInkx5kRepository mapInkx5kRepository;
|
||||
|
||||
/**
|
||||
* 추론관리 > 분석결과 목록 조회
|
||||
@@ -95,4 +99,17 @@ public class InferenceResultCoreService {
|
||||
public List<Long> getSheets(Long id) {
|
||||
return inferenceResultRepository.getSheets(id);
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
public List<MapSheet> listGetScenes5k(Long analyId) {
|
||||
List<String> sceneCodes =
|
||||
inferenceResultRepository.listAnalyGeom(analyId).stream()
|
||||
.mapToLong(MapSheetAnalDataEntity::getMapSheetNum)
|
||||
.mapToObj(String::valueOf)
|
||||
.toList();
|
||||
|
||||
return mapInkx5kRepository.listGetScenes5k(sceneCodes).stream()
|
||||
.map(MapInkx5kEntity::toEntity)
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.kamco.cd.kamcoback.postgres.repository.scene;
|
||||
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapInkx5kEntity;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface MapInkx5kRepository
|
||||
extends JpaRepository<MapInkx5kEntity, Long>, MapInkx5kRepositoryCustom {}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.kamco.cd.kamcoback.postgres.repository.scene;
|
||||
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapInkx5kEntity;
|
||||
import java.util.List;
|
||||
|
||||
public interface MapInkx5kRepositoryCustom {
|
||||
|
||||
List<MapInkx5kEntity> listGetScenes5k(List<String> codes);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.kamco.cd.kamcoback.postgres.repository.scene;
|
||||
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapInkx5kEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.QMapInkx5kEntity;
|
||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||
import java.util.List;
|
||||
import org.springframework.data.jpa.repository.support.QuerydslRepositorySupport;
|
||||
|
||||
public class MapInkx5kRepositoryImpl extends QuerydslRepositorySupport
|
||||
implements MapInkx5kRepositoryCustom {
|
||||
|
||||
private final JPAQueryFactory queryFactory;
|
||||
|
||||
public MapInkx5kRepositoryImpl(JPAQueryFactory queryFactory) {
|
||||
super(MapInkx5kEntity.class);
|
||||
this.queryFactory = queryFactory;
|
||||
}
|
||||
|
||||
public List<MapInkx5kEntity> listGetScenes5k(List<String> codes) {
|
||||
QMapInkx5kEntity map5k = QMapInkx5kEntity.mapInkx5kEntity;
|
||||
|
||||
return queryFactory
|
||||
.selectFrom(map5k)
|
||||
.where(map5k.mapidcdNo.in(codes))
|
||||
.orderBy(map5k.mapidcdNo.asc())
|
||||
.fetch();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user