Merge pull request 'feat/dev_251201' (#156) from feat/dev_251201 into develop

Reviewed-on: https://kamco.gitea.gs.dabeeo.com/dabeeo/kamco-dabeeo-backoffice/pulls/156
This commit is contained in:
2026-01-07 16:23:36 +09:00
6 changed files with 91 additions and 69 deletions

View File

@@ -11,7 +11,10 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.transaction.Transactional; import jakarta.transaction.Transactional;
import java.util.List; import java.util.List;
import lombok.RequiredArgsConstructor; 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") @Tag(name = "변화탐지", description = "변화탐지 API")
@RequiredArgsConstructor @RequiredArgsConstructor
@@ -43,7 +46,7 @@ public class ChangeDetectionApiController {
@Operation(summary = "변화탐지 분류별 건수", description = "변화탐지 분류별 건수") @Operation(summary = "변화탐지 분류별 건수", description = "변화탐지 분류별 건수")
@GetMapping("/class-count") @GetMapping("/class-count")
public ApiResponseDto<List<ChangeDetectionDto.CountDto>> getChangeDetectionClassCount( public ApiResponseDto<List<ChangeDetectionDto.CountDto>> getChangeDetectionClassCount(
@Parameter(description = "변화탐지 년도(차수) /year-list 의 analUid", example = "1") @RequestParam @Parameter(description = "변화탐지 년도(차수) /year-list 의 analUid", example = "53") @RequestParam
Long id, Long id,
@Parameter(description = "탐지된 도엽번호", example = "34602060") @RequestParam String mapSheetNum) { @Parameter(description = "탐지된 도엽번호", example = "34602060") @RequestParam String mapSheetNum) {
return ApiResponseDto.ok(changeDetectionService.getChangeDetectionClassCount(id, mapSheetNum)); return ApiResponseDto.ok(changeDetectionService.getChangeDetectionClassCount(id, mapSheetNum));
@@ -54,7 +57,7 @@ public class ChangeDetectionApiController {
public ApiResponseDto<ChangeDetectionDto.CogUrlDto> getChangeDetectionCogUrl( public ApiResponseDto<ChangeDetectionDto.CogUrlDto> getChangeDetectionCogUrl(
@Parameter(description = "이전 년도", example = "2023") @RequestParam Integer beforeYear, @Parameter(description = "이전 년도", example = "2023") @RequestParam Integer beforeYear,
@Parameter(description = "이후 년도", example = "2024") @RequestParam Integer afterYear, @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 = ChangeDetectionDto.CogUrlReq req =
new ChangeDetectionDto.CogUrlReq(beforeYear, afterYear, mapSheetNum); new ChangeDetectionDto.CogUrlReq(beforeYear, afterYear, mapSheetNum);
return ApiResponseDto.ok(changeDetectionService.getChangeDetectionCogUrl(req)); return ApiResponseDto.ok(changeDetectionService.getChangeDetectionCogUrl(req));
@@ -69,15 +72,15 @@ public class ChangeDetectionApiController {
@Operation(summary = "변화탐지 탐지된 도엽 목록", description = "변화탐지 탐지된 도엽 목록") @Operation(summary = "변화탐지 탐지된 도엽 목록", description = "변화탐지 탐지된 도엽 목록")
@GetMapping("/map-list") @GetMapping("/map-list")
public ApiResponseDto<List<ChangeDetectionDto.MapSheetList>> getChangeDetectionMapSheetList( public ApiResponseDto<List<ChangeDetectionDto.MapSheetList>> getChangeDetectionMapSheetList(
@Parameter(description = "도목록 id", example = "1") @RequestParam Long analUid) { @Parameter(description = "목록 그룹id", example = "1") @RequestParam Long analUid) {
return ApiResponseDto.ok(changeDetectionService.getChangeDetectionMapSheetList(analUid)); return ApiResponseDto.ok(changeDetectionService.getChangeDetectionMapSheetList(analUid));
} }
@Operation(summary = "변화탐지 결과 Polygon", description = "변화탐지 결과 Polygon") @Operation(summary = "변화탐지 결과 Polygon", description = "변화탐지 결과 Polygon")
@GetMapping("/polygon") @GetMapping("/polygon")
public ApiResponseDto<ChangeDetectionDto.PolygonFeatureList> getChangeDetectionPolygonList( public ApiResponseDto<ChangeDetectionDto.PolygonFeatureList> getChangeDetectionPolygonList(
@Parameter(description = "년도목록 id", example = "1") @RequestParam Long analUid, @Parameter(description = "년도목록 id", example = "53") @RequestParam Long analUid,
@Parameter(description = "도엽번호", example = "34602060") @RequestParam String mapSheetNum) { @Parameter(description = "도엽번호", example = "35905086") @RequestParam String mapSheetNum) {
return ApiResponseDto.ok( return ApiResponseDto.ok(
changeDetectionService.getChangeDetectionPolygonList(analUid, mapSheetNum)); changeDetectionService.getChangeDetectionPolygonList(analUid, mapSheetNum));
} }
@@ -85,8 +88,8 @@ public class ChangeDetectionApiController {
@Operation(summary = "변화탐지 결과 Point", description = "변화탐지 결과 Point") @Operation(summary = "변화탐지 결과 Point", description = "변화탐지 결과 Point")
@GetMapping("/point") @GetMapping("/point")
public ApiResponseDto<ChangeDetectionDto.PointFeatureList> getChangeDetectionPointList( public ApiResponseDto<ChangeDetectionDto.PointFeatureList> getChangeDetectionPointList(
@Parameter(description = "년도목록 id", example = "1") @RequestParam Long analUid, @Parameter(description = "년도목록 id", example = "53") @RequestParam Long analUid,
@Parameter(description = "도엽번호", example = "34602060") @RequestParam String mapSheetNum) { @Parameter(description = "도엽번호", example = "35905086") @RequestParam String mapSheetNum) {
return ApiResponseDto.ok( return ApiResponseDto.ok(
changeDetectionService.getChangeDetectionPointList(analUid, mapSheetNum)); changeDetectionService.getChangeDetectionPointList(analUid, mapSheetNum));
} }

View File

@@ -75,7 +75,7 @@ public class InferenceResultApiController {
}) })
@GetMapping("/summary/{id}") @GetMapping("/summary/{id}")
public ApiResponseDto<InferenceResultDto.AnalResSummary> getInferenceResultSummary( public ApiResponseDto<InferenceResultDto.AnalResSummary> getInferenceResultSummary(
@Parameter(description = "목록 id", example = "1") @PathVariable Long id) { @Parameter(description = "목록 id", example = "53") @PathVariable Long id) {
return ApiResponseDto.ok(inferenceResultService.getInferenceResultSummary(id)); return ApiResponseDto.ok(inferenceResultService.getInferenceResultSummary(id));
} }
@@ -94,7 +94,7 @@ public class InferenceResultApiController {
}) })
@GetMapping("/detail/{id}") @GetMapping("/detail/{id}")
public ApiResponseDto<InferenceResultDto.Detail> getInferenceDetail( public ApiResponseDto<InferenceResultDto.Detail> getInferenceDetail(
@Parameter(description = "목록 id", example = "1") @PathVariable Long id) { @Parameter(description = "목록 id", example = "53") @PathVariable Long id) {
return ApiResponseDto.ok(inferenceResultService.getDetail(id)); return ApiResponseDto.ok(inferenceResultService.getDetail(id));
} }
@@ -113,7 +113,7 @@ public class InferenceResultApiController {
}) })
@GetMapping("/geom/{id}") @GetMapping("/geom/{id}")
public ApiResponseDto<Page<InferenceResultDto.Geom>> getInferenceResultGeomList( public ApiResponseDto<Page<InferenceResultDto.Geom>> getInferenceResultGeomList(
@Parameter(description = "분석결과 id", example = "1") @PathVariable Long id, @Parameter(description = "분석결과 id", example = "53") @PathVariable Long id,
@Parameter(description = "기준년도 분류", example = "land") @RequestParam(required = false) @Parameter(description = "기준년도 분류", example = "land") @RequestParam(required = false)
String targetClass, String targetClass,
@Parameter(description = "비교년도 분류", example = "waste") @RequestParam(required = false) @Parameter(description = "비교년도 분류", example = "waste") @RequestParam(required = false)

View File

@@ -2,6 +2,9 @@ package com.kamco.cd.kamcoback.inference.dto;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.kamco.cd.kamcoback.common.enums.DetectionClassification; import com.kamco.cd.kamcoback.common.enums.DetectionClassification;
import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm; import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@@ -12,7 +15,6 @@ import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
import org.locationtech.jts.geom.Geometry;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
@@ -58,7 +60,6 @@ public class InferenceResultDto {
private Long id; private Long id;
private String analTitle; private String analTitle;
private String analMapSheet;
private Long detectingCnt; private Long detectingCnt;
@JsonFormatDttm private ZonedDateTime analStrtDttm; @JsonFormatDttm private ZonedDateTime analStrtDttm;
@JsonFormatDttm private ZonedDateTime analEndDttm; @JsonFormatDttm private ZonedDateTime analEndDttm;
@@ -71,7 +72,6 @@ public class InferenceResultDto {
public AnalResList( public AnalResList(
Long id, Long id,
String analTitle, String analTitle,
String analMapSheet,
Long detectingCnt, Long detectingCnt,
ZonedDateTime analStrtDttm, ZonedDateTime analStrtDttm,
ZonedDateTime analEndDttm, ZonedDateTime analEndDttm,
@@ -82,7 +82,6 @@ public class InferenceResultDto {
String gukyuinUsed) { String gukyuinUsed) {
this.id = id; this.id = id;
this.analTitle = analTitle; this.analTitle = analTitle;
this.analMapSheet = analMapSheet;
this.detectingCnt = detectingCnt; this.detectingCnt = detectingCnt;
this.analStrtDttm = analStrtDttm; this.analStrtDttm = analStrtDttm;
this.analEndDttm = analEndDttm; this.analEndDttm = analEndDttm;
@@ -103,7 +102,6 @@ public class InferenceResultDto {
private String modelInfo; private String modelInfo;
private Integer targetYyyy; private Integer targetYyyy;
private Integer compareYyyy; private Integer compareYyyy;
private String analMapSheet;
@JsonFormatDttm private ZonedDateTime analStrtDttm; @JsonFormatDttm private ZonedDateTime analStrtDttm;
@JsonFormatDttm private ZonedDateTime analEndDttm; @JsonFormatDttm private ZonedDateTime analEndDttm;
private Long analSec; private Long analSec;
@@ -120,7 +118,6 @@ public class InferenceResultDto {
String modelInfo, String modelInfo,
Integer targetYyyy, Integer targetYyyy,
Integer compareYyyy, Integer compareYyyy,
String analMapSheet,
ZonedDateTime analStrtDttm, ZonedDateTime analStrtDttm,
ZonedDateTime analEndDttm, ZonedDateTime analEndDttm,
Long analSec, Long analSec,
@@ -135,7 +132,6 @@ public class InferenceResultDto {
this.modelInfo = modelInfo; this.modelInfo = modelInfo;
this.targetYyyy = targetYyyy; this.targetYyyy = targetYyyy;
this.compareYyyy = compareYyyy; this.compareYyyy = compareYyyy;
this.analMapSheet = analMapSheet;
this.analStrtDttm = analStrtDttm; this.analStrtDttm = analStrtDttm;
this.analEndDttm = analEndDttm; this.analEndDttm = analEndDttm;
this.analSec = analSec; this.analSec = analSec;
@@ -304,8 +300,10 @@ public class InferenceResultDto {
String classAfterName; String classAfterName;
Double classAfterProb; Double classAfterProb;
Long mapSheetNum; Long mapSheetNum;
Geometry gemo; @JsonIgnore String gemoStr;
Geometry geomCenter; @JsonIgnore String geomCenterStr;
JsonNode gemo;
JsonNode geomCenter;
public Geom( public Geom(
Integer compareYyyy, Integer compareYyyy,
@@ -315,8 +313,8 @@ public class InferenceResultDto {
String classAfterCd, String classAfterCd,
Double classAfterProb, Double classAfterProb,
Long mapSheetNum, Long mapSheetNum,
Geometry gemo, String gemoStr,
Geometry geomCenter) { String geomCenterStr) {
this.compareYyyy = compareYyyy; this.compareYyyy = compareYyyy;
this.targetYyyy = targetYyyy; this.targetYyyy = targetYyyy;
this.classBeforeCd = classBeforeCd; this.classBeforeCd = classBeforeCd;
@@ -326,8 +324,20 @@ public class InferenceResultDto {
this.classAfterName = DetectionClassification.fromString(classAfterCd).getDesc(); this.classAfterName = DetectionClassification.fromString(classAfterCd).getDesc();
this.classAfterProb = classAfterProb; this.classAfterProb = classAfterProb;
this.mapSheetNum = mapSheetNum; this.mapSheetNum = mapSheetNum;
this.gemo = gemo; this.gemoStr = gemoStr;
this.geomCenter = geomCenter; this.geomCenterStr = geomCenterStr;
ObjectMapper mapper = new ObjectMapper();
JsonNode geomJson;
JsonNode geomCenterJson;
try {
geomJson = mapper.readTree(gemoStr);
geomCenterJson = mapper.readTree(geomCenterStr);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
this.gemo = geomJson;
this.geomCenter = geomCenterJson;
} }
} }

View File

@@ -142,6 +142,7 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC
class_after_cd, class_after_cd,
class_after_prob, class_after_prob,
geom, geom,
geom_center,
area, area,
data_uid, data_uid,
file_created_yn, file_created_yn,
@@ -160,6 +161,7 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC
x.class_after_cd, x.class_after_cd,
x.class_after_prob, x.class_after_prob,
x.geom, x.geom,
ST_Centroid(x.geom),
x.area, x.area,
x.data_uid, x.data_uid,
false, false,

View File

@@ -1,5 +1,7 @@
package com.kamco.cd.kamcoback.postgres.repository.Inference; 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;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.AnalResList; import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.AnalResList;
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.AnalResSummary; 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.MapSheetAnalDataInferenceGeomEntity;
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceEntity; import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceEntity;
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceGeomEntity; 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.QMapSheetAnalSttcEntity;
import com.kamco.cd.kamcoback.postgres.entity.QModelMngBakEntity; import com.kamco.cd.kamcoback.postgres.entity.QModelMngBakEntity;
import com.kamco.cd.kamcoback.postgres.entity.QModelVerEntity; import com.kamco.cd.kamcoback.postgres.entity.QModelVerEntity;
@@ -41,8 +42,8 @@ public class MapSheetAnalDataInferenceRepositoryImpl
private final JPAQueryFactory queryFactory; private final JPAQueryFactory queryFactory;
private final QModelMngBakEntity tmm = QModelMngBakEntity.modelMngBakEntity; private final QModelMngBakEntity tmm = QModelMngBakEntity.modelMngBakEntity;
private final QModelVerEntity tmv = QModelVerEntity.modelVerEntity; private final QModelVerEntity tmv = QModelVerEntity.modelVerEntity;
private final QMapSheetAnalInferenceEntity mapSheetAnalEntity = // private final QMapSheetAnalEntity mapSheetAnalEntity =
QMapSheetAnalInferenceEntity.mapSheetAnalInferenceEntity; // mapSheetAnalEntity;
private final QMapSheetAnalDataInferenceEntity MapSheetAnalDataInferenceEntity = private final QMapSheetAnalDataInferenceEntity MapSheetAnalDataInferenceEntity =
QMapSheetAnalDataInferenceEntity.mapSheetAnalDataInferenceEntity; QMapSheetAnalDataInferenceEntity.mapSheetAnalDataInferenceEntity;
private final QMapSheetAnalDataInferenceGeomEntity MapSheetAnalDataInferenceGeomEntity = private final QMapSheetAnalDataInferenceGeomEntity MapSheetAnalDataInferenceGeomEntity =
@@ -62,12 +63,12 @@ public class MapSheetAnalDataInferenceRepositoryImpl
// "0000" 전체조회 // "0000" 전체조회
BooleanBuilder builder = new BooleanBuilder(); BooleanBuilder builder = new BooleanBuilder();
if (searchReq.getStatCode() != null && !"0000".equals(searchReq.getStatCode())) { 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) { if (searchReq.getTitle() != null) {
builder.and(mapSheetAnalEntity.analTitle.like("%" + searchReq.getTitle() + "%")); builder.and(mapSheetAnalInferenceEntity.analTitle.like("%" + searchReq.getTitle() + "%"));
} }
List<AnalResList> content = List<AnalResList> content =
@@ -75,28 +76,28 @@ public class MapSheetAnalDataInferenceRepositoryImpl
.select( .select(
Projections.constructor( Projections.constructor(
InferenceResultDto.AnalResList.class, InferenceResultDto.AnalResList.class,
mapSheetAnalEntity.id, mapSheetAnalInferenceEntity.id,
mapSheetAnalEntity.analTitle, mapSheetAnalInferenceEntity.analTitle,
mapSheetAnalEntity.detectingCnt, mapSheetAnalInferenceEntity.detectingCnt,
mapSheetAnalEntity.analStrtDttm, mapSheetAnalInferenceEntity.analStrtDttm,
mapSheetAnalEntity.analEndDttm, mapSheetAnalInferenceEntity.analEndDttm,
mapSheetAnalEntity.analSec, mapSheetAnalInferenceEntity.analSec,
mapSheetAnalEntity.analPredSec, mapSheetAnalInferenceEntity.analPredSec,
mapSheetAnalEntity.analState, mapSheetAnalInferenceEntity.analState,
Expressions.stringTemplate( Expressions.stringTemplate(
"fn_code_name({0}, {1})", "0002", mapSheetAnalEntity.analState), "fn_code_name({0}, {1})", "0002", mapSheetAnalInferenceEntity.analState),
mapSheetAnalEntity.gukyuinUsed)) mapSheetAnalInferenceEntity.gukyuinUsed))
.from(mapSheetAnalEntity) .from(mapSheetAnalInferenceEntity)
.where(builder) .where(builder)
.offset(pageable.getOffset()) .offset(pageable.getOffset())
.limit(pageable.getPageSize()) .limit(pageable.getPageSize())
.orderBy(mapSheetAnalEntity.id.desc()) .orderBy(mapSheetAnalInferenceEntity.id.desc())
.fetch(); .fetch();
long total = long total =
queryFactory queryFactory
.select(mapSheetAnalEntity.id) .select(mapSheetAnalInferenceEntity.id)
.from(mapSheetAnalEntity) .from(mapSheetAnalInferenceEntity)
.where(builder) .where(builder)
.fetchCount(); .fetchCount();
@@ -122,27 +123,28 @@ public class MapSheetAnalDataInferenceRepositoryImpl
.select( .select(
Projections.constructor( Projections.constructor(
InferenceResultDto.AnalResSummary.class, InferenceResultDto.AnalResSummary.class,
mapSheetAnalEntity.id, mapSheetAnalInferenceEntity.id,
mapSheetAnalEntity.analTitle, mapSheetAnalInferenceEntity.analTitle,
tmm.modelNm.concat(" ").concat(tmv.modelVer).as("modelInfo"), tmm.modelNm.concat(" ").concat(tmv.modelVer).as("modelInfo"),
mapSheetAnalEntity.targetYyyy, mapSheetAnalInferenceEntity.targetYyyy,
mapSheetAnalEntity.compareYyyy, mapSheetAnalInferenceEntity.compareYyyy,
mapSheetAnalEntity.analStrtDttm, mapSheetAnalInferenceEntity.analStrtDttm,
mapSheetAnalEntity.analEndDttm, mapSheetAnalInferenceEntity.analEndDttm,
mapSheetAnalEntity.analSec, mapSheetAnalInferenceEntity.analSec,
mapSheetAnalEntity.analPredSec, mapSheetAnalInferenceEntity.analPredSec,
mapSheetAnalEntity.resultUrl, mapSheetAnalInferenceEntity.resultUrl,
mapSheetAnalEntity.detectingCnt, mapSheetAnalInferenceEntity.detectingCnt,
mapSheetAnalEntity.accuracy, mapSheetAnalInferenceEntity.accuracy,
mapSheetAnalEntity.analState, mapSheetAnalInferenceEntity.analState,
Expressions.stringTemplate( Expressions.stringTemplate(
"fn_code_name({0}, {1})", "0002", mapSheetAnalEntity.analState))) "fn_code_name({0}, {1})",
.from(mapSheetAnalEntity) "0002", mapSheetAnalInferenceEntity.analState)))
.from(mapSheetAnalInferenceEntity)
.leftJoin(tmm) .leftJoin(tmm)
.on(mapSheetAnalEntity.modelUid.eq(tmm.id)) .on(mapSheetAnalInferenceEntity.modelUid.eq(tmm.id))
.leftJoin(tmv) .leftJoin(tmv)
.on(tmv.modelUid.eq(tmm.id).and(tmv.id.eq(latestVerUidSub))) .on(tmv.modelUid.eq(tmm.id).and(tmv.id.eq(latestVerUidSub)))
.where(mapSheetAnalEntity.id.eq(id)) .where(mapSheetAnalInferenceEntity.id.eq(id))
.fetchOne()); .fetchOne());
return content; return content;
} }
@@ -231,7 +233,7 @@ public class MapSheetAnalDataInferenceRepositoryImpl
BooleanBuilder builder = new BooleanBuilder(); BooleanBuilder builder = new BooleanBuilder();
// 추론결과 id // 추론결과 id
builder.and(mapSheetAnalEntity.id.eq(id)); builder.and(mapSheetAnalInferenceEntity.id.eq(id));
// 기준년도 분류 // 기준년도 분류
if (searchGeoReq.getTargetClass() != null && !searchGeoReq.getTargetClass().equals("")) { if (searchGeoReq.getTargetClass() != null && !searchGeoReq.getTargetClass().equals("")) {
@@ -267,11 +269,16 @@ public class MapSheetAnalDataInferenceRepositoryImpl
MapSheetAnalDataInferenceGeomEntity.classAfterCd, MapSheetAnalDataInferenceGeomEntity.classAfterCd,
MapSheetAnalDataInferenceGeomEntity.classAfterProb, MapSheetAnalDataInferenceGeomEntity.classAfterProb,
MapSheetAnalDataInferenceGeomEntity.mapSheetNum, MapSheetAnalDataInferenceGeomEntity.mapSheetNum,
MapSheetAnalDataInferenceGeomEntity.geom, Expressions.stringTemplate(
MapSheetAnalDataInferenceGeomEntity.geomCenter)) "ST_AsGeoJSON({0})", MapSheetAnalDataInferenceGeomEntity.geom),
.from(mapSheetAnalEntity) Expressions.stringTemplate(
"ST_AsGeoJSON({0})", MapSheetAnalDataInferenceGeomEntity.geomCenter)
// MapSheetAnalDataInferenceGeomEntity.geom,
// MapSheetAnalDataInferenceGeomEntity.geomCenter)
))
.from(mapSheetAnalInferenceEntity)
.join(MapSheetAnalDataInferenceEntity) .join(MapSheetAnalDataInferenceEntity)
.on(MapSheetAnalDataInferenceEntity.analUid.eq(mapSheetAnalEntity.id)) .on(MapSheetAnalDataInferenceEntity.analUid.eq(mapSheetAnalInferenceEntity.id))
.join(MapSheetAnalDataInferenceGeomEntity) .join(MapSheetAnalDataInferenceGeomEntity)
.on(MapSheetAnalDataInferenceGeomEntity.dataUid.eq(MapSheetAnalDataInferenceEntity.id)) .on(MapSheetAnalDataInferenceGeomEntity.dataUid.eq(MapSheetAnalDataInferenceEntity.id))
.where(builder) .where(builder)
@@ -282,9 +289,9 @@ public class MapSheetAnalDataInferenceRepositoryImpl
long total = long total =
queryFactory queryFactory
.select(MapSheetAnalDataInferenceGeomEntity.geoUid) .select(MapSheetAnalDataInferenceGeomEntity.geoUid)
.from(mapSheetAnalEntity) .from(mapSheetAnalInferenceEntity)
.join(MapSheetAnalDataInferenceEntity) .join(MapSheetAnalDataInferenceEntity)
.on(MapSheetAnalDataInferenceEntity.analUid.eq(mapSheetAnalEntity.id)) .on(MapSheetAnalDataInferenceEntity.analUid.eq(mapSheetAnalInferenceEntity.id))
.join(MapSheetAnalDataInferenceGeomEntity) .join(MapSheetAnalDataInferenceGeomEntity)
.on(MapSheetAnalDataInferenceGeomEntity.dataUid.eq(MapSheetAnalDataInferenceEntity.id)) .on(MapSheetAnalDataInferenceGeomEntity.dataUid.eq(MapSheetAnalDataInferenceEntity.id))
.where(builder) .where(builder)
@@ -303,10 +310,10 @@ public class MapSheetAnalDataInferenceRepositoryImpl
public List<Long> getSheets(Long id) { public List<Long> getSheets(Long id) {
return queryFactory return queryFactory
.select(MapSheetAnalDataInferenceEntity.mapSheetNum) .select(MapSheetAnalDataInferenceEntity.mapSheetNum)
.from(mapSheetAnalEntity) .from(mapSheetAnalInferenceEntity)
.join(MapSheetAnalDataInferenceEntity) .join(MapSheetAnalDataInferenceEntity)
.on(MapSheetAnalDataInferenceEntity.analUid.eq(mapSheetAnalEntity.id)) .on(MapSheetAnalDataInferenceEntity.analUid.eq(mapSheetAnalInferenceEntity.id))
.where(mapSheetAnalEntity.id.eq(id)) .where(mapSheetAnalInferenceEntity.id.eq(id))
.groupBy(MapSheetAnalDataInferenceEntity.mapSheetNum) .groupBy(MapSheetAnalDataInferenceEntity.mapSheetNum)
.fetch(); .fetch();
} }