From 01d1745762454226d53d4610dbc2b108794da418 Mon Sep 17 00:00:00 2001 From: "gayoun.park" Date: Wed, 21 Jan 2026 09:52:51 +0900 Subject: [PATCH] =?UTF-8?q?=EB=9D=BC=EB=B2=A8=EB=A7=81=ED=88=B4=20?= =?UTF-8?q?=EA=B8=B0=EB=B3=B8=20=ED=8E=98=EC=9D=B4=EC=A7=95=20=EA=B3=84?= =?UTF-8?q?=EC=82=B0=20=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TrainingDataLabelRepositoryImpl.java | 33 +++++++++++++---- .../TrainingDataReviewRepositoryImpl.java | 37 +++++++++++++++---- 2 files changed, 56 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/trainingdata/TrainingDataLabelRepositoryImpl.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/trainingdata/TrainingDataLabelRepositoryImpl.java index 0aade587..c7259da1 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/trainingdata/TrainingDataLabelRepositoryImpl.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/trainingdata/TrainingDataLabelRepositoryImpl.java @@ -616,7 +616,9 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport .select( labelingAssignmentEntity.assignmentUid, labelingAssignmentEntity.createdDate, - labelingAssignmentEntity.inferenceGeomUid) + labelingAssignmentEntity.inferenceGeomUid, + mapSheetAnalInferenceEntity.targetYyyy, + mapSheetAnalInferenceEntity.compareYyyy) .from(labelingAssignmentEntity) .innerJoin(mapSheetAnalInferenceEntity) .on(labelingAssignmentEntity.analUid.eq(mapSheetAnalInferenceEntity.id)) @@ -641,21 +643,38 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport UUID firstAssignedUid = firstAssigned.get(labelingAssignmentEntity.assignmentUid); ZonedDateTime createdDttm = firstAssigned.get(labelingAssignmentEntity.createdDate); Long inferenceGeomUid = firstAssigned.get(labelingAssignmentEntity.inferenceGeomUid); + Integer targetYyyy = firstAssigned.get(mapSheetAnalInferenceEntity.targetYyyy); + Integer compareYyyy = firstAssigned.get(mapSheetAnalInferenceEntity.compareYyyy); BooleanExpression beforeCondition = - labelingAssignmentEntity - .createdDate - .lt(createdDttm) + mapSheetAnalInferenceEntity + .targetYyyy + .lt(targetYyyy) .or( - labelingAssignmentEntity - .createdDate - .eq(createdDttm) + mapSheetAnalInferenceEntity + .targetYyyy + .eq(targetYyyy) + .and(mapSheetAnalInferenceEntity.compareYyyy.lt(compareYyyy))) + .or( + mapSheetAnalInferenceEntity + .targetYyyy + .eq(targetYyyy) + .and(mapSheetAnalInferenceEntity.compareYyyy.eq(compareYyyy)) + .and(labelingAssignmentEntity.createdDate.lt(createdDttm))) + .or( + mapSheetAnalInferenceEntity + .targetYyyy + .eq(targetYyyy) + .and(mapSheetAnalInferenceEntity.compareYyyy.eq(compareYyyy)) + .and(labelingAssignmentEntity.createdDate.eq(createdDttm)) .and(labelingAssignmentEntity.inferenceGeomUid.lt(inferenceGeomUid))); Long beforeCnt = queryFactory .select(labelingAssignmentEntity.count()) .from(labelingAssignmentEntity) + .innerJoin(mapSheetAnalInferenceEntity) + .on(mapSheetAnalInferenceEntity.id.eq(labelingAssignmentEntity.analUid)) .where( labelingAssignmentEntity.workerUid.eq(userId), beforeCondition.and(stateCondition)) .fetchOne(); diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/trainingdata/TrainingDataReviewRepositoryImpl.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/trainingdata/TrainingDataReviewRepositoryImpl.java index ba9e36ab..295eb0b4 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/trainingdata/TrainingDataReviewRepositoryImpl.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/trainingdata/TrainingDataReviewRepositoryImpl.java @@ -645,8 +645,12 @@ public class TrainingDataReviewRepositoryImpl extends QuerydslRepositorySupport .select( labelingAssignmentEntity.assignmentUid, labelingAssignmentEntity.createdDate, - labelingAssignmentEntity.inferenceGeomUid) + labelingAssignmentEntity.inferenceGeomUid, + mapSheetAnalInferenceEntity.targetYyyy, + mapSheetAnalInferenceEntity.compareYyyy) .from(labelingAssignmentEntity) + .innerJoin(mapSheetAnalInferenceEntity) + .on(labelingAssignmentEntity.analUid.eq(mapSheetAnalInferenceEntity.id)) .where( labelingAssignmentEntity.inspectorUid.eq(userId), stateCondition, @@ -654,6 +658,8 @@ public class TrainingDataReviewRepositoryImpl extends QuerydslRepositorySupport ? labelingAssignmentEntity.inspectState.eq(InspectState.UNCONFIRM.getId()) : labelingAssignmentEntity.assignmentUid.eq(UUID.fromString(operatorUid))) .orderBy( + mapSheetAnalInferenceEntity.targetYyyy.asc(), + mapSheetAnalInferenceEntity.compareYyyy.asc(), labelingAssignmentEntity.createdDate.asc(), labelingAssignmentEntity.inferenceGeomUid.asc()) .limit(1) @@ -666,21 +672,38 @@ public class TrainingDataReviewRepositoryImpl extends QuerydslRepositorySupport UUID firstAssignedUid = firstAssigned.get(labelingAssignmentEntity.assignmentUid); ZonedDateTime createdDttm = firstAssigned.get(labelingAssignmentEntity.createdDate); Long inferenceGeomUid = firstAssigned.get(labelingAssignmentEntity.inferenceGeomUid); + Integer targetYyyy = firstAssigned.get(mapSheetAnalInferenceEntity.targetYyyy); + Integer compareYyyy = firstAssigned.get(mapSheetAnalInferenceEntity.compareYyyy); BooleanExpression beforeCondition = - labelingAssignmentEntity - .createdDate - .lt(createdDttm) + mapSheetAnalInferenceEntity + .targetYyyy + .lt(targetYyyy) .or( - labelingAssignmentEntity - .createdDate - .eq(createdDttm) + mapSheetAnalInferenceEntity + .targetYyyy + .eq(targetYyyy) + .and(mapSheetAnalInferenceEntity.compareYyyy.lt(compareYyyy))) + .or( + mapSheetAnalInferenceEntity + .targetYyyy + .eq(targetYyyy) + .and(mapSheetAnalInferenceEntity.compareYyyy.eq(compareYyyy)) + .and(labelingAssignmentEntity.createdDate.lt(createdDttm))) + .or( + mapSheetAnalInferenceEntity + .targetYyyy + .eq(targetYyyy) + .and(mapSheetAnalInferenceEntity.compareYyyy.eq(compareYyyy)) + .and(labelingAssignmentEntity.createdDate.eq(createdDttm)) .and(labelingAssignmentEntity.inferenceGeomUid.lt(inferenceGeomUid))); Long beforeCnt = queryFactory .select(labelingAssignmentEntity.count()) .from(labelingAssignmentEntity) + .innerJoin(mapSheetAnalInferenceEntity) + .on(mapSheetAnalInferenceEntity.id.eq(labelingAssignmentEntity.analUid)) .where( labelingAssignmentEntity.inspectorUid.eq(userId), beforeCondition.and(stateCondition))