diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelWorkRepositoryImpl.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelWorkRepositoryImpl.java index a7e1c3fa..e57f5314 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelWorkRepositoryImpl.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelWorkRepositoryImpl.java @@ -76,14 +76,17 @@ public class LabelWorkRepositoryImpl extends QuerydslRepositorySupport whereSubBuilder.and(mapSheetAnalDataInferenceGeomEntity.dataUid.eq(mapSheetAnalDataInferenceEntity.id)); - if (searchReq.getStrtDttm() != null && ! searchReq.getStrtDttm().isEmpty()) { - - whereSubBuilder.and(mapSheetAnalDataInferenceGeomEntity.labelStateDttm.isNotNull()); + if (searchReq.getStrtDttm() != null && ! searchReq.getStrtDttm().isEmpty() + && searchReq.getEndDttm() != null && ! searchReq.getEndDttm().isEmpty()) { + //whereSubBuilder.and(mapSheetAnalDataInferenceGeomEntity.labelStateDttm.isNotNull()); whereSubBuilder.and( - Expressions.stringTemplate("to_char({0}, 'YYYY-MM-DD')", mapSheetAnalDataInferenceEntity.labelStateDttm) - .gt("2024-01-01") + Expressions.stringTemplate("to_char({0}, 'YYYYMMDD')", mapSheetAnalDataInferenceGeomEntity.labelStateDttm) + .between(searchReq.getStrtDttm(), searchReq.getEndDttm()) ); + + //whereBuilder.and(mapSheetAnalDataInferenceGeomEntity.labelStateDttm.min().isNotNull()); + } @@ -119,7 +122,7 @@ public class LabelWorkRepositoryImpl extends QuerydslRepositorySupport mapSheetAnalDataInferenceGeomEntity.labelStateDttm.min() )) .from(mapSheetAnalDataInferenceEntity) - .leftJoin(mapSheetAnalDataInferenceGeomEntity) + .innerJoin(mapSheetAnalDataInferenceGeomEntity) .on(whereSubBuilder) .where(whereBuilder) .groupBy(