From a33dbf95973710250a05f07f8441e04cf712aead Mon Sep 17 00:00:00 2001 From: "gayoun.park" Date: Wed, 7 Jan 2026 15:54:04 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B6=94=EB=A1=A0=EA=B2=B0=EA=B3=BC,=20?= =?UTF-8?q?=EB=B3=80=ED=99=94=ED=83=90=EC=A7=80=20=ED=85=8C=EC=9D=B4?= =?UTF-8?q?=EB=B8=94=20=EC=88=98=EC=A0=95=EC=9C=BC=EB=A1=9C=20=EC=9D=B8?= =?UTF-8?q?=ED=95=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ChangeDetectionApiController.java | 19 ++-- .../InferenceResultApiController.java | 6 +- .../inference/dto/InferenceResultDto.java | 6 -- ...pSheetAnalDataInferenceRepositoryImpl.java | 88 ++++++++++--------- 4 files changed, 59 insertions(+), 60 deletions(-) diff --git a/src/main/java/com/kamco/cd/kamcoback/changedetection/ChangeDetectionApiController.java b/src/main/java/com/kamco/cd/kamcoback/changedetection/ChangeDetectionApiController.java index 72cb5e24..4b816ea4 100644 --- a/src/main/java/com/kamco/cd/kamcoback/changedetection/ChangeDetectionApiController.java +++ b/src/main/java/com/kamco/cd/kamcoback/changedetection/ChangeDetectionApiController.java @@ -11,7 +11,10 @@ import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.transaction.Transactional; import java.util.List; import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; @Tag(name = "변화탐지", description = "변화탐지 API") @RequiredArgsConstructor @@ -43,7 +46,7 @@ public class ChangeDetectionApiController { @Operation(summary = "변화탐지 분류별 건수", description = "변화탐지 분류별 건수") @GetMapping("/class-count") public ApiResponseDto> getChangeDetectionClassCount( - @Parameter(description = "변화탐지 년도(차수) /year-list 의 analUid", example = "1") @RequestParam + @Parameter(description = "변화탐지 년도(차수) /year-list 의 analUid", example = "53") @RequestParam Long id, @Parameter(description = "탐지된 도엽번호", example = "34602060") @RequestParam String mapSheetNum) { return ApiResponseDto.ok(changeDetectionService.getChangeDetectionClassCount(id, mapSheetNum)); @@ -54,7 +57,7 @@ public class ChangeDetectionApiController { public ApiResponseDto getChangeDetectionCogUrl( @Parameter(description = "이전 년도", example = "2023") @RequestParam Integer beforeYear, @Parameter(description = "이후 년도", example = "2024") @RequestParam Integer afterYear, - @Parameter(description = "도엽번호(5k)", example = "36809010") @RequestParam String mapSheetNum) { + @Parameter(description = "도엽번호(5k)", example = "35905086") @RequestParam String mapSheetNum) { ChangeDetectionDto.CogUrlReq req = new ChangeDetectionDto.CogUrlReq(beforeYear, afterYear, mapSheetNum); return ApiResponseDto.ok(changeDetectionService.getChangeDetectionCogUrl(req)); @@ -69,15 +72,15 @@ public class ChangeDetectionApiController { @Operation(summary = "변화탐지 탐지된 도엽 목록", description = "변화탐지 탐지된 도엽 목록") @GetMapping("/map-list") public ApiResponseDto> getChangeDetectionMapSheetList( - @Parameter(description = "년도목록 id", example = "1") @RequestParam Long analUid) { + @Parameter(description = "도엽목록 그룹id", example = "1") @RequestParam Long analUid) { return ApiResponseDto.ok(changeDetectionService.getChangeDetectionMapSheetList(analUid)); } @Operation(summary = "변화탐지 결과 Polygon", description = "변화탐지 결과 Polygon") @GetMapping("/polygon") public ApiResponseDto getChangeDetectionPolygonList( - @Parameter(description = "년도목록 id", example = "1") @RequestParam Long analUid, - @Parameter(description = "도엽번호", example = "34602060") @RequestParam String mapSheetNum) { + @Parameter(description = "년도목록 id", example = "53") @RequestParam Long analUid, + @Parameter(description = "도엽번호", example = "35905086") @RequestParam String mapSheetNum) { return ApiResponseDto.ok( changeDetectionService.getChangeDetectionPolygonList(analUid, mapSheetNum)); } @@ -85,8 +88,8 @@ public class ChangeDetectionApiController { @Operation(summary = "변화탐지 결과 Point", description = "변화탐지 결과 Point") @GetMapping("/point") public ApiResponseDto getChangeDetectionPointList( - @Parameter(description = "년도목록 id", example = "1") @RequestParam Long analUid, - @Parameter(description = "도엽번호", example = "34602060") @RequestParam String mapSheetNum) { + @Parameter(description = "년도목록 id", example = "53") @RequestParam Long analUid, + @Parameter(description = "도엽번호", example = "35905086") @RequestParam String mapSheetNum) { return ApiResponseDto.ok( changeDetectionService.getChangeDetectionPointList(analUid, mapSheetNum)); } diff --git a/src/main/java/com/kamco/cd/kamcoback/inference/InferenceResultApiController.java b/src/main/java/com/kamco/cd/kamcoback/inference/InferenceResultApiController.java index 58a0aa3e..610fd364 100644 --- a/src/main/java/com/kamco/cd/kamcoback/inference/InferenceResultApiController.java +++ b/src/main/java/com/kamco/cd/kamcoback/inference/InferenceResultApiController.java @@ -75,7 +75,7 @@ public class InferenceResultApiController { }) @GetMapping("/summary/{id}") public ApiResponseDto getInferenceResultSummary( - @Parameter(description = "목록 id", example = "1") @PathVariable Long id) { + @Parameter(description = "목록 id", example = "53") @PathVariable Long id) { return ApiResponseDto.ok(inferenceResultService.getInferenceResultSummary(id)); } @@ -94,7 +94,7 @@ public class InferenceResultApiController { }) @GetMapping("/detail/{id}") public ApiResponseDto getInferenceDetail( - @Parameter(description = "목록 id", example = "1") @PathVariable Long id) { + @Parameter(description = "목록 id", example = "53") @PathVariable Long id) { return ApiResponseDto.ok(inferenceResultService.getDetail(id)); } @@ -113,7 +113,7 @@ public class InferenceResultApiController { }) @GetMapping("/geom/{id}") public ApiResponseDto> getInferenceResultGeomList( - @Parameter(description = "분석결과 id", example = "1") @PathVariable Long id, + @Parameter(description = "분석결과 id", example = "53") @PathVariable Long id, @Parameter(description = "기준년도 분류", example = "land") @RequestParam(required = false) String targetClass, @Parameter(description = "비교년도 분류", example = "waste") @RequestParam(required = false) diff --git a/src/main/java/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto.java b/src/main/java/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto.java index ed45f97a..ec1bcb04 100644 --- a/src/main/java/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto.java +++ b/src/main/java/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto.java @@ -58,7 +58,6 @@ public class InferenceResultDto { private Long id; private String analTitle; - private String analMapSheet; private Long detectingCnt; @JsonFormatDttm private ZonedDateTime analStrtDttm; @JsonFormatDttm private ZonedDateTime analEndDttm; @@ -71,7 +70,6 @@ public class InferenceResultDto { public AnalResList( Long id, String analTitle, - String analMapSheet, Long detectingCnt, ZonedDateTime analStrtDttm, ZonedDateTime analEndDttm, @@ -82,7 +80,6 @@ public class InferenceResultDto { String gukyuinUsed) { this.id = id; this.analTitle = analTitle; - this.analMapSheet = analMapSheet; this.detectingCnt = detectingCnt; this.analStrtDttm = analStrtDttm; this.analEndDttm = analEndDttm; @@ -103,7 +100,6 @@ public class InferenceResultDto { private String modelInfo; private Integer targetYyyy; private Integer compareYyyy; - private String analMapSheet; @JsonFormatDttm private ZonedDateTime analStrtDttm; @JsonFormatDttm private ZonedDateTime analEndDttm; private Long analSec; @@ -120,7 +116,6 @@ public class InferenceResultDto { String modelInfo, Integer targetYyyy, Integer compareYyyy, - String analMapSheet, ZonedDateTime analStrtDttm, ZonedDateTime analEndDttm, Long analSec, @@ -135,7 +130,6 @@ public class InferenceResultDto { this.modelInfo = modelInfo; this.targetYyyy = targetYyyy; this.compareYyyy = compareYyyy; - this.analMapSheet = analMapSheet; this.analStrtDttm = analStrtDttm; this.analEndDttm = analEndDttm; this.analSec = analSec; diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/MapSheetAnalDataInferenceRepositoryImpl.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/MapSheetAnalDataInferenceRepositoryImpl.java index abb351ef..9d4cd58e 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/MapSheetAnalDataInferenceRepositoryImpl.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/MapSheetAnalDataInferenceRepositoryImpl.java @@ -1,5 +1,7 @@ package com.kamco.cd.kamcoback.postgres.repository.Inference; +import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalInferenceEntity.mapSheetAnalInferenceEntity; + import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto; import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.AnalResList; import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.AnalResSummary; @@ -9,7 +11,6 @@ import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceEntity; import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceGeomEntity; import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceEntity; import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceGeomEntity; -import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalInferenceEntity; import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalSttcEntity; import com.kamco.cd.kamcoback.postgres.entity.QModelMngBakEntity; import com.kamco.cd.kamcoback.postgres.entity.QModelVerEntity; @@ -41,8 +42,8 @@ public class MapSheetAnalDataInferenceRepositoryImpl private final JPAQueryFactory queryFactory; private final QModelMngBakEntity tmm = QModelMngBakEntity.modelMngBakEntity; private final QModelVerEntity tmv = QModelVerEntity.modelVerEntity; - private final QMapSheetAnalInferenceEntity mapSheetAnalEntity = - QMapSheetAnalInferenceEntity.mapSheetAnalInferenceEntity; + // private final QMapSheetAnalEntity mapSheetAnalEntity = + // mapSheetAnalEntity; private final QMapSheetAnalDataInferenceEntity MapSheetAnalDataInferenceEntity = QMapSheetAnalDataInferenceEntity.mapSheetAnalDataInferenceEntity; private final QMapSheetAnalDataInferenceGeomEntity MapSheetAnalDataInferenceGeomEntity = @@ -62,12 +63,12 @@ public class MapSheetAnalDataInferenceRepositoryImpl // "0000" 전체조회 BooleanBuilder builder = new BooleanBuilder(); if (searchReq.getStatCode() != null && !"0000".equals(searchReq.getStatCode())) { - builder.and(mapSheetAnalEntity.analState.eq(searchReq.getStatCode())); + builder.and(mapSheetAnalInferenceEntity.analState.eq(searchReq.getStatCode())); } // 제목 if (searchReq.getTitle() != null) { - builder.and(mapSheetAnalEntity.analTitle.like("%" + searchReq.getTitle() + "%")); + builder.and(mapSheetAnalInferenceEntity.analTitle.like("%" + searchReq.getTitle() + "%")); } List content = @@ -75,28 +76,28 @@ public class MapSheetAnalDataInferenceRepositoryImpl .select( Projections.constructor( InferenceResultDto.AnalResList.class, - mapSheetAnalEntity.id, - mapSheetAnalEntity.analTitle, - mapSheetAnalEntity.detectingCnt, - mapSheetAnalEntity.analStrtDttm, - mapSheetAnalEntity.analEndDttm, - mapSheetAnalEntity.analSec, - mapSheetAnalEntity.analPredSec, - mapSheetAnalEntity.analState, + mapSheetAnalInferenceEntity.id, + mapSheetAnalInferenceEntity.analTitle, + mapSheetAnalInferenceEntity.detectingCnt, + mapSheetAnalInferenceEntity.analStrtDttm, + mapSheetAnalInferenceEntity.analEndDttm, + mapSheetAnalInferenceEntity.analSec, + mapSheetAnalInferenceEntity.analPredSec, + mapSheetAnalInferenceEntity.analState, Expressions.stringTemplate( - "fn_code_name({0}, {1})", "0002", mapSheetAnalEntity.analState), - mapSheetAnalEntity.gukyuinUsed)) - .from(mapSheetAnalEntity) + "fn_code_name({0}, {1})", "0002", mapSheetAnalInferenceEntity.analState), + mapSheetAnalInferenceEntity.gukyuinUsed)) + .from(mapSheetAnalInferenceEntity) .where(builder) .offset(pageable.getOffset()) .limit(pageable.getPageSize()) - .orderBy(mapSheetAnalEntity.id.desc()) + .orderBy(mapSheetAnalInferenceEntity.id.desc()) .fetch(); long total = queryFactory - .select(mapSheetAnalEntity.id) - .from(mapSheetAnalEntity) + .select(mapSheetAnalInferenceEntity.id) + .from(mapSheetAnalInferenceEntity) .where(builder) .fetchCount(); @@ -122,27 +123,28 @@ public class MapSheetAnalDataInferenceRepositoryImpl .select( Projections.constructor( InferenceResultDto.AnalResSummary.class, - mapSheetAnalEntity.id, - mapSheetAnalEntity.analTitle, + mapSheetAnalInferenceEntity.id, + mapSheetAnalInferenceEntity.analTitle, tmm.modelNm.concat(" ").concat(tmv.modelVer).as("modelInfo"), - mapSheetAnalEntity.targetYyyy, - mapSheetAnalEntity.compareYyyy, - mapSheetAnalEntity.analStrtDttm, - mapSheetAnalEntity.analEndDttm, - mapSheetAnalEntity.analSec, - mapSheetAnalEntity.analPredSec, - mapSheetAnalEntity.resultUrl, - mapSheetAnalEntity.detectingCnt, - mapSheetAnalEntity.accuracy, - mapSheetAnalEntity.analState, + mapSheetAnalInferenceEntity.targetYyyy, + mapSheetAnalInferenceEntity.compareYyyy, + mapSheetAnalInferenceEntity.analStrtDttm, + mapSheetAnalInferenceEntity.analEndDttm, + mapSheetAnalInferenceEntity.analSec, + mapSheetAnalInferenceEntity.analPredSec, + mapSheetAnalInferenceEntity.resultUrl, + mapSheetAnalInferenceEntity.detectingCnt, + mapSheetAnalInferenceEntity.accuracy, + mapSheetAnalInferenceEntity.analState, Expressions.stringTemplate( - "fn_code_name({0}, {1})", "0002", mapSheetAnalEntity.analState))) - .from(mapSheetAnalEntity) + "fn_code_name({0}, {1})", + "0002", mapSheetAnalInferenceEntity.analState))) + .from(mapSheetAnalInferenceEntity) .leftJoin(tmm) - .on(mapSheetAnalEntity.modelUid.eq(tmm.id)) + .on(mapSheetAnalInferenceEntity.modelUid.eq(tmm.id)) .leftJoin(tmv) .on(tmv.modelUid.eq(tmm.id).and(tmv.id.eq(latestVerUidSub))) - .where(mapSheetAnalEntity.id.eq(id)) + .where(mapSheetAnalInferenceEntity.id.eq(id)) .fetchOne()); return content; } @@ -231,7 +233,7 @@ public class MapSheetAnalDataInferenceRepositoryImpl BooleanBuilder builder = new BooleanBuilder(); // 추론결과 id - builder.and(mapSheetAnalEntity.id.eq(id)); + builder.and(mapSheetAnalInferenceEntity.id.eq(id)); // 기준년도 분류 if (searchGeoReq.getTargetClass() != null && !searchGeoReq.getTargetClass().equals("")) { @@ -269,9 +271,9 @@ public class MapSheetAnalDataInferenceRepositoryImpl MapSheetAnalDataInferenceGeomEntity.mapSheetNum, MapSheetAnalDataInferenceGeomEntity.geom, MapSheetAnalDataInferenceGeomEntity.geomCenter)) - .from(mapSheetAnalEntity) + .from(mapSheetAnalInferenceEntity) .join(MapSheetAnalDataInferenceEntity) - .on(MapSheetAnalDataInferenceEntity.analUid.eq(mapSheetAnalEntity.id)) + .on(MapSheetAnalDataInferenceEntity.analUid.eq(mapSheetAnalInferenceEntity.id)) .join(MapSheetAnalDataInferenceGeomEntity) .on(MapSheetAnalDataInferenceGeomEntity.dataUid.eq(MapSheetAnalDataInferenceEntity.id)) .where(builder) @@ -282,9 +284,9 @@ public class MapSheetAnalDataInferenceRepositoryImpl long total = queryFactory .select(MapSheetAnalDataInferenceGeomEntity.geoUid) - .from(mapSheetAnalEntity) + .from(mapSheetAnalInferenceEntity) .join(MapSheetAnalDataInferenceEntity) - .on(MapSheetAnalDataInferenceEntity.analUid.eq(mapSheetAnalEntity.id)) + .on(MapSheetAnalDataInferenceEntity.analUid.eq(mapSheetAnalInferenceEntity.id)) .join(MapSheetAnalDataInferenceGeomEntity) .on(MapSheetAnalDataInferenceGeomEntity.dataUid.eq(MapSheetAnalDataInferenceEntity.id)) .where(builder) @@ -303,10 +305,10 @@ public class MapSheetAnalDataInferenceRepositoryImpl public List getSheets(Long id) { return queryFactory .select(MapSheetAnalDataInferenceEntity.mapSheetNum) - .from(mapSheetAnalEntity) + .from(mapSheetAnalInferenceEntity) .join(MapSheetAnalDataInferenceEntity) - .on(MapSheetAnalDataInferenceEntity.analUid.eq(mapSheetAnalEntity.id)) - .where(mapSheetAnalEntity.id.eq(id)) + .on(MapSheetAnalDataInferenceEntity.analUid.eq(mapSheetAnalInferenceEntity.id)) + .where(mapSheetAnalInferenceEntity.id.eq(id)) .groupBy(MapSheetAnalDataInferenceEntity.mapSheetNum) .fetch(); }