From 5db9127f0cfe6246211aded8a46be925b6d8280b Mon Sep 17 00:00:00 2001 From: teddy Date: Fri, 6 Mar 2026 12:23:16 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=EC=B6=94=EB=A1=A0=EA=B2=B0=EA=B3=BC=20?= =?UTF-8?q?=EC=A0=80=EC=9E=A5=20result=20=EC=A1=B0=ED=9A=8C=20=EC=A0=80?= =?UTF-8?q?=EC=9E=A5=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Inference/InferenceResultRepositoryImpl.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultRepositoryImpl.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultRepositoryImpl.java index 6735fef5..4e54fac5 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultRepositoryImpl.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultRepositoryImpl.java @@ -24,7 +24,6 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC @Override public Long upsertGroupsFromMapSheetAnal(Long id) { - // id = learn 테이블 id String sql = """ INSERT INTO tb_map_sheet_anal_inference ( @@ -54,12 +53,12 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC :pendingStateId FROM tb_map_sheet_learn r WHERE r.id = :id - ON CONFLICT (learn_id, compare_yyyy, target_yyyy) + ON CONFLICT (stage, compare_yyyy, target_yyyy) DO UPDATE SET detecting_cnt = EXCLUDED.detecting_cnt, anal_title = EXCLUDED.anal_title, - stage = EXCLUDED.stage, - updated_dttm = now() + updated_dttm = now(), + learn_id = EXCLUDED.learn_id RETURNING anal_uid """; @@ -118,8 +117,9 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC msl.target_yyyy, r.map_id, msl.stage - ON CONFLICT (anal_uid, compare_yyyy, target_yyyy, map_sheet_num) + ON CONFLICT (stage, compare_yyyy, target_yyyy, map_sheet_num) DO UPDATE SET + anal_uid = EXCLUDED.anal_uid, ref_map_sheet_num = EXCLUDED.ref_map_sheet_num, updated_dttm = now() """; @@ -212,9 +212,6 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC AND r.map_id ~ '^[0-9]+$' AND r.map_id::bigint = msadi.map_sheet_num WHERE msl.anal_uid = :analUid - AND r.probability is not null - AND r.before_c is not null - AND r.before_p is not null AND r.after_c is not null AND r.after_p is not null ORDER BY r.uid, r.created_date DESC NULLS LAST From 206dba6ff9532bfb062e7be23fc9d1f5ef6d462d Mon Sep 17 00:00:00 2001 From: teddy Date: Fri, 6 Mar 2026 12:24:52 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=EC=B6=94=EB=A1=A0=EA=B2=B0=EA=B3=BC=20?= =?UTF-8?q?=EC=A0=80=EC=9E=A5=20result=20=EC=A1=B0=ED=9A=8C=20=EC=A1=B0?= =?UTF-8?q?=EA=B1=B4=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/Inference/InferenceResultRepositoryImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultRepositoryImpl.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultRepositoryImpl.java index 4e54fac5..d4948c5d 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultRepositoryImpl.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultRepositoryImpl.java @@ -214,6 +214,9 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC WHERE msl.anal_uid = :analUid AND r.after_c is not null AND r.after_p is not null + AND r.probability is not null + AND r.before_c is not null + AND r.before_p is not null ORDER BY r.uid, r.created_date DESC NULLS LAST ) x ON CONFLICT (result_uid)