feat: 거주자의견진술 자료조회 반영

dev
minuk926 3 years ago
parent 027372d6c4
commit 0f63e7fcba

@ -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;

@ -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<? extends IRestResponse> 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<? extends IRestResponse> findByScCode(@PathVariable final Long scCode) {
return RestResponse.of(service.findByScCode(scCode));
}
}

@ -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;
}

@ -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;

@ -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;
}

@ -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<GnRecallScDto, GnRecallSc> {
}

@ -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);
}
}

@ -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<GnRecallSc, Long>, IResidentRepositoryCustom {
GnRecallSc findByScCode(Long scCode);
}

@ -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<GnRecallScDto> findResidents(Pageable pageable);
}

@ -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<GnRecallScDto> 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<GnRecallScDto> 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());
}
}

@ -9,48 +9,4 @@ import javax.annotation.Nonnull;
import java.time.LocalDate;
public interface ISimsaRepository extends JpaRepository<MinSimsa680, Long>, 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);
}

@ -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)

@ -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<GnRecallScDto> findResidents(Pageable pageable);
Page<GnRecallSc> findAll(GnRecallSc entity, Pageable pageable);
GnRecallSc findByScCode(Long scCode);
}

@ -126,6 +126,7 @@ public class ParkingService implements IParkingService {
}
@Override
@Transactional
public MinSimsa680 saveParkingSimsa(MinSimsa680 entity) {
return simsaRepository.saveAndFlush(entity);
}

@ -17,6 +17,7 @@ public class PublicBoardService implements IPublicBoardService {
private final IPublicBoardRepository repository;
@Override
@Transactional(readOnly = true)
public Page<MinInfoBoard680> 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);
}

@ -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<GnRecallScDto> findResidents(Pageable pageable) {
// Sort sort = Sort.by(Sort.Direction.DESC, "inCode");
pageable = JpaUtil.getPagingInfo(pageable);
Page<GnRecallScDto> page = repository.findResidents(
PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), Sort.by("scCode").descending()));
// List<CmmUser> userList = page.getContent();
return page;
}
@Override
@Transactional(readOnly = true)
public Page<GnRecallSc> 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<GnRecallSc> example = Example.of(entity, exampleMatcher);
Page<GnRecallSc> page = repository.findAll(
example,
PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), Sort.by("scCode").descending()));
// List<CmmUser> userList = page.getContent();
return page;
}
@Override
@Transactional(readOnly = true)
public GnRecallSc findByScCode(Long scCode) {
return repository.findByScCode(scCode);
}
}
Loading…
Cancel
Save