|
|
|
@ -9,6 +9,7 @@ import com.querydsl.jpa.impl.JPAQueryFactory;
|
|
|
|
|
import com.xit.biz.ctgy.CtgyConstants;
|
|
|
|
|
import com.xit.biz.ctgy.dto.JudgeListDto;
|
|
|
|
|
import com.xit.biz.ctgy.dto.ParkingTargetDto;
|
|
|
|
|
import com.xit.biz.ctgy.entity.MinSimsa680;
|
|
|
|
|
import com.xit.core.util.Checks;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import org.springframework.data.domain.Page;
|
|
|
|
@ -19,6 +20,8 @@ import java.util.List;
|
|
|
|
|
|
|
|
|
|
import static com.xit.biz.cmm.entity.QCmmCodeS.cmmCodeS;
|
|
|
|
|
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;
|
|
|
|
|
import static com.xit.biz.ctgy.entity.QTf680Main.tf680Main;
|
|
|
|
|
import static com.xit.biz.ctgy.entity.QTf680Recall.tf680Recall;
|
|
|
|
|
|
|
|
|
@ -62,37 +65,37 @@ public class IParkingRepositoryImpl implements IParkingRepositoryCustom {
|
|
|
|
|
return new PageImpl<>(rslt.getResults(), pageable, rslt.getTotal());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @Override
|
|
|
|
|
// public List<MinSimsa680> findParkingDetails(final JudgeListDto dto) {
|
|
|
|
|
//
|
|
|
|
|
// BooleanBuilder builder = new BooleanBuilder();
|
|
|
|
|
// builder.and(minSimsa680.msSdate.eq(dto.getMsSdate()));
|
|
|
|
|
// builder.and(minSimsa680.msEdate.eq(dto.getMsEdate()));
|
|
|
|
|
//
|
|
|
|
|
// if (!Checks.isEmpty(dto.getMsuTeam())) {
|
|
|
|
|
// builder.and(minSimsaUser680.msuTeam.eq(dto.getMsuTeam()));
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// List<MinSimsa680> rslt =
|
|
|
|
|
// queryFactory
|
|
|
|
|
// .select(Projections.fields(MinSimsa680.class,
|
|
|
|
|
// 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(builder)
|
|
|
|
|
// .groupBy(minSimsa680.msCarnum,
|
|
|
|
|
// minSimsa680.msSeq,
|
|
|
|
|
// minSimsa680.msMaincode)
|
|
|
|
|
// .orderBy(minSimsa680.msSeq.asc())
|
|
|
|
|
// .fetch();
|
|
|
|
|
//
|
|
|
|
|
// return rslt;
|
|
|
|
|
// }
|
|
|
|
|
@Override
|
|
|
|
|
public List<MinSimsa680> findParkingDetails(final JudgeListDto dto) {
|
|
|
|
|
|
|
|
|
|
BooleanBuilder builder = new BooleanBuilder();
|
|
|
|
|
builder.and(minSimsa680.msSdate.gt(dto.getMsSdate()));
|
|
|
|
|
builder.and(minSimsa680.msEdate.lt(dto.getMsEdate()));
|
|
|
|
|
|
|
|
|
|
if (!Checks.isEmpty(dto.getMsuTeam())) {
|
|
|
|
|
builder.and(minSimsaUser680.msuTeam.eq(dto.getMsuTeam()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<MinSimsa680> rslt =
|
|
|
|
|
queryFactory
|
|
|
|
|
.select(Projections.fields(MinSimsa680.class,
|
|
|
|
|
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(builder)
|
|
|
|
|
.groupBy(minSimsa680.msCarnum,
|
|
|
|
|
minSimsa680.msSeq,
|
|
|
|
|
minSimsa680.msMaincode)
|
|
|
|
|
.orderBy(minSimsa680.msSeq.asc())
|
|
|
|
|
.fetch();
|
|
|
|
|
|
|
|
|
|
return rslt;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<ParkingTargetDto> findParkingJudgeTargets(final ParkingTargetDto dto) {
|
|
|
|
@ -148,42 +151,14 @@ public class IParkingRepositoryImpl implements IParkingRepositoryCustom {
|
|
|
|
|
return rslt;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @Override
|
|
|
|
|
// public Page<MinSimsaReviewGroupDto> findMinSimsa680s2(Pageable pageable) {
|
|
|
|
|
// /*
|
|
|
|
|
// SELECT MS_EDATE, MSU_TEAM, NAME, SUM(DECODE(MSU_RESULT, 0, 0, 1)) CLCNT, COUNT(*) TOTCNT
|
|
|
|
|
// FROM MIN_USERINFO, MIN_SIMSA_USER680, MIN_SIMSA680
|
|
|
|
|
// WHERE USERID = MSU_USERID AND MS_MAINCODE = MSU_MAINCODE
|
|
|
|
|
// GROUP BY MS_EDATE, MSU_TEAM, NAME
|
|
|
|
|
// ORDER BY MS_EDATE DESC, MSU_TEAM, NAME
|
|
|
|
|
// */
|
|
|
|
|
//
|
|
|
|
|
//// Expression<Long> rsltEa = new CaseBuilder()
|
|
|
|
|
//// .when(minSimsaUser680.msuResult.eq("0")).then(0L)
|
|
|
|
|
//// .otherwise(1L).sum().as("clcnt");
|
|
|
|
|
// QueryResults<MinSimsaReviewGroupDto> rslt =
|
|
|
|
|
// queryFactory
|
|
|
|
|
// .select(Projections.fields(
|
|
|
|
|
// MinSimsaReviewGroupDto.class,
|
|
|
|
|
// minSimsa680.msEdate,
|
|
|
|
|
// minSimsaUser680.msuTeam,
|
|
|
|
|
// minUserinfo.name,
|
|
|
|
|
// new CaseBuilder()
|
|
|
|
|
// .when(minSimsaUser680.msuResult.eq("0")).then(0L)
|
|
|
|
|
// .otherwise(1L).sum().as("clcnt"),
|
|
|
|
|
// minSimsa680.count().as("totcnt")
|
|
|
|
|
// ))
|
|
|
|
|
// .from(minSimsaUser680)
|
|
|
|
|
// .join(minSimsa680)
|
|
|
|
|
// .on(minSimsa680.msMaincode.eq(minSimsaUser680.msuMaincode))
|
|
|
|
|
// .join(minUserinfo)
|
|
|
|
|
// .on(minSimsaUser680.msuUserid.eq(minUserinfo.userid))
|
|
|
|
|
// .groupBy(minSimsa680.msEdate, minSimsaUser680.msuTeam, minUserinfo.name)
|
|
|
|
|
// .orderBy(minSimsa680.msEdate.desc(), minSimsaUser680.msuTeam.asc(), minUserinfo.name.asc())
|
|
|
|
|
// .offset(pageable.getOffset())
|
|
|
|
|
// .limit(pageable.getPageSize())
|
|
|
|
|
// .fetchResults();
|
|
|
|
|
// private BooleanExpression startDateGt(LocalDate sDate){
|
|
|
|
|
// if(sDate == null) return null;
|
|
|
|
|
// return minSimsa680.msSdate.gt(sDate);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// return new PageImpl<>(rslt.getResults(), pageable, rslt.getTotal());
|
|
|
|
|
// private BooleanExpression endDateGt(LocalDate eDate){
|
|
|
|
|
// if(eDate == null) return null;
|
|
|
|
|
// return minSimsa680.msEdate.gt(eDate);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|