추론결과 저장 result 조회 저장 테스트

This commit is contained in:
2026-03-06 12:23:16 +09:00
parent 6dde4cd891
commit 5db9127f0c

View File

@@ -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