From 0c1d3bde3d8d94a610a79d0e2e88d1c9c697fb12 Mon Sep 17 00:00:00 2001 From: Lim Jonguk Date: Wed, 16 Mar 2022 18:48:48 +0900 Subject: [PATCH] =?UTF-8?q?fix=20:=20=EC=A3=BC=EC=A0=95=EC=B0=A8=20?= =?UTF-8?q?=EC=8B=AC=EC=9D=98=20=EC=83=81=EC=84=B8=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IMinSimsa680RepositoryImpl.java | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/main/java/com/xit/biz/ctgy/repository/IMinSimsa680RepositoryImpl.java b/src/main/java/com/xit/biz/ctgy/repository/IMinSimsa680RepositoryImpl.java index 41aa325..3c47400 100644 --- a/src/main/java/com/xit/biz/ctgy/repository/IMinSimsa680RepositoryImpl.java +++ b/src/main/java/com/xit/biz/ctgy/repository/IMinSimsa680RepositoryImpl.java @@ -7,12 +7,15 @@ import com.querydsl.core.types.dsl.CaseBuilder; import com.querydsl.jpa.impl.JPAQueryFactory; import com.xit.biz.ctgy.dto.MinSimsa680GroupDto; import com.xit.biz.ctgy.dto.MinSimsaReviewGroupDto; +import com.xit.biz.ctgy.entity.MinSimsa680; import com.xit.core.util.Checks; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.Pageable; +import java.time.LocalDate; + 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.QMinUserinfo.minUserinfo; @@ -64,6 +67,42 @@ public class IMinSimsa680RepositoryImpl implements IMinSimsa680RepositoryCustom return new PageImpl<>(rslt.getResults(), pageable, rslt.getTotal()); } + public Page findMinSimsa680Details(MinSimsa680GroupDto dto, Pageable pageable){ + //LocalDate now = LocalDate.now(); + LocalDate now = LocalDate.of(2021, 12, 11); + LocalDate now2 = LocalDate.of(2021, 12, 12); + + + queryFactory + .select(minSimsa680.msSeq, + minSimsa680.msCarnum, + minSimsa680.msMaincode) + .from(minSimsaUser680) + .join(minSimsa680) + .on(minSimsa680.msMaincode.eq(minSimsaUser680.msuMaincode)) + .join(minUserinfo) + .on(minSimsaUser680.msuUserid.eq(minUserinfo.userid)) + .where(minSimsaUser680.msuTeam.eq(""), + minSimsa680.msChasu.eq(1L), + minSimsa680.msSdate.eq(java.sql.Date.valueOf(now)), + minSimsa680.msEdate.eq(java.sql.Date.valueOf(now2))) + .groupBy(minSimsa680.msCarnum, + minSimsa680.msSeq, + minSimsa680.msMaincode) + .orderBy(minSimsa680.msSeq.asc()) + .offset(0L) + .limit(10L) + //, minSimsa680.msSdate.eq(java.sql.Date.valueOf(now))) + .fetchResults(); +// jpaQueryFactory.selectFrom(minSimsa680) +// .leftJoin(minSimsa680.msMaincode, minSimsaUser680).fetchJoin() +// .groupBy(minSimsa680.msEdate, minSimsaUser680.msuTeam, qMinUserinfo.name) +// .orderBy(minSimsa680.msChasu.desc()) +// //.where(minSimsa680.name.eq(name)) + // .fetch(); + + } + @Override public Page findMinSimsa680s2(Pageable pageable) { /*