변화탐지 pnu로도 조회 가능하게 하기
This commit is contained in:
@@ -163,13 +163,13 @@ public class ChangeDetectionApiController {
|
|||||||
@RequestParam
|
@RequestParam
|
||||||
String chnDtctId,
|
String chnDtctId,
|
||||||
@Parameter(description = "polygon 32자 uid", example = "3B1A7E5F895A4D9698489540EE1BBE1E")
|
@Parameter(description = "polygon 32자 uid", example = "3B1A7E5F895A4D9698489540EE1BBE1E")
|
||||||
@RequestParam
|
@RequestParam(required = false)
|
||||||
String cdObjectId,
|
String cdObjectId,
|
||||||
@Parameter(
|
@Parameter(
|
||||||
description = "polygon 32자 uids",
|
description = "polygon 32자 uids",
|
||||||
example =
|
example =
|
||||||
"3B1A7E5F895A4D9698489540EE1BBE1E,3B221A2AF9614647A0903A972D56C574,3B22686A7ACE44FC9CB20F1B4FA6DEFD,3B376D94A183479BB5FBE3D7166E6E1A")
|
"3B1A7E5F895A4D9698489540EE1BBE1E,3B221A2AF9614647A0903A972D56C574,3B22686A7ACE44FC9CB20F1B4FA6DEFD,3B376D94A183479BB5FBE3D7166E6E1A")
|
||||||
@RequestParam
|
@RequestParam(required = false)
|
||||||
List<String> cdObjectIds,
|
List<String> cdObjectIds,
|
||||||
@Parameter(description = "pnu") @RequestParam(required = false) String pnu) {
|
@Parameter(description = "pnu") @RequestParam(required = false) String pnu) {
|
||||||
return ApiResponseDto.ok(
|
return ApiResponseDto.ok(
|
||||||
@@ -183,13 +183,13 @@ public class ChangeDetectionApiController {
|
|||||||
@RequestParam
|
@RequestParam
|
||||||
String chnDtctId,
|
String chnDtctId,
|
||||||
@Parameter(description = "polygon 32자 uid", example = "3B1A7E5F895A4D9698489540EE1BBE1E")
|
@Parameter(description = "polygon 32자 uid", example = "3B1A7E5F895A4D9698489540EE1BBE1E")
|
||||||
@RequestParam
|
@RequestParam(required = false)
|
||||||
String cdObjectId,
|
String cdObjectId,
|
||||||
@Parameter(
|
@Parameter(
|
||||||
description = "polygon 32자 uids",
|
description = "polygon 32자 uids",
|
||||||
example =
|
example =
|
||||||
"3B1A7E5F895A4D9698489540EE1BBE1E,3B221A2AF9614647A0903A972D56C574,3B22686A7ACE44FC9CB20F1B4FA6DEFD,3B376D94A183479BB5FBE3D7166E6E1A")
|
"3B1A7E5F895A4D9698489540EE1BBE1E,3B221A2AF9614647A0903A972D56C574,3B22686A7ACE44FC9CB20F1B4FA6DEFD,3B376D94A183479BB5FBE3D7166E6E1A")
|
||||||
@RequestParam
|
@RequestParam(required = false)
|
||||||
List<String> cdObjectIds,
|
List<String> cdObjectIds,
|
||||||
@Parameter(description = "pnu") @RequestParam(required = false) String pnu) {
|
@Parameter(description = "pnu") @RequestParam(required = false) String pnu) {
|
||||||
return ApiResponseDto.ok(
|
return ApiResponseDto.ok(
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ public class ChangeDetectionService {
|
|||||||
*/
|
*/
|
||||||
public ChangeDetectionDto.PolygonFeatureList getPolygonListByCd(
|
public ChangeDetectionDto.PolygonFeatureList getPolygonListByCd(
|
||||||
String chnDtctId, String cdObjectId, List<String> cdObjectIds, String pnu) {
|
String chnDtctId, String cdObjectId, List<String> cdObjectIds, String pnu) {
|
||||||
return changeDetectionCoreService.getPolygonListByCd(chnDtctId, cdObjectId, cdObjectIds);
|
return changeDetectionCoreService.getPolygonListByCd(chnDtctId, cdObjectId, cdObjectIds, pnu);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -115,7 +115,7 @@ public class ChangeDetectionService {
|
|||||||
*/
|
*/
|
||||||
public ChangeDetectionDto.PointFeatureList getPointListByCd(
|
public ChangeDetectionDto.PointFeatureList getPointListByCd(
|
||||||
String chnDtctId, String cdObjectId, List<String> cdObjectIds, String pnu) {
|
String chnDtctId, String cdObjectId, List<String> cdObjectIds, String pnu) {
|
||||||
return changeDetectionCoreService.getPointListByCd(chnDtctId, cdObjectId, cdObjectIds);
|
return changeDetectionCoreService.getPointListByCd(chnDtctId, cdObjectId, cdObjectIds, pnu);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -108,8 +108,8 @@ public class ChangeDetectionCoreService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public ChangeDetectionDto.PolygonFeatureList getPolygonListByCd(
|
public ChangeDetectionDto.PolygonFeatureList getPolygonListByCd(
|
||||||
String chnDtctId, String cdObjectId, List<String> cdObjectIds) {
|
String chnDtctId, String cdObjectId, List<String> cdObjectIds, String pnu) {
|
||||||
return changeDetectionRepository.getPolygonListByCd(chnDtctId, cdObjectId, cdObjectIds);
|
return changeDetectionRepository.getPolygonListByCd(chnDtctId, cdObjectId, cdObjectIds, pnu);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -121,8 +121,8 @@ public class ChangeDetectionCoreService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public ChangeDetectionDto.PointFeatureList getPointListByCd(
|
public ChangeDetectionDto.PointFeatureList getPointListByCd(
|
||||||
String chnDtctId, String cdObjectId, List<String> cdObjectIds) {
|
String chnDtctId, String cdObjectId, List<String> cdObjectIds, String pnu) {
|
||||||
return changeDetectionRepository.getPointListByCd(chnDtctId, cdObjectId, cdObjectIds);
|
return changeDetectionRepository.getPointListByCd(chnDtctId, cdObjectId, cdObjectIds, pnu);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -31,10 +31,10 @@ public interface ChangeDetectionRepositoryCustom {
|
|||||||
List<MapSheetList> getChangeDetectionMapSheet50kList(UUID uuid);
|
List<MapSheetList> getChangeDetectionMapSheet50kList(UUID uuid);
|
||||||
|
|
||||||
ChangeDetectionDto.PolygonFeatureList getPolygonListByCd(
|
ChangeDetectionDto.PolygonFeatureList getPolygonListByCd(
|
||||||
String chnDtctId, String cdObjectId, List<String> cdObjectIds);
|
String chnDtctId, String cdObjectId, List<String> cdObjectIds, String pnu);
|
||||||
|
|
||||||
ChangeDetectionDto.PointFeatureList getPointListByCd(
|
ChangeDetectionDto.PointFeatureList getPointListByCd(
|
||||||
String chnDtctId, String cdObjectId, List<String> cdObjectIds);
|
String chnDtctId, String cdObjectId, List<String> cdObjectIds, String pnu);
|
||||||
|
|
||||||
ChangeDetectionDto.PolygonFeatureList getSelectedChangeDetectionPolygonListByPnu(
|
ChangeDetectionDto.PolygonFeatureList getSelectedChangeDetectionPolygonListByPnu(
|
||||||
String chnDtctId, String pnu);
|
String chnDtctId, String pnu);
|
||||||
|
|||||||
@@ -18,7 +18,9 @@ import com.kamco.cd.kamcoback.changedetection.dto.ChangeDetectionDto.DetectSearc
|
|||||||
import com.kamco.cd.kamcoback.changedetection.dto.ChangeDetectionDto.MapScaleType;
|
import com.kamco.cd.kamcoback.changedetection.dto.ChangeDetectionDto.MapScaleType;
|
||||||
import com.kamco.cd.kamcoback.changedetection.dto.ChangeDetectionDto.MapSheetList;
|
import com.kamco.cd.kamcoback.changedetection.dto.ChangeDetectionDto.MapSheetList;
|
||||||
import com.kamco.cd.kamcoback.changedetection.dto.ChangeDetectionDto.PointFeatureList;
|
import com.kamco.cd.kamcoback.changedetection.dto.ChangeDetectionDto.PointFeatureList;
|
||||||
|
import com.kamco.cd.kamcoback.changedetection.dto.ChangeDetectionDto.PointQueryData;
|
||||||
import com.kamco.cd.kamcoback.changedetection.dto.ChangeDetectionDto.PolygonFeatureList;
|
import com.kamco.cd.kamcoback.changedetection.dto.ChangeDetectionDto.PolygonFeatureList;
|
||||||
|
import com.kamco.cd.kamcoback.changedetection.dto.ChangeDetectionDto.PolygonQueryData;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.Status;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.Status;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceGeomEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceGeomEntity;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceEntity;
|
||||||
@@ -31,6 +33,7 @@ import com.querydsl.core.types.dsl.CaseBuilder;
|
|||||||
import com.querydsl.core.types.dsl.Expressions;
|
import com.querydsl.core.types.dsl.Expressions;
|
||||||
import com.querydsl.core.types.dsl.StringExpression;
|
import com.querydsl.core.types.dsl.StringExpression;
|
||||||
import com.querydsl.jpa.JPAExpressions;
|
import com.querydsl.jpa.JPAExpressions;
|
||||||
|
import com.querydsl.jpa.impl.JPAQuery;
|
||||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@@ -391,16 +394,23 @@ public class ChangeDetectionRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PolygonFeatureList getPolygonListByCd(
|
public PolygonFeatureList getPolygonListByCd(
|
||||||
String chnDtctId, String cdObjectId, List<String> cdObjectIds) {
|
String chnDtctId, String cdObjectId, List<String> cdObjectIds, String pnu) {
|
||||||
BooleanBuilder builder = new BooleanBuilder();
|
BooleanBuilder builder = new BooleanBuilder();
|
||||||
builder.and(mapSheetLearnEntity.uid.eq(chnDtctId));
|
builder.and(mapSheetLearnEntity.uid.eq(chnDtctId));
|
||||||
|
|
||||||
|
// pnu가 들어온 경우
|
||||||
|
boolean hasPnu = pnu != null && !pnu.isBlank();
|
||||||
|
|
||||||
|
if (!hasPnu) {
|
||||||
builder.and(
|
builder.and(
|
||||||
mapSheetAnalDataInferenceGeomEntity
|
mapSheetAnalDataInferenceGeomEntity
|
||||||
.resultUid
|
.resultUid
|
||||||
.eq(chnDtctId)
|
.eq(chnDtctId)
|
||||||
.or(mapSheetAnalDataInferenceGeomEntity.resultUid.in(cdObjectIds)));
|
.or(mapSheetAnalDataInferenceGeomEntity.resultUid.in(cdObjectIds)));
|
||||||
|
}
|
||||||
|
|
||||||
List<ChangeDetectionDto.PolygonQueryData> list =
|
// List<ChangeDetectionDto.PolygonQueryData> list =
|
||||||
|
JPAQuery<PolygonQueryData> query =
|
||||||
queryFactory
|
queryFactory
|
||||||
.select(
|
.select(
|
||||||
Projections.constructor(
|
Projections.constructor(
|
||||||
@@ -425,10 +435,22 @@ public class ChangeDetectionRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
.innerJoin(mapSheetAnalInferenceEntity)
|
.innerJoin(mapSheetAnalInferenceEntity)
|
||||||
.on(mapSheetAnalInferenceEntity.id.eq(mapSheetAnalDataInferenceEntity.analUid))
|
.on(mapSheetAnalInferenceEntity.id.eq(mapSheetAnalDataInferenceEntity.analUid))
|
||||||
.innerJoin(mapSheetLearnEntity)
|
.innerJoin(mapSheetLearnEntity)
|
||||||
.on(mapSheetLearnEntity.id.eq(mapSheetAnalInferenceEntity.learnId))
|
.on(mapSheetLearnEntity.id.eq(mapSheetAnalInferenceEntity.learnId));
|
||||||
.where(builder)
|
// .where(builder)
|
||||||
.orderBy(mapSheetAnalDataInferenceGeomEntity.mapSheetNum.asc())
|
// .orderBy(mapSheetAnalDataInferenceGeomEntity.mapSheetNum.asc());
|
||||||
.fetch();
|
// .fetch();
|
||||||
|
|
||||||
|
// 🔥 pnu 조건이면 tb_pnu join 추가
|
||||||
|
if (hasPnu) {
|
||||||
|
query
|
||||||
|
.innerJoin(pnuEntity)
|
||||||
|
.on(pnuEntity.geo.geoUid.eq(mapSheetAnalDataInferenceGeomEntity.geoUid));
|
||||||
|
|
||||||
|
builder.and(pnuEntity.pnu.eq(pnu));
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ChangeDetectionDto.PolygonQueryData> list =
|
||||||
|
query.where(builder).orderBy(mapSheetAnalDataInferenceGeomEntity.mapSheetNum.asc()).fetch();
|
||||||
|
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
List<ChangeDetectionDto.PolygonFeature> result =
|
List<ChangeDetectionDto.PolygonFeature> result =
|
||||||
@@ -470,16 +492,23 @@ public class ChangeDetectionRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PointFeatureList getPointListByCd(
|
public PointFeatureList getPointListByCd(
|
||||||
String chnDtctId, String cdObjectId, List<String> cdObjectIds) {
|
String chnDtctId, String cdObjectId, List<String> cdObjectIds, String pnu) {
|
||||||
BooleanBuilder builder = new BooleanBuilder();
|
BooleanBuilder builder = new BooleanBuilder();
|
||||||
builder.and(mapSheetLearnEntity.uid.eq(chnDtctId));
|
builder.and(mapSheetLearnEntity.uid.eq(chnDtctId));
|
||||||
|
|
||||||
|
// pnu가 들어온 경우
|
||||||
|
boolean hasPnu = pnu != null && !pnu.isBlank();
|
||||||
|
|
||||||
|
if (!hasPnu) {
|
||||||
builder.and(
|
builder.and(
|
||||||
mapSheetAnalDataInferenceGeomEntity
|
mapSheetAnalDataInferenceGeomEntity
|
||||||
.resultUid
|
.resultUid
|
||||||
.eq(chnDtctId)
|
.eq(chnDtctId)
|
||||||
.or(mapSheetAnalDataInferenceGeomEntity.resultUid.in(cdObjectIds)));
|
.or(mapSheetAnalDataInferenceGeomEntity.resultUid.in(cdObjectIds)));
|
||||||
|
}
|
||||||
|
|
||||||
List<ChangeDetectionDto.PointQueryData> list =
|
// List<ChangeDetectionDto.PointQueryData> list =
|
||||||
|
JPAQuery<PointQueryData> query =
|
||||||
queryFactory
|
queryFactory
|
||||||
.select(
|
.select(
|
||||||
Projections.constructor(
|
Projections.constructor(
|
||||||
@@ -498,9 +527,21 @@ public class ChangeDetectionRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
.innerJoin(mapSheetAnalInferenceEntity)
|
.innerJoin(mapSheetAnalInferenceEntity)
|
||||||
.on(mapSheetAnalInferenceEntity.id.eq(mapSheetAnalDataInferenceEntity.analUid))
|
.on(mapSheetAnalInferenceEntity.id.eq(mapSheetAnalDataInferenceEntity.analUid))
|
||||||
.innerJoin(mapSheetLearnEntity)
|
.innerJoin(mapSheetLearnEntity)
|
||||||
.on(mapSheetLearnEntity.id.eq(mapSheetAnalInferenceEntity.learnId))
|
.on(mapSheetLearnEntity.id.eq(mapSheetAnalInferenceEntity.learnId));
|
||||||
.where(builder)
|
// .where(builder)
|
||||||
.fetch();
|
// .fetch();
|
||||||
|
|
||||||
|
// 🔥 pnu 조건이면 tb_pnu join 추가
|
||||||
|
if (hasPnu) {
|
||||||
|
query
|
||||||
|
.innerJoin(pnuEntity)
|
||||||
|
.on(pnuEntity.geo.geoUid.eq(mapSheetAnalDataInferenceGeomEntity.geoUid));
|
||||||
|
|
||||||
|
builder.and(pnuEntity.pnu.eq(pnu));
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ChangeDetectionDto.PointQueryData> list =
|
||||||
|
query.where(builder).orderBy(mapSheetAnalDataInferenceGeomEntity.mapSheetNum.asc()).fetch();
|
||||||
|
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
List<ChangeDetectionDto.PointFeature> result =
|
List<ChangeDetectionDto.PointFeature> result =
|
||||||
|
|||||||
Reference in New Issue
Block a user