심사 상세 목록

dev
minuk926 3 years ago
parent a96672d534
commit 8bfb63d06d

@ -57,11 +57,10 @@ public class MinSimsa680Controller {
@Operation(summary = "심사(대상) 상세 조회" , description = "심사(대상) 상세 조회") @Operation(summary = "심사(대상) 상세 조회" , description = "심사(대상) 상세 조회")
@Parameters({ @Parameters({
@Parameter(in = ParameterIn.QUERY, name = "msYear", description = "심사년도", required = true, example = "2021"), @Parameter(in = ParameterIn.QUERY, name = "msSdate", description = "심사시작일", required = true, example = "2021-01-04"),
@Parameter(in = ParameterIn.QUERY, name = "msChasu", description = "차수", required = false, example = " "), @Parameter(in = ParameterIn.QUERY, name = "msEdate", description = "심사종료일", required = true, example = "2021-01-05"),
@Parameter(in = ParameterIn.QUERY, name = "page", description = "페이지", required = true, example = "0"), @Parameter(in = ParameterIn.QUERY, name = "msChasu", description = "차수", required = false, example = "3"),
@Parameter(in = ParameterIn.QUERY, name = "size", description = "페이지당갯수", required = true, example = "10") @Parameter(in = ParameterIn.QUERY, name = "msuTeam", description = "팀코드", required = true, example = "002")
}) })
@GetMapping(value="details", produces = MediaType.APPLICATION_JSON_VALUE) @GetMapping(value="details", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> findMinSimsa680Details( public ResponseEntity<? extends IRestResponse> findMinSimsa680Details(
@ -70,7 +69,7 @@ public class MinSimsa680Controller {
final MinSimsa680GroupDto minSimsa680GroupDto, final MinSimsa680GroupDto minSimsa680GroupDto,
@Parameter(hidden = true) @Parameter(hidden = true)
final Pageable pageable) { final Pageable pageable) {
return RestResponse.of(service.findMinSimsa680Details(minSimsa680GroupDto, pageable)); return RestResponse.of(service.findMinSimsa680Details(minSimsa680GroupDto));
} }
// TODO :: 파라메터 정의 필요 // TODO :: 파라메터 정의 필요

@ -26,5 +26,5 @@ public class MinSimsa680GroupDto {
private String msClosesi; private String msClosesi;
private Long cnt; private Long cnt;
private String msuTeam;
} }

@ -6,9 +6,11 @@ import com.xit.biz.ctgy.entity.MinSimsa680;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import java.util.List;
public interface IMinSimsa680RepositoryCustom { public interface IMinSimsa680RepositoryCustom {
Page<MinSimsa680GroupDto> findMinSimsa680Groups(MinSimsa680GroupDto pMinSimsa680GroupDto, Pageable pageable); Page<MinSimsa680GroupDto> findMinSimsa680Groups(MinSimsa680GroupDto pMinSimsa680GroupDto, Pageable pageable);
Page<MinSimsa680> findMinSimsa680Details(MinSimsa680GroupDto minSimsa680GroupDto, Pageable pageable); List<MinSimsa680> findMinSimsa680Details(MinSimsa680GroupDto minSimsa680GroupDto);
Page<MinSimsaReviewGroupDto> findMinSimsa680s2(Pageable pageable); Page<MinSimsaReviewGroupDto> findMinSimsa680s2(Pageable pageable);
} }

@ -15,6 +15,7 @@ import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.List;
import static com.xit.biz.ctgy.entity.QMinSimsa680.minSimsa680; import static com.xit.biz.ctgy.entity.QMinSimsa680.minSimsa680;
import static com.xit.biz.ctgy.entity.QMinSimsaUser680.minSimsaUser680; import static com.xit.biz.ctgy.entity.QMinSimsaUser680.minSimsaUser680;
@ -67,8 +68,18 @@ public class IMinSimsa680RepositoryImpl implements IMinSimsa680RepositoryCustom
return new PageImpl<>(rslt.getResults(), pageable, rslt.getTotal()); return new PageImpl<>(rslt.getResults(), pageable, rslt.getTotal());
} }
public Page<MinSimsa680> findMinSimsa680Details(MinSimsa680GroupDto dto, Pageable pageable) { public List<MinSimsa680> findMinSimsa680Details(MinSimsa680GroupDto dto) {
QueryResults<MinSimsa680> rslt =
BooleanBuilder builder = new BooleanBuilder();
builder.and(minSimsa680.msSdate.eq(dto.getMsSdate()));
builder.and(minSimsa680.msEdate.eq(dto.getMsEdate()));
builder.and(minSimsaUser680.msuTeam.eq(dto.getMsuTeam()));
if (!Checks.isEmpty(dto.getMsChasu())) {
builder.and(minSimsa680.msChasu.eq(dto.getMsChasu()));
}
List<MinSimsa680> rslt =
queryFactory queryFactory
.select(Projections.fields(MinSimsa680.class, .select(Projections.fields(MinSimsa680.class,
minSimsa680.msSeq, minSimsa680.msSeq,
@ -79,19 +90,14 @@ public class IMinSimsa680RepositoryImpl implements IMinSimsa680RepositoryCustom
.on(minSimsa680.msMaincode.eq(minSimsaUser680.msuMaincode)) .on(minSimsa680.msMaincode.eq(minSimsaUser680.msuMaincode))
.join(minUserinfo) .join(minUserinfo)
.on(minSimsaUser680.msuUserid.eq(minUserinfo.userid)) .on(minSimsaUser680.msuUserid.eq(minUserinfo.userid))
.where(minSimsaUser680.msuTeam.eq(""), .where(builder)
minSimsa680.msChasu.eq(dto.getMsChasu()),
minSimsa680.msSdate.eq(dto.getMsSdate()),
minSimsa680.msEdate.eq(dto.getMsEdate()))
.groupBy(minSimsa680.msCarnum, .groupBy(minSimsa680.msCarnum,
minSimsa680.msSeq, minSimsa680.msSeq,
minSimsa680.msMaincode) minSimsa680.msMaincode)
.orderBy(minSimsa680.msSeq.asc()) .orderBy(minSimsa680.msSeq.asc())
.offset(pageable.getOffset()) .fetch();
.limit(pageable.getPageSize())
.fetchResults();
return new PageImpl<>(rslt.getResults(), pageable, rslt.getTotal()); return rslt;
} }
@Override @Override

@ -6,11 +6,13 @@ import com.xit.biz.ctgy.entity.MinSimsa680;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import java.util.List;
public interface IMinSimsa680Service { public interface IMinSimsa680Service {
//Page<MinSimsa680GroupDto> findMinSimsa680Groups(MinSimsa680 minSimsa680, Pageable pageable); //Page<MinSimsa680GroupDto> findMinSimsa680Groups(MinSimsa680 minSimsa680, Pageable pageable);
Page<MinSimsa680GroupDto> findMinSimsa680Groups(MinSimsa680GroupDto minSimsa680GroupDto, Pageable pageable); Page<MinSimsa680GroupDto> findMinSimsa680Groups(MinSimsa680GroupDto minSimsa680GroupDto, Pageable pageable);
Page<MinSimsa680> findMinSimsa680Details(MinSimsa680GroupDto minSimsa680GroupDto, Pageable pageable); List<MinSimsa680> findMinSimsa680Details(MinSimsa680GroupDto minSimsa680GroupDto);
Page<MinSimsa680> findMinSimsa680s(MinSimsa680 minSimsa680, Pageable pageable); Page<MinSimsa680> findMinSimsa680s(MinSimsa680 minSimsa680, Pageable pageable);

@ -11,6 +11,8 @@ import org.springframework.data.domain.*;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains; import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains;
@Service @Service
@ -37,8 +39,8 @@ public class MinSimsa680Service implements IMinSimsa680Service {
} }
@Transactional(readOnly = true) @Transactional(readOnly = true)
public Page<MinSimsa680> findMinSimsa680Details(MinSimsa680GroupDto minSimsa680GroupDto, Pageable pageable) { public List<MinSimsa680> findMinSimsa680Details(MinSimsa680GroupDto minSimsa680GroupDto) {
return repository.findMinSimsa680Details(minSimsa680GroupDto, pageable); return repository.findMinSimsa680Details(minSimsa680GroupDto);
} }
@Transactional(readOnly = true) @Transactional(readOnly = true)

Loading…
Cancel
Save