refactor: 패키지 변경 적용

dev
minuk926 3 years ago
parent 6652345922
commit e5cffe7d46

@ -1,5 +1,6 @@
package com.xit.biz.ctgy.controller;
import com.xit.biz.ctgy.dto.MinSimsa680Dto;
import com.xit.biz.ctgy.dto.MinSimsa680GroupDto;
import com.xit.biz.ctgy.dto.struct.MinSimsa680GroupMapstruct;
import com.xit.biz.ctgy.dto.struct.MinSimsa680Mapstruct;
@ -18,6 +19,7 @@ import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -60,7 +62,7 @@ public class ParkingController {
@Parameter(in = ParameterIn.QUERY, name = "msChasu", description = "차수", required = false, example = "3"),
@Parameter(in = ParameterIn.QUERY, name = "msuTeam", description = "팀코드", required = true, example = "002")
})
@GetMapping(value="details", produces = MediaType.APPLICATION_JSON_VALUE)
@GetMapping(value="/details", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> findSimsaDetails(
@Valid
@Parameter(hidden = true)
@ -68,6 +70,27 @@ public class ParkingController {
return RestResponse.of(service.findSimsaDetails(dto));
}
@Operation(summary = "주정차의견진술심의목록-상세" , description = "주정차의견진술심의목록-상세")
@GetMapping(value="/target", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> findSimsaTargets(){
return RestResponse.of(service.findSimsaTargets());
}
@Operation(summary = "주정차의견진술심의등록" , description = "주정차의견진술심의등록")
@Parameters({
@Parameter(in = ParameterIn.QUERY, name = "msSdate", description = "심사시작일", required = true, example = "2021-01-04"),
@Parameter(in = ParameterIn.QUERY, name = "msEdate", description = "심사종료일", required = true, example = "2021-01-05"),
@Parameter(in = ParameterIn.QUERY, name = "msChasu", description = "차수", required = false, example = "3"),
@Parameter(in = ParameterIn.QUERY, name = "msuTeam", description = "팀코드", required = true, example = "002")
})
@PostMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> saveParkinSimsa(
@Valid
@Parameter(hidden = true)
final MinSimsa680Dto dto) {
return RestResponse.of(service.saveParkingSimsa(mapstruct.toEntity(dto)));
}
// TODO :: 파라메터 정의 필요
// @Operation(summary = "심사(대상)자 조회" , description = "심사(대상)자 조회")
// @Parameters({

@ -13,7 +13,7 @@ import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
@Schema(name = "MinCivBoard680Dto", description = "게시판")
@Schema(name = "MinSimsa680Dto", description = "민원심사")
@Getter
@Setter
@AllArgsConstructor
@ -21,8 +21,8 @@ import java.util.Set;
public class MinSimsa680Dto {
// private static final long SerialVersionUID = 1L;
@Schema(required = true, title = "민원코드", example = " ", description = "Input Description...")
private Long id;
@Schema(required = true, title = "민원코드", example = " ", description = "민원코드")
private Long msMaincode;
// private Tf680Recall tf680Recall;

@ -0,0 +1,61 @@
package com.xit.biz.ctgy.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Schema(name = "MinSimsTargetDto", description = "주정차의견진술심의자료대상")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class MinSimsaTargetDto {
@Schema(title = "메인코드", example = " ", description = "메인코드-TF680_MAIN")
private Long mmCode;
@Schema(title = "민원코드", example = " ", description = "민원코드-TF680_RECALL")
private Long rcCode;
@Schema(title = "접수번호", example = " ", description = "Input Description...")
private String rcSeq;
@Schema(required = true, title = "차량번호", example = " ", description = "Input Description...")
private String msCarnum;
@Schema(required = true, title = "년도", example = " ", description = "Input Description...")
private String msYear;
@Schema(required = true, title = "차수", example = " ", description = "Input Description...")
private Long msChasu;
@Schema(required = true, title = "심사시작일시", example = " ", description = "Input Description...")
private java.sql.Date msSdate;
@Schema(required = true, title = "심사시작시간", example = " ", description = "Input Description...")
private String msStartsi;
@Schema(required = true, title = "심사종료일시", example = " ", description = "Input Description...")
private java.sql.Date msEdate;
@Schema(required = true, title = "심사마감일시", example = " ", description = "Input Description...")
private java.sql.Date msCdate;
@Schema(required = true, title = "심사마감시간", example = " ", description = "Input Description...")
private String msClosesi;
@Schema(required = false, title = "단속일자", example = " ", description = "Input Description...")
private java.sql.Date msWdate;
@Schema(required = false, title = "단속장소", example = " ", description = "Input Description...")
private String msPos;
@Schema(required = false, title = "결과코드", example = " ", description = "Input Description...")
private String msResult;
@Schema(required = false, title = "단속시간", example = " ", description = "Input Description...")
private String msJbtime;
}

@ -2,6 +2,33 @@ package com.xit.biz.ctgy.repository;
import com.xit.biz.ctgy.entity.MinSimsa680;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
import java.util.Map;
public interface IParkingRepository extends JpaRepository<MinSimsa680, Long>, IParkingRepositoryCustom {
// @Query(value="SELECT new map(TM.MM_CODE as mmCode,"+
// " TR.RC_CODE as rcCode, " +
// " TR.RC_SEQ as rcSeq, " +
// " TM.MM_OCARNO as mmOcarno, " +
// " TM.MM_NCARNO as mmNcarno)" +
// " FROM TF680_MAIN TM " +
// " JOIN TF680_RECALL TR ON TM.MM_CODE = TR.RC_MAINCODE " +
// " LEFT JOIN TB_CMM_CODE_S TCCS1 ON TR.RC_INGB = TCCS1.CODE_CD " +
// " AND TCCS1.CODE_GRP_ID = 'TRAFFIC' " +
// " AND TCCS1.CODE_LCD = 'GANGNAM_SIMSA' " +
// " AND TCCS1.CODE_MCD = 'RC_INGB' " +
// " LEFT JOIN TB_CMM_CODE_S TCCS2 ON TR.RC_CONT_DOC = TCCS2.CODE_CD " +
// " AND TCCS2.CODE_GRP_ID = 'TRAFFIC' " +
// " AND TCCS2.CODE_LCD = 'GANGNAM_SIMSA' " +
// " AND TCCS2.CODE_MCD = 'RC_CONT_DOC' " +
// " WHERE MM_DBGB = '11' " +
// " AND MM_LSTATE <> '75' " +
// " AND RC_GB = '1' " +
// " AND RC_STATE = '0' " +
// " AND RC_IR_TRANSFER = '1' " +
// " order by RC_SEQ ")
// List<Map<String,Object>> findSimsaTargets();
}

@ -5,12 +5,16 @@ import com.xit.biz.ctgy.dto.MinSimsaReviewGroupDto;
import com.xit.biz.ctgy.entity.MinSimsa680;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
public interface IParkingRepositoryCustom {
Page<MinSimsa680GroupDto> findSimsas(MinSimsa680GroupDto pMinSimsa680GroupDto, Pageable pageable);
List<MinSimsa680> findSimsaDetails(MinSimsa680GroupDto minSimsa680GroupDto);
//List<MinSimsa680> findSimsaTargets();
Page<MinSimsaReviewGroupDto> findMinSimsa680s2(Pageable pageable);
}

@ -98,6 +98,75 @@ public class IParkingRepositoryImpl implements IParkingRepositoryCustom {
return rslt;
}
//@Override
//public List<MinSimsa680> findSimsaTargets() {
/*
SELECT TM.MM_CODE,
TR.RC_CODE,
TR.RC_SEQ,
TM.MM_OCARNO,
TM.MM_NCARNO,
TR.RC_NAME,
TR.RC_CONT_DOC,
-- (1:, 2:, 3:, 4:, 5:, 6:, 7:, 8:, 9:, 10:, 11:, 12:, 13:, 14:)
CASE WHEN TR.RC_CONT_DOC = '1' THEN ''
WHEN TR.RC_CONT_DOC = '2' THEN ''
WHEN TR.RC_CONT_DOC = '3' THEN ''
WHEN TR.RC_CONT_DOC = '4' THEN ''
WHEN TR.RC_CONT_DOC = '5' THEN ''
WHEN TR.RC_CONT_DOC = '6' THEN ''
WHEN TR.RC_CONT_DOC = '7' THEN ''
WHEN TR.RC_CONT_DOC = '8' THEN ''
WHEN TR.RC_CONT_DOC = '9' THEN ''
WHEN TR.RC_CONT_DOC = '10' THEN ''
WHEN TR.RC_CONT_DOC = '11' THEN ''
WHEN TR.RC_CONT_DOC = '12' THEN ''
WHEN TR.RC_CONT_DOC = '13' THEN ''
WHEN TR.RC_CONT_DOC = '14' THEN ''
ELSE ''
END AS RC_COND_DOC_STR,
TCCS2.CODE_NM,
TR.RC_DATE,
-- (1:, 2:, 3:, 4:, 5:, 6:, 7:ARS, 8:, 9:)
TR.RC_INGB,
CASE WHEN TR.RC_INGB = '1' THEN ''
WHEN TR.RC_INGB = '2' THEN ''
WHEN TR.RC_INGB = '3' THEN ''
WHEN TR.RC_INGB = '4' THEN ''
WHEN TR.RC_INGB = '5' THEN ''
WHEN TR.RC_INGB = '6' THEN ''
WHEN TR.RC_INGB = '7' THEN 'ARS'
WHEN TR.RC_INGB = '8' THEN ''
WHEN TR.RC_INGB = '9' THEN ''
ELSE ''
END AS RC_INGB_STR,
TCCS1.CODE_NM
FROM TF680_MAIN TM
JOIN TF680_RECALL TR ON TM.MM_CODE = TR.RC_MAINCODE
LEFT JOIN TB_CMM_CODE_S TCCS1 ON TR.RC_INGB = TCCS1.CODE_CD
AND TCCS1.CODE_GRP_ID = 'TRAFFIC'
AND TCCS1.CODE_LCD = 'GANGNAM_SIMSA'
AND TCCS1.CODE_MCD = 'RC_INGB'
LEFT JOIN TB_CMM_CODE_S TCCS2 ON TR.RC_CONT_DOC = TCCS2.CODE_CD
AND TCCS2.CODE_GRP_ID = 'TRAFFIC'
AND TCCS2.CODE_LCD = 'GANGNAM_SIMSA'
AND TCCS2.CODE_MCD = 'RC_CONT_DOC'
WHERE MM_DBGB = '11' -- : 11-' 12-
AND MM_LSTATE != '75' -- 10:,11:,12:,13:,21:,49:,51:,52:,53:,54:,55:,61:,62:,65:,71:,72:,73:,74:,75:,81:,82:,91:,92:,98:,99:)
AND RC_GB = '1' -- : 1- 2-
AND RC_STATE = '0' -- (0:, 1:, 2:, 3:-OCR , 5:, 7:, 8:, 9:)
-- AND RC_SEQ >= '"& rtxtsNum &"'
-- AND RC_SEQ <= '"& rtxteNum &"'
AND RC_IR_TRANSFER = '1' -- : 1- 2-
order by RC_SEQ;
*/
// return null;
//}
@Override
public Page<MinSimsaReviewGroupDto> findMinSimsa680s2(Pageable pageable) {
/*

@ -7,14 +7,18 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Map;
public interface IParkingService {
//Page<MinSimsa680GroupDto> findMinSimsa680Groups(MinSimsa680 minSimsa680, Pageable pageable);
Page<MinSimsa680GroupDto> findSimsas(MinSimsa680GroupDto minSimsa680GroupDto, Pageable pageable);
List<MinSimsa680> findSimsaDetails(MinSimsa680GroupDto minSimsa680GroupDto);
List<Map<String,Object>> findSimsaTargets();
Page<MinSimsa680> findAll(MinSimsa680 minSimsa680, Pageable pageable);
Page<MinSimsaReviewGroupDto> findMinSimsa680s2(MinSimsa680 minSimsa680, Pageable pageable);
MinSimsa680 saveParkingSimsa(MinSimsa680 toEntity);
}

@ -15,6 +15,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains;
@ -46,8 +47,18 @@ public class ParkingService implements IParkingService {
return repository.findSimsaDetails(minSimsa680GroupDto);
}
@Transactional(readOnly = true)
public List<Map<String,Object>> findSimsaTargets() {
return null ; //repository.findSimsaTargets();
}
@Transactional(readOnly = true)
public Page<MinSimsaReviewGroupDto> findMinSimsa680s2(MinSimsa680 minSimsa680, Pageable pageable) {
return repository.findMinSimsa680s2(pageable);
}
@Override
public MinSimsa680 saveParkingSimsa(MinSimsa680 entity) {
return repository.saveAndFlush(entity);
}
}

@ -10,9 +10,12 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import javax.persistence.EntityManager;
import javax.persistence.Tuple;
import javax.transaction.Transactional;
import java.sql.Date;
import java.time.LocalDate;
import java.util.Map;
import java.util.stream.Collectors;
import static com.xit.biz.ctgy.entity.QMinSimsa680.minSimsa680;
import static com.xit.biz.ctgy.entity.QMinSimsaUser680.minSimsaUser680;
@ -28,9 +31,6 @@ class RecallRepositoryTest {
private JPAQueryFactory queryFactory;
@Autowired
private IMinSimsa680Repository iMinSimsa680Repository;
@BeforeEach
void beforeEach(){
queryFactory = new JPAQueryFactory(em);
@ -99,6 +99,102 @@ AND RC_IR_TRANSFER = '"& rstTrans &"' ORDER BY RC_SEQ
}
@Test
void resultMapReturn(){
/*
SELECT TM.MM_CODE,
TR.RC_CODE,
TR.RC_SEQ,
TM.MM_OCARNO,
TM.MM_NCARNO,
TR.RC_NAME,
TR.RC_CONT_DOC,
-- (1:, 2:, 3:, 4:, 5:, 6:, 7:, 8:, 9:, 10:, 11:, 12:, 13:, 14:)
CASE WHEN TR.RC_CONT_DOC = '1' THEN ''
WHEN TR.RC_CONT_DOC = '2' THEN ''
WHEN TR.RC_CONT_DOC = '3' THEN ''
WHEN TR.RC_CONT_DOC = '4' THEN ''
WHEN TR.RC_CONT_DOC = '5' THEN ''
WHEN TR.RC_CONT_DOC = '6' THEN ''
WHEN TR.RC_CONT_DOC = '7' THEN ''
WHEN TR.RC_CONT_DOC = '8' THEN ''
WHEN TR.RC_CONT_DOC = '9' THEN ''
WHEN TR.RC_CONT_DOC = '10' THEN ''
WHEN TR.RC_CONT_DOC = '11' THEN ''
WHEN TR.RC_CONT_DOC = '12' THEN ''
WHEN TR.RC_CONT_DOC = '13' THEN ''
WHEN TR.RC_CONT_DOC = '14' THEN ''
ELSE ''
END AS RC_COND_DOC_STR,
TCCS2.CODE_NM,
TR.RC_DATE,
-- (1:, 2:, 3:, 4:, 5:, 6:, 7:ARS, 8:, 9:)
TR.RC_INGB,
CASE WHEN TR.RC_INGB = '1' THEN ''
WHEN TR.RC_INGB = '2' THEN ''
WHEN TR.RC_INGB = '3' THEN ''
WHEN TR.RC_INGB = '4' THEN ''
WHEN TR.RC_INGB = '5' THEN ''
WHEN TR.RC_INGB = '6' THEN ''
WHEN TR.RC_INGB = '7' THEN 'ARS'
WHEN TR.RC_INGB = '8' THEN ''
WHEN TR.RC_INGB = '9' THEN ''
ELSE ''
END AS RC_INGB_STR,
TCCS1.CODE_NM
FROM TF680_MAIN TM
JOIN TF680_RECALL TR ON TM.MM_CODE = TR.RC_MAINCODE
LEFT JOIN TB_CMM_CODE_S TCCS1 ON TR.RC_INGB = TCCS1.CODE_CD
AND TCCS1.CODE_GRP_ID = 'TRAFFIC'
AND TCCS1.CODE_LCD = 'GANGNAM_SIMSA'
AND TCCS1.CODE_MCD = 'RC_INGB'
LEFT JOIN TB_CMM_CODE_S TCCS2 ON TR.RC_CONT_DOC = TCCS2.CODE_CD
AND TCCS2.CODE_GRP_ID = 'TRAFFIC'
AND TCCS2.CODE_LCD = 'GANGNAM_SIMSA'
AND TCCS2.CODE_MCD = 'RC_CONT_DOC'
WHERE MM_DBGB = '11' -- : 11-' 12-
AND MM_LSTATE != '75' -- 10:,11:,12:,13:,21:,49:,51:,52:,53:,54:,55:,61:,62:,65:,71:,72:,73:,74:,75:,81:,82:,91:,92:,98:,99:)
AND RC_GB = '1' -- : 1- 2-
AND RC_STATE = '0' -- (0:, 1:, 2:, 3:-OCR , 5:, 7:, 8:, 9:)
-- AND RC_SEQ >= '"& rtxtsNum &"'
-- AND RC_SEQ <= '"& rtxteNum &"'
AND RC_IR_TRANSFER = '1' -- : 1- 2-
order by RC_SEQ;
*/
// Map<String, Object> rsltMap = em.createQuery("SELECT new map(TM.MM_CODE as mmCode," +
// " TR.RC_CODE as rcCode, " +
// " TR.RC_SEQ as rcSeq, " +
// " TM.MM_OCARNO as mmOcarno, " +
// " TM.MM_NCARNO as mmNcarno " +
// " FROM TF680_MAIN TM " +
// " JOIN TF680_RECALL TR ON TM.MM_CODE = TR.RC_MAINCODE " +
// " LEFT JOIN TB_CMM_CODE_S TCCS1 ON TR.RC_INGB = TCCS1.CODE_CD " +
// " AND TCCS1.CODE_GRP_ID = 'TRAFFIC' " +
// " AND TCCS1.CODE_LCD = 'GANGNAM_SIMSA' " +
// " AND TCCS1.CODE_MCD = 'RC_INGB' " +
// " LEFT JOIN TB_CMM_CODE_S TCCS2 ON TR.RC_CONT_DOC = TCCS2.CODE_CD " +
// " AND TCCS2.CODE_GRP_ID = 'TRAFFIC' " +
// " AND TCCS2.CODE_LCD = 'GANGNAM_SIMSA' " +
// " AND TCCS2.CODE_MCD = 'RC_CONT_DOC' " +
// " WHERE MM_DBGB = '11' " +
// " AND MM_LSTATE != '75' " +
// " AND RC_GB = '1' " +
// " AND RC_STATE = '0' " +
// " AND RC_IR_TRANSFER = '1' " +
// " order by RC_SEQ "
// , Tuple.class
// ).getResultList()
// .stream()
// .collect(
// Collectors.toMap(
// tuple -> ((Long) tuple.get("MM_CODE")).,
// tuple -> ((Long) tuple.get("RC_CODE"),
// )
// )
//
// }
// @BeforeAll
// void beforeAll(){
// log.debug("initializing...");
@ -107,5 +203,5 @@ AND RC_IR_TRANSFER = '"& rstTrans &"' ORDER BY RC_SEQ
// @AfterAll
// void afterAll(){
// log.debug("...shutdown");
// }
}
}
Loading…
Cancel
Save