shp 파일 생성 수정
This commit is contained in:
@@ -71,6 +71,9 @@ public class InferenceResultShpDto {
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public static class InferenceCntDto {
|
public static class InferenceCntDto {
|
||||||
|
|
||||||
|
@Schema(description = "추론 결과(inference_results)를 기준으로 신규 목록 저장 터이터 건수", example = "120")
|
||||||
|
int sheetAnalDataCnt;
|
||||||
|
|
||||||
@Schema(description = "추론 결과(inference_results)를 기준으로 신규 저장 데이터 건수", example = "120")
|
@Schema(description = "추론 결과(inference_results)를 기준으로 신규 저장 데이터 건수", example = "120")
|
||||||
int inferenceCnt;
|
int inferenceCnt;
|
||||||
|
|
||||||
|
|||||||
@@ -20,10 +20,12 @@ public class InferenceResultShpCoreService {
|
|||||||
*/
|
*/
|
||||||
@Transactional
|
@Transactional
|
||||||
public InferenceResultShpDto.InferenceCntDto buildInferenceData() {
|
public InferenceResultShpDto.InferenceCntDto buildInferenceData() {
|
||||||
|
int sheetAnalDataCnt = repo.upsertGroupsFromMapSheetAnal();
|
||||||
int inferenceCnt = repo.upsertGroupsFromInferenceResults();
|
int inferenceCnt = repo.upsertGroupsFromInferenceResults();
|
||||||
int inferenceGeomCnt = repo.upsertGeomsFromInferenceResults();
|
int inferenceGeomCnt = repo.upsertGeomsFromInferenceResults();
|
||||||
|
|
||||||
InferenceResultShpDto.InferenceCntDto cntDto = new InferenceResultShpDto.InferenceCntDto();
|
InferenceResultShpDto.InferenceCntDto cntDto = new InferenceResultShpDto.InferenceCntDto();
|
||||||
|
cntDto.setSheetAnalDataCnt(sheetAnalDataCnt);
|
||||||
cntDto.setInferenceCnt(inferenceCnt);
|
cntDto.setInferenceCnt(inferenceCnt);
|
||||||
cntDto.setInferenceGeomCnt(inferenceGeomCnt);
|
cntDto.setInferenceGeomCnt(inferenceGeomCnt);
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import java.util.List;
|
|||||||
|
|
||||||
public interface InferenceResultRepositoryCustom {
|
public interface InferenceResultRepositoryCustom {
|
||||||
|
|
||||||
|
int upsertGroupsFromMapSheetAnal();
|
||||||
|
|
||||||
int upsertGroupsFromInferenceResults();
|
int upsertGroupsFromInferenceResults();
|
||||||
|
|
||||||
int upsertGeomsFromInferenceResults();
|
int upsertGeomsFromInferenceResults();
|
||||||
|
|||||||
@@ -31,6 +31,33 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC
|
|||||||
// Upsert (Native only)
|
// Upsert (Native only)
|
||||||
// ===============================
|
// ===============================
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int upsertGroupsFromMapSheetAnal() {
|
||||||
|
String sql =
|
||||||
|
"""
|
||||||
|
INSERT INTO tb_map_sheet_anal_inference (
|
||||||
|
compare_yyyy,
|
||||||
|
target_yyyy,
|
||||||
|
anal_map_sheet,
|
||||||
|
stage,
|
||||||
|
anal_title
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
r.input1 AS compare_yyyy,
|
||||||
|
r.input2 AS target_yyyy,
|
||||||
|
r.map_id AS anal_map_sheet,
|
||||||
|
r.stage,
|
||||||
|
CONCAT(r.stage ,'_', r.input1 ,'_', r.input2 ,'_', r.map_id) as anal_title
|
||||||
|
FROM inference_results r
|
||||||
|
GROUP BY r.stage, r.input1, r.input2, r.map_id
|
||||||
|
ON CONFLICT (compare_yyyy, target_yyyy, anal_map_sheet, stage)
|
||||||
|
DO UPDATE SET
|
||||||
|
updated_dttm = now()
|
||||||
|
""";
|
||||||
|
|
||||||
|
return em.createNativeQuery(sql).executeUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* inference_results 테이블을 기준으로 분석 데이터 단위(stage, compare_yyyy, target_yyyy, map_sheet_num)를
|
* inference_results 테이블을 기준으로 분석 데이터 단위(stage, compare_yyyy, target_yyyy, map_sheet_num)를
|
||||||
* 생성/갱신한다.
|
* 생성/갱신한다.
|
||||||
|
|||||||
Reference in New Issue
Block a user