Merge remote-tracking branch 'origin/feat/dev_251201' into feat/dev_251201
This commit is contained in:
18
src/main/java/com/kamco/cd/kamcoback/config/FileConfig.java
Normal file
18
src/main/java/com/kamco/cd/kamcoback/config/FileConfig.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package com.kamco.cd.kamcoback.config;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/** GeoJSON 파일 모니터링 설정 */
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "file.config")
|
||||
@Getter
|
||||
@Setter
|
||||
public class FileConfig {
|
||||
|
||||
private String rootSyncDir = "D:\\app\\original-images";
|
||||
// private String rootSyncDir = "/app/original-images";
|
||||
|
||||
}
|
||||
@@ -57,11 +57,44 @@ public class MapSheetMngApiController {
|
||||
return ApiResponseDto.ok(mapSheetMngService.findMapSheetMngList(searchReq));
|
||||
}
|
||||
|
||||
@Operation(summary = "영상관리 > 데이터 등록", description = "영상관리 > 데이터 등록")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
responseCode = "201",
|
||||
description = "데이터 등록 성공",
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = Long.class))),
|
||||
@ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content),
|
||||
@ApiResponse(responseCode = "404", description = "데이터를 찾을 수 없음", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@PutMapping("/mng-data-save")
|
||||
public ApiResponseDto<MapSheetMngDto.DmlReturn> mngDataSave(
|
||||
@RequestBody @Valid MapSheetMngDto.AddReq AddReq) {
|
||||
return ApiResponseDto.ok(mapSheetMngService.mngDataSave(AddReq));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param hstUidList
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "오류데이터 팝업 > 업로드 처리", description = "오류데이터 팝업 > 업로드 처리")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
responseCode = "201",
|
||||
description = "공통코드 저장 성공",
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = Long.class))),
|
||||
@ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content),
|
||||
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@PutMapping("/upload-process")
|
||||
public ApiResponseDto<MapSheetMngDto.DmlReturn> uploadProcess(
|
||||
@RequestBody @Valid List<Long> hstUidList) {
|
||||
|
||||
@@ -5,10 +5,8 @@ import com.kamco.cd.kamcoback.code.service.CommonCodeService;
|
||||
import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.FilesDto;
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.FoldersDto;
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.SrchFilesDepthDto;
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.SrchFilesDto;
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.SrchFoldersDto;
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.ImageryDto;
|
||||
import com.kamco.cd.kamcoback.mapsheet.service.MapSheetMngFileCheckerService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Content;
|
||||
@@ -16,7 +14,6 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -32,7 +29,7 @@ public class MapSheetMngFileCheckerApiController {
|
||||
private final CommonCodeService commonCodeService;
|
||||
private final MapSheetMngFileCheckerService mapSheetMngFileCheckerService;
|
||||
|
||||
@Operation(summary = "폴더 조회", description = "폴더 조회")
|
||||
@Operation(summary = "폴더 조회", description = "폴더 조회 (ROOT:/app/original-images 이하로 경로입력)")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
@@ -47,6 +44,7 @@ public class MapSheetMngFileCheckerApiController {
|
||||
})
|
||||
@PostMapping("/folder-list")
|
||||
public ApiResponseDto<FoldersDto> getDir(@RequestBody SrchFoldersDto srchDto) {
|
||||
|
||||
return ApiResponseDto.createOK(mapSheetMngFileCheckerService.getFolderAll(srchDto));
|
||||
}
|
||||
|
||||
@@ -69,6 +67,7 @@ public class MapSheetMngFileCheckerApiController {
|
||||
return ApiResponseDto.createOK(mapSheetMngFileCheckerService.getFilesAll(srchDto));
|
||||
}
|
||||
|
||||
/*
|
||||
@Operation(summary = "지정폴더(하위폴더포함) 파일목록 조회", description = "지정폴더(하위폴더포함) 파일목록 조회")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@@ -106,4 +105,7 @@ public class MapSheetMngFileCheckerApiController {
|
||||
@RequestBody @Valid ImageryDto.searchReq searchReq) {
|
||||
return ApiResponseDto.ok(mapSheetMngFileCheckerService.syncProcess(searchReq));
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ public class FileDto {
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class SrchFoldersDto {
|
||||
@Schema(description = "디렉토리경로", example = "D:\\kamco")
|
||||
@Schema(description = "디렉토리경로(ROOT:/app/original-images)", example = "")
|
||||
@NotNull
|
||||
private String dirPath;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.kamco.cd.kamcoback.mapsheet.dto;
|
||||
|
||||
import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm;
|
||||
import com.kamco.cd.kamcoback.config.enums.EnumType;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.time.ZonedDateTime;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -62,6 +64,19 @@ public class MapSheetMngDto {
|
||||
private DataState dataState;
|
||||
}
|
||||
|
||||
@Schema(name = "MngAddReq", description = "영상관리 생성 요청")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class AddReq {
|
||||
@Schema(description = "관리년도", example = "2022")
|
||||
private int mngYyyy;
|
||||
|
||||
@Schema(description = "선택폴더경로", example = "D:\\app\\original-images\\2022")
|
||||
private String mngPath;
|
||||
}
|
||||
|
||||
@Schema(name = "MngDto", description = "영상관리 검색 리턴")
|
||||
@Getter
|
||||
@Setter
|
||||
@@ -72,15 +87,15 @@ public class MapSheetMngDto {
|
||||
private int mngYyyy;
|
||||
private String mngState;
|
||||
private String syncState;
|
||||
private String mngStateDttm;
|
||||
private String syncStateDttm;
|
||||
// private int sheetCnt;
|
||||
// private int exceptCnt;
|
||||
private String mngPath;
|
||||
private String createdDttm;
|
||||
private Long createdUid;
|
||||
private String updatedDttm;
|
||||
private Long updatedUid;
|
||||
private String syncCheckState;
|
||||
private Long syncTotCnt;
|
||||
private Long syncStateDoneCnt;
|
||||
private Long syncCheckStateDoneCnt;
|
||||
private Long syncNotFileCnt;
|
||||
private Long syncTypeErrorCnt;
|
||||
private Long syncSizeErrorCnt;
|
||||
@JsonFormatDttm private ZonedDateTime rgstStrtDttm;
|
||||
@JsonFormatDttm private ZonedDateTime rgstEndDttm;
|
||||
}
|
||||
|
||||
@Schema(name = "DmlReturn", description = "영상관리 DML 수행 후 리턴")
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.kamco.cd.kamcoback.mapsheet.service;
|
||||
import static java.lang.String.CASE_INSENSITIVE_ORDER;
|
||||
|
||||
import com.kamco.cd.kamcoback.common.utils.NameValidator;
|
||||
import com.kamco.cd.kamcoback.config.FileConfig;
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto;
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.FilesDto;
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.FolderDto;
|
||||
@@ -38,11 +39,15 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
public class MapSheetMngFileCheckerService {
|
||||
|
||||
private final MapSheetMngFileCheckerCoreService mapSheetMngFileCheckerCoreService;
|
||||
private final FileConfig fileConfig;
|
||||
|
||||
public FoldersDto getFolderAll(SrchFoldersDto srchDto) {
|
||||
|
||||
Path startPath = Paths.get(srchDto.getDirPath());
|
||||
String dirPath = srchDto.getDirPath();
|
||||
Path startPath = Paths.get(fileConfig.getRootSyncDir() + srchDto.getDirPath());
|
||||
String dirPath = fileConfig.getRootSyncDir() + srchDto.getDirPath();
|
||||
|
||||
// Path startPath = Paths.get(fileConfig.getRootSyncDir()+srchDto.getDirPath());
|
||||
// String dirPath = fileConfig.getRootSyncDir()+srchDto.getDirPath();
|
||||
|
||||
int maxDepth = 1;
|
||||
|
||||
|
||||
@@ -222,6 +222,10 @@ public class MapSheetMngService {
|
||||
return mapSheetMngCoreService.findMapSheetMngList(searchReq);
|
||||
}
|
||||
|
||||
public MapSheetMngDto.DmlReturn mngDataSave(@Valid MapSheetMngDto.AddReq AddReq) {
|
||||
return mapSheetMngCoreService.mngDataSave(AddReq);
|
||||
}
|
||||
|
||||
public MapSheetMngDto.DmlReturn uploadProcess(@Valid List<Long> hstUidList) {
|
||||
return mapSheetMngCoreService.uploadProcess(hstUidList);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.kamco.cd.kamcoback.postgres.core;
|
||||
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetMngEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetMngHstEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.repository.mapsheet.MapSheetMngRepository;
|
||||
import jakarta.persistence.EntityNotFoundException;
|
||||
@@ -67,9 +68,11 @@ public class MapSheetMngCoreService {
|
||||
count += 1;
|
||||
}
|
||||
|
||||
/*
|
||||
MapSheetMngDto.DataState dataState =
|
||||
flag ? MapSheetMngDto.DataState.SUCCESS : MapSheetMngDto.DataState.FAIL;
|
||||
entity.get().updateDataState(dataState);
|
||||
*/
|
||||
}
|
||||
}
|
||||
return new MapSheetMngDto.DmlReturn("success", count + "개 업로드 성공하였습니다.");
|
||||
@@ -84,7 +87,7 @@ public class MapSheetMngCoreService {
|
||||
.findMapSheetMngHstInfo(hstUid)
|
||||
.orElseThrow(EntityNotFoundException::new));
|
||||
|
||||
entity.get().updateUseInference(true);
|
||||
// entity.get().updateUseInference(true);
|
||||
}
|
||||
}
|
||||
return new MapSheetMngDto.DmlReturn("success", hstUidList.size() + "개 추론제외 업데이트 하였습니다.");
|
||||
@@ -122,4 +125,15 @@ public class MapSheetMngCoreService {
|
||||
throw new RuntimeException("File search error", e);
|
||||
}
|
||||
}
|
||||
|
||||
public MapSheetMngDto.DmlReturn mngDataSave(@Valid MapSheetMngDto.AddReq addReq) {
|
||||
|
||||
MapSheetMngEntity entity = new MapSheetMngEntity();
|
||||
entity.setMngYyyy(addReq.getMngYyyy());
|
||||
entity.setMngPath(addReq.getMngPath());
|
||||
|
||||
MapSheetMngEntity saved = mapSheetMngRepository.save(entity);
|
||||
|
||||
return new MapSheetMngDto.DmlReturn("success", saved.getMngYyyy().toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.time.ZonedDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
@@ -18,30 +18,32 @@ public class MapSheetMngEntity {
|
||||
|
||||
@Id
|
||||
@Column(name = "mng_yyyy", nullable = false)
|
||||
private Integer id;
|
||||
private Integer mngYyyy;
|
||||
|
||||
@Size(max = 20)
|
||||
@ColumnDefault("'NOTYET'")
|
||||
@Column(name = "mng_state", length = 20)
|
||||
private String mngState;
|
||||
private String mngState = "NOTYET";
|
||||
|
||||
@Size(max = 20)
|
||||
@ColumnDefault("'NOTYET'")
|
||||
@Column(name = "sync_state", length = 20)
|
||||
private String syncState;
|
||||
private String syncState = "NOTYET";
|
||||
|
||||
@Column(name = "mng_state_dttm")
|
||||
private OffsetDateTime mngStateDttm;
|
||||
private ZonedDateTime mngStateDttm = ZonedDateTime.now();
|
||||
|
||||
@Column(name = "sync_state_dttm")
|
||||
private OffsetDateTime syncStateDttm;
|
||||
private ZonedDateTime syncStateDttm = ZonedDateTime.now();
|
||||
|
||||
@Column(name = "created_dttm")
|
||||
private OffsetDateTime createdDttm;
|
||||
private ZonedDateTime createdDttm = ZonedDateTime.now();
|
||||
|
||||
@Column(name = "created_uid")
|
||||
private Long createdUid;
|
||||
|
||||
@Column(name = "updated_dttm")
|
||||
private OffsetDateTime updatedDttm;
|
||||
private ZonedDateTime updatedDttm = ZonedDateTime.now();
|
||||
|
||||
@Column(name = "updated_uid")
|
||||
private Long updatedUid;
|
||||
@@ -50,4 +52,21 @@ public class MapSheetMngEntity {
|
||||
@ColumnDefault("'NULL::character varying'")
|
||||
@Column(name = "mng_path")
|
||||
private String mngPath;
|
||||
|
||||
@Size(max = 20)
|
||||
@ColumnDefault("'NOTYET'")
|
||||
@Column(name = "sync_check_state", length = 20)
|
||||
private String syncCheckState = "NOTYET";
|
||||
|
||||
@Column(name = "sync_strt_dttm")
|
||||
private ZonedDateTime syncStrtDttm;
|
||||
|
||||
@Column(name = "sync_end_dttm")
|
||||
private ZonedDateTime syncEndDttm;
|
||||
|
||||
@Column(name = "sync_check_strt_dttm")
|
||||
private ZonedDateTime syncCheckStrtDttm;
|
||||
|
||||
@Column(name = "sync_check_end_dttm")
|
||||
private ZonedDateTime syncCheckEndDttm;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.kamco.cd.kamcoback.postgres.entity;
|
||||
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto;
|
||||
import com.kamco.cd.kamcoback.postgres.CommonDateEntity;
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import java.time.ZonedDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -35,9 +35,8 @@ public class MapSheetMngHstEntity extends CommonDateEntity {
|
||||
@Column(name = "scale_ratio")
|
||||
private Integer scaleRatio;
|
||||
|
||||
@Column(name = "data_state")
|
||||
@Enumerated(EnumType.STRING)
|
||||
private MapSheetMngDto.DataState dataState;
|
||||
@Column(name = "data_state", length = 20)
|
||||
private String dataState;
|
||||
|
||||
@Column(name = "data_state_dttm")
|
||||
private ZonedDateTime dataStateDttm;
|
||||
@@ -60,13 +59,23 @@ public class MapSheetMngHstEntity extends CommonDateEntity {
|
||||
@Column(name = "updated_uid")
|
||||
private Long updatedUid;
|
||||
|
||||
public void updateDataState(MapSheetMngDto.DataState dataState) {
|
||||
this.dataState = dataState;
|
||||
this.dataStateDttm = ZonedDateTime.now();
|
||||
}
|
||||
@Size(max = 20)
|
||||
@Column(name = "sync_state", length = 20)
|
||||
private String syncState;
|
||||
|
||||
public void updateUseInference(Boolean useInference) {
|
||||
this.useInference = useInference;
|
||||
this.useInferenceDttm = ZonedDateTime.now();
|
||||
}
|
||||
@Size(max = 20)
|
||||
@Column(name = "sync_check_state", length = 20)
|
||||
private String syncCheckState;
|
||||
|
||||
@Column(name = "sync_strt_dttm")
|
||||
private ZonedDateTime syncStrtDttm;
|
||||
|
||||
@Column(name = "sync_end_dttm")
|
||||
private ZonedDateTime syncEndDttm;
|
||||
|
||||
@Column(name = "sync_check_strt_dttm")
|
||||
private ZonedDateTime syncCheckStrtDttm;
|
||||
|
||||
@Column(name = "sync_check_end_dttm")
|
||||
private ZonedDateTime syncCheckEndDttm;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.util.Optional;
|
||||
import org.springframework.data.domain.Page;
|
||||
|
||||
public interface MapSheetMngRepositoryCustom {
|
||||
|
||||
Page<MapSheetMngDto.ErrorDataDto> findMapSheetErrorList(
|
||||
MapSheetMngDto.@Valid searchReq searchReq);
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.kamco.cd.kamcoback.postgres.entity.MapSheetMngHstEntity;
|
||||
import com.querydsl.core.BooleanBuilder;
|
||||
import com.querydsl.core.types.Projections;
|
||||
import com.querydsl.core.types.dsl.BooleanExpression;
|
||||
import com.querydsl.core.types.dsl.CaseBuilder;
|
||||
import com.querydsl.core.types.dsl.Expressions;
|
||||
import com.querydsl.core.types.dsl.NumberExpression;
|
||||
import com.querydsl.core.types.dsl.StringExpression;
|
||||
@@ -64,7 +65,7 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
||||
.on(mapInkx5kEntity.fidK50.eq(mapInkx50kEntity.fid.longValue()))
|
||||
.where(
|
||||
mapSheetMngHstEntity.mngYyyy.eq(searchReq.getMngYyyy()),
|
||||
mapSheetMngHstEntity.dataState.eq(MapSheetMngDto.DataState.FAIL), // 오류만 검색
|
||||
// mapSheetMngHstEntity.dataState.eq(MapSheetMngDto.DataState.FAIL), // 오류만 검색
|
||||
mapSheetErrorSearchValue(searchReq))
|
||||
.offset(pageable.getOffset())
|
||||
.limit(pageable.getPageSize())
|
||||
@@ -81,7 +82,7 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
||||
.on(mapInkx5kEntity.fidK50.eq(mapInkx50kEntity.fid.longValue()))
|
||||
.where(
|
||||
mapSheetMngHstEntity.mngYyyy.eq(searchReq.getMngYyyy()),
|
||||
mapSheetMngHstEntity.dataState.eq(MapSheetMngDto.DataState.FAIL), // 오류만 검색
|
||||
// mapSheetMngHstEntity.dataState.eq(MapSheetMngDto.DataState.FAIL), // 오류만 검색
|
||||
mapSheetErrorSearchValue(searchReq))
|
||||
.fetchOne();
|
||||
|
||||
@@ -96,9 +97,30 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
||||
BooleanBuilder whereBuilder = new BooleanBuilder();
|
||||
|
||||
if (searchReq.getMngYyyy() != null) {
|
||||
whereBuilder.and(mapSheetMngEntity.id.eq(searchReq.getMngYyyy()));
|
||||
whereBuilder.and(mapSheetMngEntity.mngYyyy.eq(searchReq.getMngYyyy()));
|
||||
}
|
||||
|
||||
/*
|
||||
QMapSheetMngEntity m = mapSheetMngEntity;
|
||||
QMapSheetMngHstEntity h = mapSheetMngHstEntity;
|
||||
|
||||
List<MapSheetSummaryDto> summaryContent =
|
||||
queryFactory
|
||||
.select(
|
||||
Projections.constructor(
|
||||
MapSheetSummaryDto.class,
|
||||
mapSheetMngHstEntity.mngYyyy,
|
||||
mapSheetMngHstEntity.mngYyyy.count().as("syncTotCnt"),
|
||||
new CaseBuilder()
|
||||
.when(mapSheetMngHstEntity.syncState.eq("DONE")).then(1L).otherwise(0L)
|
||||
.sum().as("syncStateDoneCnt")
|
||||
))
|
||||
.from(mapSheetMngHstEntity)
|
||||
.groupBy(mapSheetMngHstEntity.mngYyyy) // mng_yyyy 별로 그룹핑
|
||||
.fetch();
|
||||
|
||||
*/
|
||||
|
||||
List<MapSheetMngDto.MngDto> foundContent =
|
||||
queryFactory
|
||||
.select(
|
||||
@@ -108,30 +130,52 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
||||
Integer.class,
|
||||
"row_number() over(order by {0} desc)",
|
||||
mapSheetMngEntity.createdDttm),
|
||||
mapSheetMngEntity.id,
|
||||
mapSheetMngEntity.mngYyyy,
|
||||
mapSheetMngEntity.mngState,
|
||||
mapSheetMngEntity.syncState,
|
||||
Expressions.stringTemplate(
|
||||
"to_char({0}, 'YYYY-MM-DD HH24:MI:SS')", mapSheetMngEntity.mngStateDttm),
|
||||
Expressions.stringTemplate(
|
||||
"to_char({0}, 'YYYY-MM-DD HH24:MI:SS')", mapSheetMngEntity.syncStateDttm),
|
||||
mapSheetMngEntity.mngPath,
|
||||
Expressions.stringTemplate(
|
||||
"to_char({0}, 'YYYY-MM-DD HH24:MI:SS')", mapSheetMngEntity.createdDttm),
|
||||
mapSheetMngEntity.createdUid,
|
||||
Expressions.stringTemplate(
|
||||
"to_char({0}, 'YYYY-MM-DD HH24:MI:SS')", mapSheetMngEntity.updatedDttm),
|
||||
mapSheetMngEntity.updatedUid))
|
||||
mapSheetMngEntity.syncCheckState,
|
||||
mapSheetMngHstEntity.count(),
|
||||
new CaseBuilder()
|
||||
.when(mapSheetMngHstEntity.syncState.eq("DONE"))
|
||||
.then(1L)
|
||||
.otherwise(0L)
|
||||
.sum()
|
||||
.as("syncStateDoneCnt"),
|
||||
new CaseBuilder()
|
||||
.when(mapSheetMngHstEntity.syncCheckState.eq("DONE"))
|
||||
.then(1L)
|
||||
.otherwise(0L)
|
||||
.sum(),
|
||||
new CaseBuilder()
|
||||
.when(mapSheetMngHstEntity.dataState.eq("NOT"))
|
||||
.then(1L)
|
||||
.otherwise(0L)
|
||||
.sum(),
|
||||
new CaseBuilder()
|
||||
.when(mapSheetMngHstEntity.dataState.eq("TYPEERROR"))
|
||||
.then(1L)
|
||||
.otherwise(0L)
|
||||
.sum(),
|
||||
new CaseBuilder()
|
||||
.when(mapSheetMngHstEntity.dataState.eq("SIZEERROR"))
|
||||
.then(1L)
|
||||
.otherwise(0L)
|
||||
.sum(),
|
||||
mapSheetMngHstEntity.syncStrtDttm.min(),
|
||||
mapSheetMngHstEntity.syncCheckEndDttm.max()))
|
||||
.from(mapSheetMngEntity)
|
||||
.leftJoin(mapSheetMngHstEntity)
|
||||
.on(mapSheetMngEntity.mngYyyy.eq(mapSheetMngHstEntity.mngYyyy))
|
||||
.where(whereBuilder)
|
||||
.offset(pageable.getOffset())
|
||||
.limit(pageable.getPageSize())
|
||||
.orderBy(mapSheetMngEntity.createdDttm.desc())
|
||||
.groupBy(mapSheetMngEntity.mngYyyy)
|
||||
.fetch();
|
||||
|
||||
Long countQuery =
|
||||
queryFactory
|
||||
.select(mapSheetMngEntity.id.count())
|
||||
.select(mapSheetMngEntity.mngYyyy.count())
|
||||
.from(mapSheetMngEntity)
|
||||
.where(whereBuilder)
|
||||
.fetchOne();
|
||||
|
||||
Reference in New Issue
Block a user