[KC-103] 추론 실패 도엽별저장
[KC-99] 추론결과 geom 상세 uid 추가
This commit is contained in:
@@ -426,4 +426,15 @@ public class InferenceResultCoreService {
|
||||
inferenceResultRepository.upsertGeomsFromInferenceResults(analId);
|
||||
inferenceResultRepository.upsertSttcFromInferenceResults(analId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 모델별 도엽별 실패여부 저장
|
||||
*
|
||||
* @param uuid learn 테이블 uuid
|
||||
* @param failMapIds 실패한 도엽 목록
|
||||
* @param type 모델타입
|
||||
*/
|
||||
public void saveFail5k(UUID uuid, List<Long> failMapIds, String type) {
|
||||
mapSheetLearn5kRepository.saveFail5k(uuid, failMapIds, type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,6 +156,9 @@ public class MapSheetAnalDataInferenceGeomEntity {
|
||||
@Column(name = "pass_yn_dttm")
|
||||
private ZonedDateTime passYnDttm;
|
||||
|
||||
@Column(name = "result_uid")
|
||||
private String resultUid;
|
||||
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@JoinColumn(name = "map_5k_id", referencedColumnName = "fid")
|
||||
private MapInkx5kEntity map5k;
|
||||
|
||||
@@ -54,4 +54,13 @@ public class MapSheetLearn5kEntity {
|
||||
|
||||
@Column(name = "is_success")
|
||||
private Boolean isSuccess = false;
|
||||
|
||||
@Column(name = "is_m1_fail")
|
||||
private Boolean isM1Fail = false;
|
||||
|
||||
@Column(name = "is_m2_fail")
|
||||
private Boolean isM2Fail = false;
|
||||
|
||||
@Column(name = "is_m3_fail")
|
||||
private Boolean isM3Fail = false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
package com.kamco.cd.kamcoback.postgres.repository.Inference;
|
||||
|
||||
public interface MapSheetLearn5kRepositoryCustom {}
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface MapSheetLearn5kRepositoryCustom {
|
||||
|
||||
void saveFail5k(UUID uuid, List<Long> failMapIds, String type);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,62 @@
|
||||
package com.kamco.cd.kamcoback.postgres.repository.Inference;
|
||||
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearn5kEntity.mapSheetLearn5kEntity;
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity.mapSheetLearnEntity;
|
||||
|
||||
import com.querydsl.core.types.dsl.BooleanPath;
|
||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class MapSheetLearn5kRepositoryImpl implements MapSheetLearn5kRepositoryCustom {}
|
||||
@RequiredArgsConstructor
|
||||
public class MapSheetLearn5kRepositoryImpl implements MapSheetLearn5kRepositoryCustom {
|
||||
|
||||
private final JPAQueryFactory queryFactory;
|
||||
|
||||
@Override
|
||||
public void saveFail5k(UUID uuid, List<Long> failMapIds, String type) {
|
||||
if (failMapIds == null || failMapIds.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Long id =
|
||||
queryFactory
|
||||
.select(mapSheetLearnEntity.id)
|
||||
.from(mapSheetLearnEntity)
|
||||
.where(mapSheetLearnEntity.uuid.eq(uuid))
|
||||
.fetchOne();
|
||||
|
||||
if (id == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
BooleanPath target;
|
||||
|
||||
switch (type) {
|
||||
case "M1":
|
||||
target = mapSheetLearn5kEntity.isM1Fail;
|
||||
break;
|
||||
case "M2":
|
||||
target = mapSheetLearn5kEntity.isM2Fail;
|
||||
break;
|
||||
case "M3":
|
||||
target = mapSheetLearn5kEntity.isM3Fail;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
queryFactory
|
||||
.update(mapSheetLearn5kEntity)
|
||||
.set(target, true)
|
||||
.where(
|
||||
mapSheetLearn5kEntity
|
||||
.learn
|
||||
.id
|
||||
.eq(id)
|
||||
.and(mapSheetLearn5kEntity.mapSheetNum.in(failMapIds)))
|
||||
.execute();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -403,6 +403,7 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
||||
Projections.constructor(
|
||||
Geom.class,
|
||||
mapSheetAnalDataInferenceGeomEntity.uuid,
|
||||
mapSheetAnalDataInferenceGeomEntity.resultUid,
|
||||
mapSheetAnalDataInferenceGeomEntity.compareYyyy,
|
||||
mapSheetAnalDataInferenceGeomEntity.targetYyyy,
|
||||
mapSheetAnalDataInferenceGeomEntity.cdProb,
|
||||
|
||||
Reference in New Issue
Block a user