diff --git a/src/main/java/com/xit/biz/ctgy/controller/ParkingController.java b/src/main/java/com/xit/biz/ctgy/controller/ParkingController.java index 678a74c..265006c 100644 --- a/src/main/java/com/xit/biz/ctgy/controller/ParkingController.java +++ b/src/main/java/com/xit/biz/ctgy/controller/ParkingController.java @@ -17,7 +17,6 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.mapstruct.factory.Mappers; import org.springframework.data.domain.Pageable; -import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -25,7 +24,7 @@ import org.springframework.web.bind.annotation.*; import javax.validation.Valid; -@Tag(name = "ParkingController", description = "주정차의견진술관리") +@Tag(name = "ParkingController", description = "주정차 의견진술 관리") @RestController @RequestMapping("/api/v1/ctgy/parking") @Validated @@ -38,7 +37,7 @@ public class ParkingController { private final MinSimsa680Mapstruct mapstruct = Mappers.getMapper(MinSimsa680Mapstruct.class); private final MinSimsa680GroupMapstruct groupMapstruct = Mappers.getMapper(MinSimsa680GroupMapstruct.class); - @Operation(summary = "주정차의견진술심의목록" , description = "주정차의견진술심의목록") + @Operation(summary = "주정차 의견진술 심의 목록" , description = "주정차 의견진술 심의 목록") @Parameters({ @Parameter(in = ParameterIn.QUERY, name = "msYear", description = "심사년도", required = true, example = "2021"), @Parameter(in = ParameterIn.QUERY, name = "msChasu", description = "차수", required = false, example = " "), @@ -56,7 +55,7 @@ public class ParkingController { return RestResponse.of(service.findSimsas(dto, pageable)); } - @Operation(summary = "주정차의견진술심의목록-상세" , description = "주정차의견진술심의목록-상세") + @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"), @@ -71,7 +70,7 @@ public class ParkingController { return RestResponse.of(service.findSimsaDetails(dto)); } - @Operation(summary = "주정차의견진술심의대상조회" , description = "주정차의견진술심의대상조회") + @Operation(summary = "주정차 의견진술 심의대상 조회" , description = "주정차 의견진술 심의대상 조회") @GetMapping(value="/target", produces = MediaType.APPLICATION_JSON_VALUE) @Parameters({ @Parameter(in = ParameterIn.QUERY, name = "rcIrTransfer", description = "전송상태(미접수-1,접수-2)", required = true, example = "1"), @@ -82,7 +81,7 @@ public class ParkingController { return RestResponse.of(service.findSimsaTargets(dto)); } - @Operation(summary = "주정차의견진술심의대상등록" , description = "주정차의견진술심의대상등록") + @Operation(summary = "주정차 의견진술 심의대상 등록" , description = "주정차 의견진술 심의대상 등록") @PostMapping(value="/target", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity saveParkinSimsaTargets( @Valid @@ -93,7 +92,7 @@ public class ParkingController { //return RestResponse.of(HttpStatus.OK); } - @Operation(summary = "주정차의견진술심의등록" , description = "주정차의견진술심의등록") + @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"), diff --git a/src/main/java/com/xit/biz/ctgy/controller/ResidentController.java b/src/main/java/com/xit/biz/ctgy/controller/ResidentController.java new file mode 100644 index 0000000..2759a54 --- /dev/null +++ b/src/main/java/com/xit/biz/ctgy/controller/ResidentController.java @@ -0,0 +1,53 @@ +package com.xit.biz.ctgy.controller; + +import com.xit.biz.ctgy.dto.struct.GnRecallScMapstruct; +import com.xit.biz.ctgy.service.IResidentService; +import com.xit.core.api.IRestResponse; +import com.xit.core.api.RestResponse; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import org.mapstruct.factory.Mappers; +import org.springframework.data.domain.Pageable; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +@Tag(name = "ResidentController", description = "거주자의견진술 관리") +@RestController +@RequestMapping("/api/v1/ctgy/resident") +@Validated +@RequiredArgsConstructor +public class ResidentController { + + private final IResidentService service; + + private final GnRecallScMapstruct mapstruct = Mappers.getMapper(GnRecallScMapstruct.class); + + // TODO :: 파라메터 정의 필요 + @Operation(summary = "거주자의견지술자료 목록 조회" , description = "거주자의견진술자료 목록 조회") + @Parameters({ + @Parameter(in = ParameterIn.QUERY, name = "page", description = "페이지", required = true, example = "0"), + @Parameter(in = ParameterIn.QUERY, name = "size", description = "페이지당갯수", required = true, example = "10") + }) + @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity findAll( + @Parameter(hidden = true) + final Pageable pageable) { + return RestResponse.of(service.findResidents(pageable)); + } + + @Operation(summary = "거주자의견진술 상세" , description = "거주자의견진술 상세") + @Parameters({ + @Parameter(in = ParameterIn.PATH, name = "scCode", description = "의견진술번호", required = true, example = "3326"), + }) + @GetMapping(value = "/{scCode}", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity findByScCode(@PathVariable final Long scCode) { + return RestResponse.of(service.findByScCode(scCode)); + } + +} diff --git a/src/main/java/com/xit/biz/ctgy/dto/GnRecallScDto.java b/src/main/java/com/xit/biz/ctgy/dto/GnRecallScDto.java new file mode 100644 index 0000000..0d09066 --- /dev/null +++ b/src/main/java/com/xit/biz/ctgy/dto/GnRecallScDto.java @@ -0,0 +1,120 @@ +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 = "GnRecallScDto", description = "") +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class GnRecallScDto { + @Schema(required = true, title = " ", example = " ", description = " ") + private Long scCode; + + @Schema(required = true, title = " ", example = " ", description = " ") + private Long scSeq; + + @Schema(required = true, title = " ", example = " ", description = " ") + private String scCarnum; + + @Schema(required = true, title = " ", example = " ", description = " ") + private String scName; + + @Schema(required = true, title = " ", example = " ", description = " ") + private String scDong; + + @Schema(required = true, title = " ", example = " ", description = " ") + private String scContDoc; + + @Schema(required = true, title = " ", example = " ", description = " ") + private String scCdate; + + @Schema(required = true, title = " ", example = " ", description = " ") + private String scIngb; + + @Schema(required = true, title = " ", example = " ", description = " ") + private String scWdate; + + @Schema(required = true, title = " ", example = " ", description = " ") + private String scJbtime; + + @Schema(required = true, title = " ", example = " ", description = " ") + private String scPos; + + @Schema(title = " ", example = " ", description = " ") + private String scFrecad1; + + @Schema(title = " ", example = " ", description = " ") + private String scFrecad2; + + @Schema(title = " ", example = " ", description = " ") + private String scFrecad3; + + @Schema(title = " ", example = " ", description = " ") + private String scFrecad4; + + @Schema(title = " ", example = " ", description = " ") + private String scContad1; + + @Schema(title = " ", example = " ", description = " ") + private String scContad2; + + @Schema(title = " ", example = " ", description = " ") + private String scContad3; + + @Schema(title = " ", example = " ", description = " ") + private String scContad4; + + @Schema(title = " ", example = " ", description = " ") + private String scContad5; + + @Schema(title = " ", example = " ", description = " ") + private String scContad6; + + @Schema(title = " ", example = " ", description = " ") + private String scContad7; + + @Schema(title = " ", example = " ", description = " ") + private String scContad8; + + @Schema(title = " ", example = " ", description = " ") + private String scPicad1; + + @Schema(title = " ", example = " ", description = " ") + private String scPicad2; + + @Schema(title = " ", example = " ", description = " ") + private String scPicad3; + + @Schema(title = " ", example = " ", description = " ") + private String scPicad4; + + @Schema(required = true, title = " ", example = " ", description = " ") + private String scTransfer; + + @Schema(required = true, title = " ", example = " ", description = " ") + private String scDatagb; + + @Schema(title = " ", example = " ", description = " ") + private String scAnswer; + + @Schema(required = true, title = " ", example = " ", description = " ") + private String scState; + + @Schema(title = " ", example = " ", description = " ") + private String zipcode1; + + @Schema(title = " ", example = " ", description = " ") + private String zipcode2; + + @Schema(title = " ", example = " ", description = " ") + private String scJuso; + + @Schema(title = " ", example = " ", description = " ") + private String scBunji; + +} diff --git a/src/main/java/com/xit/biz/ctgy/dto/MinSimsaTargetDto.java b/src/main/java/com/xit/biz/ctgy/dto/MinSimsaTargetDto.java index bfdb423..e3af145 100644 --- a/src/main/java/com/xit/biz/ctgy/dto/MinSimsaTargetDto.java +++ b/src/main/java/com/xit/biz/ctgy/dto/MinSimsaTargetDto.java @@ -6,9 +6,7 @@ import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; -import org.springframework.format.annotation.DateTimeFormat; -import java.sql.Date; import java.time.LocalDate; import java.util.List; @@ -37,17 +35,17 @@ public class MinSimsaTargetDto { @Schema(title = "", example = " ", description = "Input Description...") private String rcName; - @Schema(title = "진술유형토드", example = " ", description = "Input Description...") + @Schema(title = "진술유형코드", example = " ", description = "Input Description...") private String rcContDoc; @Schema(title = "진술유형코드명", example = " ", description = "Input Description...") - private String rcContDocStr; + private String rcContDocNm; @Schema(title = "접수방법코드", example = " ", description = "Input Description...") private String rcIngb; @Schema(title = "접수방법코드명", example = " ", description = "Input Description...") - private String rcIngbStr; + private String rcIngbNm; @Schema(title = "접수일자", example = " ", description = "Input Description...") private String rcDate; diff --git a/src/main/java/com/xit/biz/ctgy/dto/ResidentDto.java b/src/main/java/com/xit/biz/ctgy/dto/ResidentDto.java new file mode 100644 index 0000000..f2079f6 --- /dev/null +++ b/src/main/java/com/xit/biz/ctgy/dto/ResidentDto.java @@ -0,0 +1,126 @@ +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 = "GnRecallScDto", description = "") +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class ResidentDto { + @Schema(required = true, title = " ", example = " ", description = " ") + private Long scCode; + + @Schema(required = true, title = "접수번호", example = " ", description = " ") + private Long scSeq; + + @Schema(required = true, title = "차량번호", example = " ", description = " ") + private String scCarnum; + + @Schema(required = true, title = "이름", example = " ", description = " ") + private String scName; + + @Schema(required = true, title = " ", example = " ", description = " ") + private String scDong; + + @Schema(required = true, title = "진술유형코드", example = " ", description = "진술유형코드") + private String scContDoc; + + @Schema(required = true, title = "진술유형코드명", example = " ", description = "진술유형코드명") + private String scContDocNm; + + @Schema(required = true, title = "접수일자", example = " ", description = "접수일자") + private String scCdate; + + @Schema(required = true, title = "접수방법코드", example = " ", description = "접수방법코드") + private String scIngb; + + @Schema(required = true, title = "접수방법코드명", example = " ", description = "접수방법코드명") + private String scIngbNm; + + @Schema(required = true, title = " ", example = " ", description = " ") + private String scWdate; + + @Schema(required = true, title = " ", example = " ", description = " ") + private String scJbtime; + + @Schema(required = true, title = " ", example = " ", description = " ") + private String scPos; + + @Schema(title = " ", example = " ", description = " ") + private String scFrecad1; + + @Schema(title = " ", example = " ", description = " ") + private String scFrecad2; + + @Schema(title = " ", example = " ", description = " ") + private String scFrecad3; + + @Schema(title = " ", example = " ", description = " ") + private String scFrecad4; + + @Schema(title = " ", example = " ", description = " ") + private String scContad1; + + @Schema(title = " ", example = " ", description = " ") + private String scContad2; + + @Schema(title = " ", example = " ", description = " ") + private String scContad3; + + @Schema(title = " ", example = " ", description = " ") + private String scContad4; + + @Schema(title = " ", example = " ", description = " ") + private String scContad5; + + @Schema(title = " ", example = " ", description = " ") + private String scContad6; + + @Schema(title = " ", example = " ", description = " ") + private String scContad7; + + @Schema(title = " ", example = " ", description = " ") + private String scContad8; + + @Schema(title = " ", example = " ", description = " ") + private String scPicad1; + + @Schema(title = " ", example = " ", description = " ") + private String scPicad2; + + @Schema(title = " ", example = " ", description = " ") + private String scPicad3; + + @Schema(title = " ", example = " ", description = " ") + private String scPicad4; + + @Schema(required = true, title = " ", example = " ", description = " ") + private String scTransfer; + + @Schema(required = true, title = " ", example = " ", description = " ") + private String scDatagb; + + @Schema(title = " ", example = " ", description = " ") + private String scAnswer; + + @Schema(required = true, title = " ", example = " ", description = " ") + private String scState; + + @Schema(title = " ", example = " ", description = " ") + private String zipcode1; + + @Schema(title = " ", example = " ", description = " ") + private String zipcode2; + + @Schema(title = " ", example = " ", description = " ") + private String scJuso; + + @Schema(title = " ", example = " ", description = " ") + private String scBunji; + +} diff --git a/src/main/java/com/xit/biz/ctgy/dto/struct/GnRecallScMapstruct.java b/src/main/java/com/xit/biz/ctgy/dto/struct/GnRecallScMapstruct.java new file mode 100644 index 0000000..9e5477e --- /dev/null +++ b/src/main/java/com/xit/biz/ctgy/dto/struct/GnRecallScMapstruct.java @@ -0,0 +1,14 @@ +package com.xit.biz.ctgy.dto.struct; + +import com.xit.biz.ctgy.dto.GnRecallScDto; +import com.xit.biz.ctgy.dto.MinSimsa680Dto; +import com.xit.biz.ctgy.entity.GnRecallSc; +import com.xit.biz.ctgy.entity.MinSimsa680; +import com.xit.core.support.jpa.mapstruct.IMapstruct; +import com.xit.core.support.jpa.mapstruct.MapStructMapperConfig; +import org.mapstruct.Mapper; + +@Mapper(config = MapStructMapperConfig.class) +public interface GnRecallScMapstruct extends IMapstruct { + +} diff --git a/src/main/java/com/xit/biz/ctgy/entity/GnRecallSc.java b/src/main/java/com/xit/biz/ctgy/entity/GnRecallSc.java new file mode 100644 index 0000000..4af79f9 --- /dev/null +++ b/src/main/java/com/xit/biz/ctgy/entity/GnRecallSc.java @@ -0,0 +1,139 @@ +package com.xit.biz.ctgy.entity; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import javax.persistence.*; +import java.util.Objects; + +@Schema(name = "GnRecallSc", description = "") +@Table(name = "gn_recall_sc", schema = "traffic", catalog = "") +@Entity +@Getter +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class GnRecallSc { + @Schema(required = true, title = " ", example = " ", description = " ") + @Id + @Column(name = "sc_code") + private Long scCode; + @Schema(required = true, title = " ", example = " ", description = " ") + @Column(name = "sc_seq") + private Long scSeq; + @Schema(required = true, title = " ", example = " ", description = " ") + @Column(name = "sc_carnum") + private String scCarnum; + @Schema(required = true, title = " ", example = " ", description = " ") + @Column(name = "sc_name") + private String scName; + @Schema(required = true, title = " ", example = " ", description = " ") + @Column(name = "sc_dong") + private String scDong; + @Schema(required = true, title = " ", example = " ", description = " ") + @Column(name = "sc_cont_doc") + private String scContDoc; + @Schema(required = true, title = " ", example = " ", description = " ") + @Column(name = "sc_cdate") + private String scCdate; + @Schema(required = true, title = " ", example = " ", description = " ") + @Column(name = "sc_ingb") + private String scIngb; + @Schema(required = true, title = " ", example = " ", description = " ") + @Column(name = "sc_wdate") + private String scWdate; + @Schema(required = true, title = " ", example = " ", description = " ") + @Column(name = "sc_jbtime") + private String scJbtime; + @Schema(required = true, title = " ", example = " ", description = " ") + @Column(name = "sc_pos") + private String scPos; + @Schema(title = " ", example = " ", description = " ") + @Column(name = "sc_frecad1") + private String scFrecad1; + @Schema(title = " ", example = " ", description = " ") + @Column(name = "sc_frecad2") + private String scFrecad2; + @Schema(title = " ", example = " ", description = " ") + @Column(name = "sc_frecad3") + private String scFrecad3; + @Schema(title = " ", example = " ", description = " ") + @Column(name = "sc_frecad4") + private String scFrecad4; + @Schema(title = " ", example = " ", description = " ") + @Column(name = "sc_contad1") + private String scContad1; + @Schema(title = " ", example = " ", description = " ") + @Column(name = "sc_contad2") + private String scContad2; + @Schema(title = " ", example = " ", description = " ") + @Column(name = "sc_contad3") + private String scContad3; + @Schema(title = " ", example = " ", description = " ") + @Column(name = "sc_contad4") + private String scContad4; + @Schema(title = " ", example = " ", description = " ") + @Column(name = "sc_contad5") + private String scContad5; + @Schema(title = " ", example = " ", description = " ") + @Column(name = "sc_contad6") + private String scContad6; + @Schema(title = " ", example = " ", description = " ") + @Column(name = "sc_contad7") + private String scContad7; + @Schema(title = " ", example = " ", description = " ") + @Column(name = "sc_contad8") + private String scContad8; + @Schema(title = " ", example = " ", description = " ") + @Column(name = "sc_picad1") + private String scPicad1; + @Schema(title = " ", example = " ", description = " ") + @Column(name = "sc_picad2") + private String scPicad2; + @Schema(title = " ", example = " ", description = " ") + @Column(name = "sc_picad3") + private String scPicad3; + @Schema(title = " ", example = " ", description = " ") + @Column(name = "sc_picad4") + private String scPicad4; + @Schema(required = true, title = " ", example = " ", description = " ") + @Column(name = "sc_transfer") + private String scTransfer; + @Schema(required = true, title = " ", example = " ", description = " ") + @Column(name = "sc_datagb") + private String scDatagb; + @Schema(title = " ", example = " ", description = " ") + @Column(name = "sc_answer") + private String scAnswer; + @Schema(required = true, title = " ", example = " ", description = " ") + @Column(name = "sc_state") + private String scState; + @Schema(title = " ", example = " ", description = " ") + @Column(name = "zipcode1") + private String zipcode1; + @Schema(title = " ", example = " ", description = " ") + @Column(name = "zipcode2") + private String zipcode2; + @Schema(title = " ", example = " ", description = " ") + @Column(name = "sc_juso") + private String scJuso; + @Schema(title = " ", example = " ", description = " ") + @Column(name = "sc_bunji") + private String scBunji; + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + GnRecallSc that = (GnRecallSc) o; + return scCode == that.scCode && scSeq == that.scSeq && Objects.equals(scCarnum, that.scCarnum) && Objects.equals(scName, that.scName) && Objects.equals(scDong, that.scDong) && Objects.equals(scContDoc, that.scContDoc) && Objects.equals(scCdate, that.scCdate) && Objects.equals(scIngb, that.scIngb) && Objects.equals(scWdate, that.scWdate) && Objects.equals(scJbtime, that.scJbtime) && Objects.equals(scPos, that.scPos) && Objects.equals(scFrecad1, that.scFrecad1) && Objects.equals(scFrecad2, that.scFrecad2) && Objects.equals(scFrecad3, that.scFrecad3) && Objects.equals(scFrecad4, that.scFrecad4) && Objects.equals(scContad1, that.scContad1) && Objects.equals(scContad2, that.scContad2) && Objects.equals(scContad3, that.scContad3) && Objects.equals(scContad4, that.scContad4) && Objects.equals(scContad5, that.scContad5) && Objects.equals(scContad6, that.scContad6) && Objects.equals(scContad7, that.scContad7) && Objects.equals(scContad8, that.scContad8) && Objects.equals(scPicad1, that.scPicad1) && Objects.equals(scPicad2, that.scPicad2) && Objects.equals(scPicad3, that.scPicad3) && Objects.equals(scPicad4, that.scPicad4) && Objects.equals(scTransfer, that.scTransfer) && Objects.equals(scDatagb, that.scDatagb) && Objects.equals(scAnswer, that.scAnswer) && Objects.equals(scState, that.scState) && Objects.equals(zipcode1, that.zipcode1) && Objects.equals(zipcode2, that.zipcode2) && Objects.equals(scJuso, that.scJuso) && Objects.equals(scBunji, that.scBunji); + } + + @Override + public int hashCode() { + return Objects.hash(scCode, scSeq, scCarnum, scName, scDong, scContDoc, scCdate, scIngb, scWdate, scJbtime, scPos, scFrecad1, scFrecad2, scFrecad3, scFrecad4, scContad1, scContad2, scContad3, scContad4, scContad5, scContad6, scContad7, scContad8, scPicad1, scPicad2, scPicad3, scPicad4, scTransfer, scDatagb, scAnswer, scState, zipcode1, zipcode2, scJuso, scBunji); + } +} diff --git a/src/main/java/com/xit/biz/ctgy/repository/IResidentRepository.java b/src/main/java/com/xit/biz/ctgy/repository/IResidentRepository.java new file mode 100644 index 0000000..e698c00 --- /dev/null +++ b/src/main/java/com/xit/biz/ctgy/repository/IResidentRepository.java @@ -0,0 +1,8 @@ +package com.xit.biz.ctgy.repository; + +import com.xit.biz.ctgy.entity.GnRecallSc; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface IResidentRepository extends JpaRepository, IResidentRepositoryCustom { + GnRecallSc findByScCode(Long scCode); +} diff --git a/src/main/java/com/xit/biz/ctgy/repository/IResidentRepositoryCustom.java b/src/main/java/com/xit/biz/ctgy/repository/IResidentRepositoryCustom.java new file mode 100644 index 0000000..cb1de6a --- /dev/null +++ b/src/main/java/com/xit/biz/ctgy/repository/IResidentRepositoryCustom.java @@ -0,0 +1,16 @@ +package com.xit.biz.ctgy.repository; + +import com.xit.biz.ctgy.dto.GnRecallScDto; +import com.xit.biz.ctgy.dto.MinSimsa680GroupDto; +import com.xit.biz.ctgy.dto.MinSimsaReviewGroupDto; +import com.xit.biz.ctgy.dto.MinSimsaTargetDto; +import com.xit.biz.ctgy.entity.MinSimsa680; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; + +import java.util.List; + +public interface IResidentRepositoryCustom { + Page findResidents(Pageable pageable); + +} diff --git a/src/main/java/com/xit/biz/ctgy/repository/IResidentRepositoryImpl.java b/src/main/java/com/xit/biz/ctgy/repository/IResidentRepositoryImpl.java new file mode 100644 index 0000000..d8dfe88 --- /dev/null +++ b/src/main/java/com/xit/biz/ctgy/repository/IResidentRepositoryImpl.java @@ -0,0 +1,71 @@ +package com.xit.biz.ctgy.repository; + +import com.querydsl.core.QueryResults; +import com.querydsl.core.types.ExpressionUtils; +import com.querydsl.core.types.Projections; +import com.querydsl.jpa.JPAExpressions; +import com.querydsl.jpa.impl.JPAQueryFactory; +import com.xit.biz.ctgy.dto.GnRecallScDto; +import lombok.RequiredArgsConstructor; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.domain.Pageable; + +import static com.xit.biz.cmm.entity.QCmmCodeS.cmmCodeS; +import static com.xit.biz.ctgy.entity.QGnRecallSc.gnRecallSc; + +@RequiredArgsConstructor +public class IResidentRepositoryImpl implements IResidentRepositoryCustom { + + private final JPAQueryFactory queryFactory; + + @Override + public Page findResidents(Pageable pageable) { + +// BooleanBuilder builder = new BooleanBuilder(); +// if (!Checks.isEmpty(pMinSimsa680GroupDto.getMsYear())) { +// builder.and(minSimsa680.msYear.eq(pMinSimsa680GroupDto.getMsYear())); +// } +// if (!Checks.isEmpty(pMinSimsa680GroupDto.getMsChasu())) { +// builder.and(minSimsa680.msChasu.like(String.valueOf(pMinSimsa680GroupDto.getMsChasu()))); +// } + QueryResults rslt = + queryFactory + .select(Projections.fields( + GnRecallScDto.class, + gnRecallSc.scCode, + gnRecallSc.scSeq, + gnRecallSc.scCarnum, + gnRecallSc.scDong, + gnRecallSc.scName, + gnRecallSc.scContDoc, + gnRecallSc.scIngb, + gnRecallSc.scDatagb, + gnRecallSc.scCdate, + ExpressionUtils.as( + JPAExpressions.select(cmmCodeS.codeNm) + .from(cmmCodeS) + .where(gnRecallSc.scContDoc.eq(cmmCodeS.codeCd),cmmCodeS.codeGrpId.eq("TRAFFIC"), + cmmCodeS.codeLcd.eq("GANGNAM_SIMSA"), + cmmCodeS.codeMcd.eq("SC_CONT_DOC")), + "scContDocNm"), + ExpressionUtils.as( + JPAExpressions.select(cmmCodeS.codeNm) + .from(cmmCodeS) + .where(gnRecallSc.scIngb.eq(cmmCodeS.codeCd),cmmCodeS.codeGrpId.eq("TRAFFIC"), + cmmCodeS.codeLcd.eq("GANGNAM_SIMSA"), + cmmCodeS.codeMcd.eq("RC_INGB")), + "scIngbNm") + )) + .from(gnRecallSc) + //.where(builder) + //.groupBy(minSimsa680.msYear, minSimsa680.msChasu, minSimsa680.msSdate, minSimsa680.msStartsi, minSimsa680.msEdate, minSimsa680.msCdate, minSimsa680.msClosesi) + //.orderBy(minSimsa680.msYear.desc(), minSimsa680.msChasu.desc()) + .offset(pageable.getOffset()) + .limit(pageable.getPageSize()) + .fetchResults(); + + + return new PageImpl<>(rslt.getResults(), pageable, rslt.getTotal()); + } +} diff --git a/src/main/java/com/xit/biz/ctgy/repository/ISimsaRepository.java b/src/main/java/com/xit/biz/ctgy/repository/ISimsaRepository.java index 4c7da86..daebbba 100644 --- a/src/main/java/com/xit/biz/ctgy/repository/ISimsaRepository.java +++ b/src/main/java/com/xit/biz/ctgy/repository/ISimsaRepository.java @@ -9,48 +9,4 @@ import javax.annotation.Nonnull; import java.time.LocalDate; public interface ISimsaRepository extends JpaRepository, ISimsaRepositoryCustom { - - @Query(value="insert into min_simsa680(" + - "ms_maincode, " + - "ms_seq," + - "ms_carnum," + - "ms_year," + - "ms_chasu," + - "ms_sdate," + - "ms_startsi," + - "ms_edate," + - "ms_cdate," + - "ms_closesi," + - "ms_wdate," + - "ms_pos," + - "ms_result," + - "ms_jbtime" + - ") " + - "select TR.rc_code," + - "TR.rc_seq," + - "TM.mm_ocarno," + - ":msYear, " + - ":msChasu," + - ":msSdate," + - ":msStartsi," + - ":msEdate," + - ":msCdate," + - ":msClosesi," + - "TM.mm_wdate," + - "TD.do_bname||''||TJ.mj_pos," + - ":msResult," + - "TJ.mj_jbtime " + - "from tf680_recall TR " + - "join tf680_main TM on TR.rc_code = :rcCode and TM.mm_code = TR.rc_maincode " + - "join tf680_jucha TJ on TM.mm_code = TJ.mj_code " + - "join tf680_dong TD on TJ.mj_dong = TD.do_code", nativeQuery = true) - void insertSimsaTargetIntoSelect(@Nonnull @Param("msYear") final String msYear, - @Nonnull @Param("rcCode") Long rcCode, - @Nonnull @Param("msChasu") Long msChasu, - @Nonnull @Param("msSdate") LocalDate msSdate, - @Nonnull @Param("msStartsi") String msStartsi, - @Nonnull @Param("msEdate") LocalDate msEdate, - @Nonnull @Param("msCdate") LocalDate msCdate, - @Nonnull @Param("msClosesi") String msClosesi, - @Nonnull @Param("msResult") String msResult); } diff --git a/src/main/java/com/xit/biz/ctgy/repository/ISimsaRepositoryImpl.java b/src/main/java/com/xit/biz/ctgy/repository/ISimsaRepositoryImpl.java index 2b9c2be..4e0c728 100644 --- a/src/main/java/com/xit/biz/ctgy/repository/ISimsaRepositoryImpl.java +++ b/src/main/java/com/xit/biz/ctgy/repository/ISimsaRepositoryImpl.java @@ -134,14 +134,14 @@ public class ISimsaRepositoryImpl implements ISimsaRepositoryCustom { .where(tf680Recall.rcContDoc.eq(cmmCodeS.codeCd),cmmCodeS.codeGrpId.eq("TRAFFIC"), cmmCodeS.codeLcd.eq("GANGNAM_SIMSA"), cmmCodeS.codeMcd.eq("RC_CONT_DOC")), - "rcContDocStr"), + "rcContDocNm"), ExpressionUtils.as( JPAExpressions.select(cmmCodeS.codeNm) .from(cmmCodeS) .where(tf680Recall.rcIngb.eq(cmmCodeS.codeCd),cmmCodeS.codeGrpId.eq("TRAFFIC"), cmmCodeS.codeLcd.eq("GANGNAM_SIMSA"), cmmCodeS.codeMcd.eq("RC_INGB")), - "rcIngbStr") + "rcIngbNm") )) .from(tf680Main) .join(tf680Recall) diff --git a/src/main/java/com/xit/biz/ctgy/service/IResidentService.java b/src/main/java/com/xit/biz/ctgy/service/IResidentService.java new file mode 100644 index 0000000..27039e9 --- /dev/null +++ b/src/main/java/com/xit/biz/ctgy/service/IResidentService.java @@ -0,0 +1,17 @@ +package com.xit.biz.ctgy.service; + +import com.xit.biz.ctgy.dto.GnRecallScDto; +import com.xit.biz.ctgy.entity.GnRecallSc; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; + +import java.util.List; + +public interface IResidentService { + + Page findResidents(Pageable pageable); + + Page findAll(GnRecallSc entity, Pageable pageable); + + GnRecallSc findByScCode(Long scCode); +} diff --git a/src/main/java/com/xit/biz/ctgy/service/impl/ParkingService.java b/src/main/java/com/xit/biz/ctgy/service/impl/ParkingService.java index b8d081f..7b7b11b 100644 --- a/src/main/java/com/xit/biz/ctgy/service/impl/ParkingService.java +++ b/src/main/java/com/xit/biz/ctgy/service/impl/ParkingService.java @@ -126,6 +126,7 @@ public class ParkingService implements IParkingService { } @Override + @Transactional public MinSimsa680 saveParkingSimsa(MinSimsa680 entity) { return simsaRepository.saveAndFlush(entity); } diff --git a/src/main/java/com/xit/biz/ctgy/service/impl/PublicBoardService.java b/src/main/java/com/xit/biz/ctgy/service/impl/PublicBoardService.java index d9dfabe..2a57d4a 100644 --- a/src/main/java/com/xit/biz/ctgy/service/impl/PublicBoardService.java +++ b/src/main/java/com/xit/biz/ctgy/service/impl/PublicBoardService.java @@ -17,6 +17,7 @@ public class PublicBoardService implements IPublicBoardService { private final IPublicBoardRepository repository; + @Override @Transactional(readOnly = true) public Page findAll(final MinInfoBoard680 entity, Pageable pageable) { // Sort sort = Sort.by(Sort.Direction.DESC, "inCode"); @@ -34,6 +35,7 @@ public class PublicBoardService implements IPublicBoardService { } @Override + @Transactional(readOnly = true) public MinInfoBoard680 findByInCode(final Long inCode) { return repository.findByInCode(inCode); } diff --git a/src/main/java/com/xit/biz/ctgy/service/impl/ResidentService.java b/src/main/java/com/xit/biz/ctgy/service/impl/ResidentService.java new file mode 100644 index 0000000..5a806f8 --- /dev/null +++ b/src/main/java/com/xit/biz/ctgy/service/impl/ResidentService.java @@ -0,0 +1,52 @@ +package com.xit.biz.ctgy.service.impl; + +import com.xit.biz.ctgy.dto.GnRecallScDto; +import com.xit.biz.ctgy.entity.*; +import com.xit.biz.ctgy.repository.*; +import com.xit.biz.ctgy.service.IResidentService; +import com.xit.core.support.jpa.JpaUtil; +import lombok.RequiredArgsConstructor; +import org.springframework.data.domain.*; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +@Service +@RequiredArgsConstructor +public class ResidentService implements IResidentService { + + private final IResidentRepository repository; + + @Override + @Transactional(readOnly = true) + public Page findResidents(Pageable pageable) { + // Sort sort = Sort.by(Sort.Direction.DESC, "inCode"); + pageable = JpaUtil.getPagingInfo(pageable); + Page page = repository.findResidents( + PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), Sort.by("scCode").descending())); + // List userList = page.getContent(); + return page; + } + + @Override + @Transactional(readOnly = true) + public Page findAll(GnRecallSc entity, Pageable pageable) { + // Sort sort = Sort.by(Sort.Direction.DESC, "inCode"); + pageable = JpaUtil.getPagingInfo(pageable); + // pageable = PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), Sort.by("inCode").descending()) + ExampleMatcher exampleMatcher = ExampleMatcher.matchingAll(); + //.withMatcher("inTitle", contains()) + //.withMatcher("inName", contains()); + Example example = Example.of(entity, exampleMatcher); + Page page = repository.findAll( + example, + PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), Sort.by("scCode").descending())); + // List userList = page.getContent(); + return page; + } + + @Override + @Transactional(readOnly = true) + public GnRecallSc findByScCode(Long scCode) { + return repository.findByScCode(scCode); + } +}