diff --git a/src/main/java/com/xit/biz/cmm/entity/CmmCodeGrp.java b/src/main/java/com/xit/biz/cmm/entity/CmmCodeGrp.java index 0b8e1cd..a69f2a8 100644 --- a/src/main/java/com/xit/biz/cmm/entity/CmmCodeGrp.java +++ b/src/main/java/com/xit/biz/cmm/entity/CmmCodeGrp.java @@ -18,12 +18,12 @@ import java.util.Objects; @Schema(name = "CmmCodeGrp", description = "코드그룹") //, parent = AuditEntity.class) @Table(name = "tb_cmm_code_grp") @Entity -@Getter -@NoArgsConstructor(access = AccessLevel.PROTECTED) -@AllArgsConstructor -@Builder @DynamicInsert @DynamicUpdate +@AllArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@Getter +@Builder public class CmmCodeGrp extends AuditEntity implements Serializable { @Schema(required = true, title = "코드그룹ID", example = "G_CODE_SAM") diff --git a/src/main/java/com/xit/biz/cmm/entity/CmmCodeL.java b/src/main/java/com/xit/biz/cmm/entity/CmmCodeL.java index 136a8ef..9ac6bc2 100644 --- a/src/main/java/com/xit/biz/cmm/entity/CmmCodeL.java +++ b/src/main/java/com/xit/biz/cmm/entity/CmmCodeL.java @@ -15,14 +15,14 @@ import java.util.Objects; @Schema(name = "CmmCodeL", description = "대분류코드") //, parent = AuditEntity.class) @Table(name = "tb_cmm_code_l") -@Entity -@Getter -@NoArgsConstructor(access = AccessLevel.PROTECTED) -@AllArgsConstructor -@Builder @IdClass(CmmCodeLIds.class) +@Entity @DynamicInsert @DynamicUpdate +@AllArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@Builder +@Getter public class CmmCodeL extends AuditEntity implements Serializable { @Schema(required = true, title = "코드그룹ID", example = "G_CODE_SAM", description = "공통코드그룹ID") diff --git a/src/main/java/com/xit/biz/cmm/entity/CmmCodeM.java b/src/main/java/com/xit/biz/cmm/entity/CmmCodeM.java index 3c15d9a..2c0e0ea 100644 --- a/src/main/java/com/xit/biz/cmm/entity/CmmCodeM.java +++ b/src/main/java/com/xit/biz/cmm/entity/CmmCodeM.java @@ -14,14 +14,14 @@ import java.util.Objects; @Schema(name = "CmmCodeM", description = "중분류코드") //, parent = AuditEntity.class) @Table(name = "tb_cmm_code_m") -@Entity -@Getter -@NoArgsConstructor(access = AccessLevel.PROTECTED) -@AllArgsConstructor -@Builder @IdClass(CmmCodeMIds.class) +@Entity @DynamicInsert @DynamicUpdate +@AllArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@Getter +@Builder public class CmmCodeM extends AuditEntity implements Serializable { @Schema(required = true, title = "코드그룹ID", example = "G_CODE_SAM", description = "공통코드그룹ID") diff --git a/src/main/java/com/xit/biz/cmm/entity/CmmCodeS.java b/src/main/java/com/xit/biz/cmm/entity/CmmCodeS.java index 914ad92..f367972 100644 --- a/src/main/java/com/xit/biz/cmm/entity/CmmCodeS.java +++ b/src/main/java/com/xit/biz/cmm/entity/CmmCodeS.java @@ -15,14 +15,14 @@ import java.util.Objects; @Schema(name = "CmmCodeS", description = "소분류코드") //, parent = AuditEntity.class) @Table(name = "tb_cmm_code_s") +@IdClass(CmmCodeSIds.class) @Entity -@Getter +@DynamicInsert +@DynamicUpdate @NoArgsConstructor(access = AccessLevel.PROTECTED) @AllArgsConstructor +@Getter @Builder -@IdClass(CmmCodeSIds.class) -@DynamicInsert -@DynamicUpdate public class CmmCodeS extends AuditEntity implements Serializable { @Schema(required = true, title = "코드그룹ID", example = "G_CODE_SAM", description = "공통코드그룹ID") diff --git a/src/main/java/com/xit/biz/cmm/entity/CmmUser.java b/src/main/java/com/xit/biz/cmm/entity/CmmUser.java index d57c091..b6eb7a2 100644 --- a/src/main/java/com/xit/biz/cmm/entity/CmmUser.java +++ b/src/main/java/com/xit/biz/cmm/entity/CmmUser.java @@ -25,12 +25,12 @@ import java.util.Objects; } ) @Entity -@Getter -@NoArgsConstructor(access = AccessLevel.PROTECTED) -@AllArgsConstructor -@Builder @DynamicInsert @DynamicUpdate +@AllArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@Getter +@Builder public class CmmUser extends AuditEntity implements Serializable { //extends RepresentationModel implements Serializable { private static final long SerialVersionUID = 1L; 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 78feb72..98ec2d5 100644 --- a/src/main/java/com/xit/biz/ctgy/controller/ParkingController.java +++ b/src/main/java/com/xit/biz/ctgy/controller/ParkingController.java @@ -1,6 +1,6 @@ package com.xit.biz.ctgy.controller; -import com.xit.biz.ctgy.dto.MinSimsa680GroupDto; +import com.xit.biz.ctgy.dto.SimsaListDto; import com.xit.biz.ctgy.dto.ParkingTargetDto; import com.xit.biz.ctgy.dto.struct.MinSimsa680GroupMapstruct; import com.xit.biz.ctgy.dto.struct.MinSimsa680Mapstruct; @@ -47,7 +47,7 @@ public class ParkingController { public ResponseEntity findParkings( @Valid @Parameter(hidden = true) - final MinSimsa680GroupDto dto, + final SimsaListDto dto, @Parameter(hidden = true) final Pageable pageable) { return RestResponse.of(service.findParkings(dto, pageable)); @@ -64,7 +64,7 @@ public class ParkingController { public ResponseEntity findParkingDetails( @Valid @Parameter(hidden = true) - final MinSimsa680GroupDto dto) { + final SimsaListDto dto) { return RestResponse.of(service.findParkingDetails(dto)); } diff --git a/src/main/java/com/xit/biz/ctgy/controller/ResidentController.java b/src/main/java/com/xit/biz/ctgy/controller/ResidentController.java index d1e5410..86a60aa 100644 --- a/src/main/java/com/xit/biz/ctgy/controller/ResidentController.java +++ b/src/main/java/com/xit/biz/ctgy/controller/ResidentController.java @@ -1,7 +1,9 @@ package com.xit.biz.ctgy.controller; import com.xit.biz.ctgy.dto.GnRecallScDto; +import com.xit.biz.ctgy.dto.ResidentDto; import com.xit.biz.ctgy.dto.ResidentTargetDto; +import com.xit.biz.ctgy.dto.SimsaListDto; import com.xit.biz.ctgy.dto.struct.GnRecallScMapstruct; import com.xit.biz.ctgy.service.IResidentService; import com.xit.core.api.IRestResponse; @@ -91,4 +93,22 @@ public class ResidentController { return RestResponse.of(HttpStatus.OK); } + @Operation(summary = "거주자 의견진술 심의 목록" , description = "거주자 의견진술 심의 목록") + @Parameters({ + @Parameter(in = ParameterIn.QUERY, name = "scYear", description = "심사년도", required = true, example = "2021"), + @Parameter(in = ParameterIn.QUERY, name = "scChasu", description = "차수", required = false, example = " "), + @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 findResidents( + @Valid + @Parameter(hidden = true) + final SimsaListDto dto, + @Parameter(hidden = true) + final Pageable pageable) { + return RestResponse.of(service.findResidents(dto, pageable)); + } + } diff --git a/src/main/java/com/xit/biz/ctgy/dto/MinSimsa680GroupDto.java b/src/main/java/com/xit/biz/ctgy/dto/SimsaListDto.java similarity index 77% rename from src/main/java/com/xit/biz/ctgy/dto/MinSimsa680GroupDto.java rename to src/main/java/com/xit/biz/ctgy/dto/SimsaListDto.java index 9f8efe1..44f64e9 100644 --- a/src/main/java/com/xit/biz/ctgy/dto/MinSimsa680GroupDto.java +++ b/src/main/java/com/xit/biz/ctgy/dto/SimsaListDto.java @@ -6,13 +6,13 @@ import lombok.*; import javax.validation.constraints.Size; import java.sql.Date; -@Schema(name = "MinSimsa680GroupDto", description = "심의목록 조회") +@Schema(name = "MinSimsa680GroupDto", description = "심의목록 조회: 주정차/거주자/장애인") @Getter @Setter @AllArgsConstructor @NoArgsConstructor @Builder -public class MinSimsa680GroupDto { +public class SimsaListDto { @Schema(required = true, title = "심사년도", example = "2021", description = "심사년도") @Size(min = 4, max = 4) private String msYear; @@ -26,5 +26,8 @@ public class MinSimsa680GroupDto { private String msClosesi; private Long cnt; + @Schema(title = "데이타구분", example = "1", description = "데이타구분: 1-거주자,2-장애인") + private String msDatagb; + private String msuTeam; } diff --git a/src/main/java/com/xit/biz/ctgy/dto/struct/MinSimsa680GroupMapstruct.java b/src/main/java/com/xit/biz/ctgy/dto/struct/MinSimsa680GroupMapstruct.java index 5c61bf0..fd38d94 100644 --- a/src/main/java/com/xit/biz/ctgy/dto/struct/MinSimsa680GroupMapstruct.java +++ b/src/main/java/com/xit/biz/ctgy/dto/struct/MinSimsa680GroupMapstruct.java @@ -1,12 +1,12 @@ package com.xit.biz.ctgy.dto.struct; -import com.xit.biz.ctgy.dto.MinSimsa680GroupDto; +import com.xit.biz.ctgy.dto.SimsaListDto; 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 MinSimsa680GroupMapstruct extends IMapstruct { +public interface MinSimsa680GroupMapstruct 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 index 3f7a6ca..66be504 100644 --- a/src/main/java/com/xit/biz/ctgy/entity/GnRecallSc.java +++ b/src/main/java/com/xit/biz/ctgy/entity/GnRecallSc.java @@ -11,18 +11,18 @@ import java.util.Objects; @Schema(name = "GnRecallSc", description = "") @Table(name = "gn_recall_sc", schema = "traffic", catalog = "") -@Entity @SequenceGenerator( name = "RECALL_SC_SEQ_GEN", sequenceName = "GN_RECALL_SC_SEQ", allocationSize = 1 // default = 50 이므로 반드시 setting 필요 ) -@Getter -@NoArgsConstructor(access = AccessLevel.PROTECTED) -@AllArgsConstructor -@Builder +@Entity @DynamicInsert @DynamicUpdate +@AllArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@Getter +@Builder public class GnRecallSc { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "RECALL_SC_SEQ_GEN") diff --git a/src/main/java/com/xit/biz/ctgy/entity/MinCivBoard680.java b/src/main/java/com/xit/biz/ctgy/entity/MinCivBoard680.java index 21e10f7..eef4404 100644 --- a/src/main/java/com/xit/biz/ctgy/entity/MinCivBoard680.java +++ b/src/main/java/com/xit/biz/ctgy/entity/MinCivBoard680.java @@ -11,11 +11,11 @@ import java.io.Serializable; @Schema(name = "MinCivBoard680", description = "게시판") @Table(name = "min_civ_board680", schema = "", catalog = "") @Entity -@Getter -@AllArgsConstructor -@NoArgsConstructor(access = AccessLevel.PROTECTED) @DynamicInsert @DynamicUpdate +@AllArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@Getter @Builder public class MinCivBoard680 implements Serializable { private static final long SerialVersionUID = 1L; diff --git a/src/main/java/com/xit/biz/ctgy/entity/MinMaincode.java b/src/main/java/com/xit/biz/ctgy/entity/MinMaincode.java index 44c350d..f49bb4e 100644 --- a/src/main/java/com/xit/biz/ctgy/entity/MinMaincode.java +++ b/src/main/java/com/xit/biz/ctgy/entity/MinMaincode.java @@ -16,9 +16,9 @@ import java.io.Serializable; @IdClass(MinMaincodePK.class) @DynamicInsert @DynamicUpdate -@Getter @AllArgsConstructor @NoArgsConstructor(access = AccessLevel.PROTECTED) +@Getter @Builder public class MinMaincode implements Serializable { private static final long SerialVersionUID = 1L; diff --git a/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680.java b/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680.java index 7038110..8d0c6f1 100644 --- a/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680.java +++ b/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680.java @@ -10,12 +10,12 @@ import javax.persistence.*; @Schema(name = "MinSimsa680", description = "민원심사") @Table(name = "min_simsa680", schema = "", catalog = "") @Entity -@Getter +@DynamicInsert +@DynamicUpdate @NoArgsConstructor(access = AccessLevel.PROTECTED) @AllArgsConstructor +@Getter @Builder -@DynamicInsert -@DynamicUpdate public class MinSimsa680 { //implements Serializable { //private static final long SerialVersionUID = 1L; @@ -24,25 +24,6 @@ public class MinSimsa680 { //implements Serializable { @Column(name = "ms_maincode") private Long msMaincode; -// @Schema(required = true, title = "민원코드", example = " ", description = "Input Description...") -//// @Column(name = "MS_MAINCODE", nullable = false) -// @OneToOne(fetch = FetchType.LAZY) -// @JoinColumn(name = "rc_code") -// /*private Long msMaincode;*/ -// private Tf680Recall tf680Recall; - - - - - - //@OneToMany(targetEntity = MinSimsaUser680.class, cascade = CascadeType.ALL, orphanRemoval = true) - //@JoinColumn(name = "msu_maincode") - //@OneToMany(targetEntity = MinSimsaUser680.class, mappedBy = "minSimsa680") //, fetch = FetchType.EAGER)//, cascade = CascadeType.ALL, orphanRemoval = true) - //private final Set minSimsaUser680s = new HashSet<>(); - - - - @Schema(required = true, title = "접수번호", example = " ", description = "Input Description...") @Column(name = "ms_seq", nullable = false) diff --git a/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680Sc.java b/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680Sc.java new file mode 100644 index 0000000..23f53c4 --- /dev/null +++ b/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680Sc.java @@ -0,0 +1,86 @@ +package com.xit.biz.ctgy.entity; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +@Schema(name = "MinSimsa680Sc", description = "민원심사") +@Table(name = "min_simsa680_sc", schema = "", catalog = "") +@Entity +@DynamicInsert +@DynamicUpdate +@AllArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@Getter +@Builder +public class MinSimsa680Sc { //implements Serializable { + //private static final long SerialVersionUID = 1L; + + @Schema(required = true, title = "민원코드", example = " ", description = "Input Description...") + @Id + @Column(name = "ms_maincode") + private Long msMaincode; + + + @Schema(required = true, title = "접수번호", example = " ", description = "Input Description...") + @Column(name = "ms_seq", nullable = false) + private String msSeq; + + @Schema(required = true, title = "차량번호", example = " ", description = "Input Description...") + @Column(name = "ms_carnum", nullable = false) + private String msCarnum; + + @Schema(required = true, title = "년도", example = " ", description = "Input Description...") + @Column(name = "ms_year", nullable = false) + private String msYear; + + @Schema(required = true, title = "차수", example = " ", description = "Input Description...") + @Column(name = "ms_chasu", nullable = false) + private Long msChasu; + + @Schema(required = true, title = "심사시작일시", example = " ", description = "Input Description...") + @Column(name = "ms_sdate", nullable = false) + private java.sql.Date msSdate; + + @Schema(required = true, title = "심사시작시간", example = " ", description = "Input Description...") + @Column(name = "ms_startsi", nullable = false) + private String msStartsi; + + @Schema(required = true, title = "심사종료일시", example = " ", description = "Input Description...") + @Column(name = "ms_edate", nullable = false) + private java.sql.Date msEdate; + + @Schema(required = true, title = "심사마감일시", example = " ", description = "Input Description...") + @Column(name = "ms_cdate", nullable = false) + private java.sql.Date msCdate; + + @Schema(required = true, title = "심사마감시간", example = " ", description = "Input Description...") + @Column(name = "ms_closesi", nullable = false) + private String msClosesi; + + @Schema(required = false, title = "단속일자", example = " ", description = "Input Description...") + @Column(name = "ms_wdate", nullable = true) + private java.sql.Date msWdate; + + @Schema(required = false, title = "단속장소", example = " ", description = "Input Description...") + @Column(name = "ms_pos", nullable = true) + private String msPos; + + @Schema(required = false, title = "결과코드", example = " ", description = "Input Description...") + @Column(name = "ms_result", nullable = true) + private String msResult; + + @Schema(required = false, title = "단속시간", example = " ", description = "Input Description...") + @Column(name = "ms_jbtime", nullable = true) + private String msJbtime; + + @Schema(required = false, title = "데이타구분", example = "1", description = "데이타구분: 1-거주자, 2-장애인") + @Column(name = "ms_datagb", nullable = false) + private String msDatagb; +} diff --git a/src/main/java/com/xit/biz/ctgy/entity/MinSimsaUser680.java b/src/main/java/com/xit/biz/ctgy/entity/MinSimsaUser680.java index 3fc6466..22b4e4c 100644 --- a/src/main/java/com/xit/biz/ctgy/entity/MinSimsaUser680.java +++ b/src/main/java/com/xit/biz/ctgy/entity/MinSimsaUser680.java @@ -10,18 +10,18 @@ import java.io.Serializable; @Schema(name = "MinSimsaUser680", description = "민원심사사용자매핑") @Table(name = "min_simsa_user680", schema = "", catalog = "") -@Entity @SequenceGenerator( name = "SIMSA_USER680_SEQ_GEN", sequenceName = "MIN_SIMSA_USER680_SEQ", allocationSize = 1 // default = 50 이므로 반드시 setting 필요 ) -@Getter -@NoArgsConstructor(access = AccessLevel.PROTECTED) -@AllArgsConstructor -@Builder +@Entity @DynamicInsert @DynamicUpdate +@AllArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@Getter +@Builder public class MinSimsaUser680 implements Serializable { private static final long SerialVersionUID = 1L; diff --git a/src/main/java/com/xit/biz/ctgy/entity/MinUserinfo.java b/src/main/java/com/xit/biz/ctgy/entity/MinUserinfo.java index b94e5c6..961626f 100644 --- a/src/main/java/com/xit/biz/ctgy/entity/MinUserinfo.java +++ b/src/main/java/com/xit/biz/ctgy/entity/MinUserinfo.java @@ -15,12 +15,12 @@ import java.util.Set; @Schema(name = "MinUserinfo", description = "null") @Table(name = "min_userinfo", schema = "", catalog = "") @Entity -@Getter -@NoArgsConstructor(access = AccessLevel.PROTECTED) -@AllArgsConstructor -@Builder @DynamicInsert @DynamicUpdate +@AllArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@Getter +@Builder public class MinUserinfo implements Serializable { private static final long SerialVersionUID = 1L; diff --git a/src/main/java/com/xit/biz/ctgy/entity/Tf680Main.java b/src/main/java/com/xit/biz/ctgy/entity/Tf680Main.java index ec11f91..4915a68 100644 --- a/src/main/java/com/xit/biz/ctgy/entity/Tf680Main.java +++ b/src/main/java/com/xit/biz/ctgy/entity/Tf680Main.java @@ -1,9 +1,7 @@ package com.xit.biz.ctgy.entity; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AccessLevel; -import lombok.Data; -import lombok.NoArgsConstructor; +import lombok.*; import org.hibernate.annotations.DynamicInsert; import org.hibernate.annotations.DynamicUpdate; @@ -11,12 +9,14 @@ import javax.persistence.*; import java.io.Serializable; @Schema(name = "Tf680Main", description = "메인") -@NoArgsConstructor(access = AccessLevel.PROTECTED) -@Data -@Entity @Table(name = "tf680_main", schema = "", catalog = "") +@Entity @DynamicInsert @DynamicUpdate +@AllArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@Getter +@Builder public class Tf680Main implements Serializable { private static final long SerialVersionUID = 1L; diff --git a/src/main/java/com/xit/biz/ctgy/entity/Tf680Recall.java b/src/main/java/com/xit/biz/ctgy/entity/Tf680Recall.java index 2369846..f531d7b 100644 --- a/src/main/java/com/xit/biz/ctgy/entity/Tf680Recall.java +++ b/src/main/java/com/xit/biz/ctgy/entity/Tf680Recall.java @@ -9,13 +9,13 @@ import javax.persistence.*; import java.io.Serializable; @Schema(name = "Tf680Recall", description = "민원") -@AllArgsConstructor -@NoArgsConstructor(access = AccessLevel.PROTECTED) -@Data -@Entity @Table(name = "tf680_recall", schema = "", catalog = "") +@Entity @DynamicInsert @DynamicUpdate +@AllArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@Getter @Builder public class Tf680Recall implements Serializable { private static final long SerialVersionUID = 1L; @@ -114,6 +114,7 @@ public class Tf680Recall implements Serializable { @Schema(required = false, title = "답변", example = " ", description = "Input Description...") @Column(name = "rc_answer", nullable = true) + @Setter private String rcAnswer; @Schema(required = false, title = "URL", example = " ", description = "Input Description...") @@ -182,6 +183,7 @@ public class Tf680Recall implements Serializable { @Schema(required = false, title = "인터넷심사전송상태(1:미전송, 2:전송)", example = " ", description = "Input Description...") @Column(name = "rc_ir_transfer", nullable = true) + @Setter private String rcIrTransfer; @Schema(required = false, title = "삭제사유", example = " ", description = "Input Description...") diff --git a/src/main/java/com/xit/biz/ctgy/repository/IParkingRepositoryCustom.java b/src/main/java/com/xit/biz/ctgy/repository/IParkingRepositoryCustom.java index e164c86..9d4e95b 100644 --- a/src/main/java/com/xit/biz/ctgy/repository/IParkingRepositoryCustom.java +++ b/src/main/java/com/xit/biz/ctgy/repository/IParkingRepositoryCustom.java @@ -1,6 +1,6 @@ package com.xit.biz.ctgy.repository; -import com.xit.biz.ctgy.dto.MinSimsa680GroupDto; +import com.xit.biz.ctgy.dto.SimsaListDto; import com.xit.biz.ctgy.dto.MinSimsaReviewGroupDto; import com.xit.biz.ctgy.dto.ParkingTargetDto; import com.xit.biz.ctgy.entity.MinSimsa680; @@ -10,8 +10,8 @@ import org.springframework.data.domain.Pageable; import java.util.List; public interface IParkingRepositoryCustom { - Page findParkings(final MinSimsa680GroupDto pMinSimsa680GroupDto, Pageable pageable); - List findParkingDetails(final MinSimsa680GroupDto minSimsa680GroupDto); + Page findParkings(final SimsaListDto pMinSimsa680GroupDto, Pageable pageable); + List findParkingDetails(final SimsaListDto minSimsa680GroupDto); List findParkingTargets(final ParkingTargetDto dto); diff --git a/src/main/java/com/xit/biz/ctgy/repository/IParkingRepositoryImpl.java b/src/main/java/com/xit/biz/ctgy/repository/IParkingRepositoryImpl.java index 6dadffa..9d09f3d 100644 --- a/src/main/java/com/xit/biz/ctgy/repository/IParkingRepositoryImpl.java +++ b/src/main/java/com/xit/biz/ctgy/repository/IParkingRepositoryImpl.java @@ -8,7 +8,7 @@ import com.querydsl.core.types.dsl.CaseBuilder; import com.querydsl.jpa.JPAExpressions; import com.querydsl.jpa.impl.JPAQueryFactory; import com.xit.biz.ctgy.CtgyConstants; -import com.xit.biz.ctgy.dto.MinSimsa680GroupDto; +import com.xit.biz.ctgy.dto.SimsaListDto; import com.xit.biz.ctgy.dto.MinSimsaReviewGroupDto; import com.xit.biz.ctgy.dto.ParkingTargetDto; import com.xit.biz.ctgy.entity.MinSimsa680; @@ -33,19 +33,19 @@ public class IParkingRepositoryImpl implements IParkingRepositoryCustom { private final JPAQueryFactory queryFactory; @Override - public Page findParkings(final MinSimsa680GroupDto pMinSimsa680GroupDto, Pageable pageable) { + public Page findParkings(final SimsaListDto dto, Pageable pageable) { BooleanBuilder builder = new BooleanBuilder(); - if (!Checks.isEmpty(pMinSimsa680GroupDto.getMsYear())) { - builder.and(minSimsa680.msYear.eq(pMinSimsa680GroupDto.getMsYear())); + if (!Checks.isEmpty(dto.getMsYear())) { + builder.and(minSimsa680.msYear.eq(dto.getMsYear())); } - if (!Checks.isEmpty(pMinSimsa680GroupDto.getMsChasu())) { - builder.and(minSimsa680.msChasu.like(String.valueOf(pMinSimsa680GroupDto.getMsChasu()))); + if (!Checks.isEmpty(dto.getMsChasu())) { + builder.and(minSimsa680.msChasu.like(String.valueOf(dto.getMsChasu()))); } - QueryResults rslt = + QueryResults rslt = queryFactory .select(Projections.fields( - MinSimsa680GroupDto.class, + SimsaListDto.class, minSimsa680.msYear, minSimsa680.msChasu, minSimsa680.msSdate, @@ -68,7 +68,7 @@ public class IParkingRepositoryImpl implements IParkingRepositoryCustom { } @Override - public List findParkingDetails(final MinSimsa680GroupDto dto) { + public List findParkingDetails(final SimsaListDto dto) { BooleanBuilder builder = new BooleanBuilder(); builder.and(minSimsa680.msSdate.eq(dto.getMsSdate())); diff --git a/src/main/java/com/xit/biz/ctgy/repository/IResidentRepository.java b/src/main/java/com/xit/biz/ctgy/repository/IResidentRepository.java index 5d39eae..ecf3765 100644 --- a/src/main/java/com/xit/biz/ctgy/repository/IResidentRepository.java +++ b/src/main/java/com/xit/biz/ctgy/repository/IResidentRepository.java @@ -7,7 +7,7 @@ import org.springframework.data.repository.query.Param; public interface IResidentRepository extends JpaRepository, IResidentRepositoryCustom { - // TODO : Ansi - sql 미사용 + // TODO : Ansi - sql 미사용, 채번테이블 사용하도록 변경 필요 //@Query(value = "SELECT max(e.sc_code) + 1 FROM gn_recall_sc e, nativeQuery = true) @Query(value = "SELECT rpad(nvl(max(e.sc_seq), :year), 10, '0') + 1 FROM gn_recall_sc e WHERE e.sc_datagb = :scDatagb AND e.sc_seq LIKE :year||'%' ", nativeQuery = true) Long getGnRecallScMaxScSeq(@Param("year") String year, @Param("scDatagb") String scDatagb); diff --git a/src/main/java/com/xit/biz/ctgy/repository/IResidentRepositoryCustom.java b/src/main/java/com/xit/biz/ctgy/repository/IResidentRepositoryCustom.java index a63e952..c6010ef 100644 --- a/src/main/java/com/xit/biz/ctgy/repository/IResidentRepositoryCustom.java +++ b/src/main/java/com/xit/biz/ctgy/repository/IResidentRepositoryCustom.java @@ -1,6 +1,7 @@ package com.xit.biz.ctgy.repository; import com.xit.biz.ctgy.dto.GnRecallScDto; +import com.xit.biz.ctgy.dto.SimsaListDto; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; @@ -9,4 +10,6 @@ public interface IResidentRepositoryCustom { GnRecallScDto findResident(final Long scCode); + Page findResidents(SimsaListDto dto, 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 index 4d8da43..7ae5384 100644 --- a/src/main/java/com/xit/biz/ctgy/repository/IResidentRepositoryImpl.java +++ b/src/main/java/com/xit/biz/ctgy/repository/IResidentRepositoryImpl.java @@ -8,6 +8,8 @@ import com.querydsl.jpa.JPAExpressions; import com.querydsl.jpa.impl.JPAQueryFactory; import com.xit.biz.ctgy.CtgyConstants; import com.xit.biz.ctgy.dto.GnRecallScDto; +import com.xit.biz.ctgy.dto.SimsaListDto; +import com.xit.biz.ctgy.dto.ResidentDto; import com.xit.core.util.Checks; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Page; @@ -19,6 +21,7 @@ import java.util.List; import static com.xit.biz.cmm.entity.QCmmCodeS.cmmCodeS; import static com.xit.biz.ctgy.entity.QGnRecallSc.gnRecallSc; +import static com.xit.biz.ctgy.entity.QMinSimsa680Sc.minSimsa680Sc; @RequiredArgsConstructor public class IResidentRepositoryImpl implements IResidentRepositoryCustom { @@ -166,4 +169,43 @@ WHERE SC_DATAGB = '1' AND SC_CODE = */ } + + @Override + public Page findResidents(final SimsaListDto dto, Pageable pageable) { + + BooleanBuilder builder = new BooleanBuilder(); + if (!Checks.isEmpty(dto.getMsYear())) { + builder.and(minSimsa680Sc.msYear.eq(dto.getMsYear())); + } + if (!Checks.isEmpty(dto.getMsChasu())) { + builder.and(minSimsa680Sc.msChasu.eq(dto.getMsChasu())); + } + if (!Checks.isEmpty(dto.getMsDatagb())) { + builder.and(minSimsa680Sc.msDatagb.eq(dto.getMsDatagb())); + } + QueryResults rslt = + queryFactory + .select(Projections.fields( + SimsaListDto.class, + minSimsa680Sc.msYear, + minSimsa680Sc.msChasu, + minSimsa680Sc.msSdate, + minSimsa680Sc.msStartsi, + minSimsa680Sc.msEdate, + minSimsa680Sc.msCdate, + minSimsa680Sc.msClosesi, + minSimsa680Sc.msDatagb, + minSimsa680Sc.count().as("cnt") + )) + .from(minSimsa680Sc) + .where(builder) + .groupBy(minSimsa680Sc.msYear, minSimsa680Sc.msChasu, minSimsa680Sc.msSdate, minSimsa680Sc.msStartsi, minSimsa680Sc.msEdate, minSimsa680Sc.msCdate, minSimsa680Sc.msClosesi) + .orderBy(minSimsa680Sc.msYear.desc(), minSimsa680Sc.msChasu.desc()) + .offset(pageable.getOffset()) + .limit(pageable.getPageSize()) + .fetchResults(); + + + return new PageImpl<>(rslt.getResults(), pageable, rslt.getTotal()); + } } \ No newline at end of file diff --git a/src/main/java/com/xit/biz/ctgy/service/IParkingService.java b/src/main/java/com/xit/biz/ctgy/service/IParkingService.java index 7a17338..d8b99aa 100644 --- a/src/main/java/com/xit/biz/ctgy/service/IParkingService.java +++ b/src/main/java/com/xit/biz/ctgy/service/IParkingService.java @@ -1,6 +1,6 @@ package com.xit.biz.ctgy.service; -import com.xit.biz.ctgy.dto.MinSimsa680GroupDto; +import com.xit.biz.ctgy.dto.SimsaListDto; import com.xit.biz.ctgy.dto.ParkingTargetDto; import com.xit.biz.ctgy.entity.MinSimsa680; import org.springframework.data.domain.Page; @@ -11,8 +11,8 @@ import java.util.List; public interface IParkingService { //Page findMinSimsa680Groups(MinSimsa680 minSimsa680, Pageable pageable); - Page findParkings(final MinSimsa680GroupDto minSimsa680GroupDto, Pageable pageable); - List findParkingDetails(final MinSimsa680GroupDto minSimsa680GroupDto); + Page findParkings(final SimsaListDto minSimsa680GroupDto, Pageable pageable); + List findParkingDetails(final SimsaListDto minSimsa680GroupDto); List findParkingTargets(final ParkingTargetDto dto) ; // Page findAll(final MinSimsa680 minSimsa680, Pageable pageable); diff --git a/src/main/java/com/xit/biz/ctgy/service/IResidentService.java b/src/main/java/com/xit/biz/ctgy/service/IResidentService.java index 204e3ae..9613e75 100644 --- a/src/main/java/com/xit/biz/ctgy/service/IResidentService.java +++ b/src/main/java/com/xit/biz/ctgy/service/IResidentService.java @@ -1,7 +1,9 @@ package com.xit.biz.ctgy.service; import com.xit.biz.ctgy.dto.GnRecallScDto; +import com.xit.biz.ctgy.dto.ResidentDto; import com.xit.biz.ctgy.dto.ResidentTargetDto; +import com.xit.biz.ctgy.dto.SimsaListDto; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; @@ -19,4 +21,6 @@ public interface IResidentService { List findResidentTargets(final ResidentTargetDto dto) ; void saveResidentTargets(ResidentTargetDto dto); + + Page findResidents(SimsaListDto dto, Pageable pageable); } 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 8acd39f..52b3829 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 @@ -1,7 +1,7 @@ package com.xit.biz.ctgy.service.impl; import com.xit.biz.ctgy.CtgyConstants; -import com.xit.biz.ctgy.dto.MinSimsa680GroupDto; +import com.xit.biz.ctgy.dto.SimsaListDto; import com.xit.biz.ctgy.dto.ParkingTargetDto; import com.xit.biz.ctgy.entity.MinSimsa680; import com.xit.biz.ctgy.entity.MinSimsaUser680; @@ -48,13 +48,13 @@ public class ParkingService implements IParkingService { @Override @Transactional(readOnly = true) - public Page findParkings(final MinSimsa680GroupDto minSimsa680GroupDto, Pageable pageable) { + public Page findParkings(final SimsaListDto minSimsa680GroupDto, Pageable pageable) { return simsaRepository.findParkings(minSimsa680GroupDto, pageable); } @Override @Transactional(readOnly = true) - public List findParkingDetails(final MinSimsa680GroupDto minSimsa680GroupDto) { + public List findParkingDetails(final SimsaListDto minSimsa680GroupDto) { return simsaRepository.findParkingDetails(minSimsa680GroupDto); } @@ -97,7 +97,8 @@ public class ParkingService implements IParkingService { .msuMaincode(rcCode) .msuUserid(u.getUserid()) .msuResult(CtgyConstants.SimsaUserInfo.MSU_RESULT_NONE.getCode()) - //.msuReason() + //.msuReaso + // n() .msuTeam(dto.getMsuTeam()) //.msuIndate() .build() 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 index 43c96bd..2379d3c 100644 --- a/src/main/java/com/xit/biz/ctgy/service/impl/ResidentService.java +++ b/src/main/java/com/xit/biz/ctgy/service/impl/ResidentService.java @@ -4,6 +4,7 @@ import com.xit.biz.cmm.service.ICmmFileService; import com.xit.biz.ctgy.CtgyConstants; import com.xit.biz.ctgy.dto.GnRecallScDto; import com.xit.biz.ctgy.dto.ResidentTargetDto; +import com.xit.biz.ctgy.dto.SimsaListDto; import com.xit.biz.ctgy.dto.struct.GnRecallScMapstruct; import com.xit.biz.ctgy.entity.*; import com.xit.biz.ctgy.repository.*; @@ -113,6 +114,13 @@ public class ResidentService implements IResidentService { } } + + @Override + public Page findResidents(SimsaListDto dto, Pageable pageable) { + pageable = JpaUtil.getPagingInfo(pageable); + return repository.findResidents(dto, pageable); + } + @Override @Transactional(readOnly = true) public List findResidentTargets(ResidentTargetDto dto) { @@ -166,4 +174,5 @@ public class ResidentService implements IResidentService { //// simsaRepository.save // return simsaRepository.findParkingTargets(dto); } + }