|
|
@ -1,32 +1,80 @@
|
|
|
|
package com.xit.biz.ctgy.repository;
|
|
|
|
package com.xit.biz.ctgy.repository;
|
|
|
|
|
|
|
|
|
|
|
|
import com.querydsl.jpa.impl.JPAQueryFactory;
|
|
|
|
import com.querydsl.jpa.impl.JPAQueryFactory;
|
|
|
|
|
|
|
|
import com.xit.core.util.DateUtil;
|
|
|
|
|
|
|
|
import org.junit.jupiter.api.AfterEach;
|
|
|
|
|
|
|
|
import org.junit.jupiter.api.BeforeEach;
|
|
|
|
import org.junit.jupiter.api.DisplayName;
|
|
|
|
import org.junit.jupiter.api.DisplayName;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
|
|
|
|
import org.springframework.test.context.ActiveProfiles;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.persistence.EntityManager;
|
|
|
|
import javax.persistence.EntityManager;
|
|
|
|
import javax.transaction.Transactional;
|
|
|
|
import javax.transaction.Transactional;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.sql.Date;
|
|
|
|
|
|
|
|
import java.time.LocalDate;
|
|
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
|
|
|
|
|
|
|
|
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.QMinUserinfo.minUserinfo;
|
|
|
|
import static org.junit.jupiter.api.Assertions.*;
|
|
|
|
import static org.junit.jupiter.api.Assertions.*;
|
|
|
|
|
|
|
|
|
|
|
|
@SpringBootTest
|
|
|
|
@SpringBootTest
|
|
|
|
@Transactional
|
|
|
|
@Transactional
|
|
|
|
|
|
|
|
@ActiveProfiles({"dev"})
|
|
|
|
class IMinSimsa680RepositoryTest {
|
|
|
|
class IMinSimsa680RepositoryTest {
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private IMinSimsa680Repository iMinSimsa680Repository;
|
|
|
|
EntityManager em;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JPAQueryFactory queryFactory;
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private JPAQueryFactory jpaQueryFactory;
|
|
|
|
private IMinSimsa680Repository iMinSimsa680Repository;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@BeforeEach
|
|
|
|
|
|
|
|
void beforeEach(){
|
|
|
|
|
|
|
|
queryFactory = new JPAQueryFactory(em);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AfterEach
|
|
|
|
|
|
|
|
void afterEach(){
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
@DisplayName("wwwww")
|
|
|
|
@DisplayName("sim_result:심사목록에서 기간 클릭시")
|
|
|
|
void findMinSimsa680s2() {
|
|
|
|
void sim_result() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//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)
|
|
|
|
// jpaQueryFactory.selectFrom(minSimsa680)
|
|
|
|
// .leftJoin(minSimsa680.msMaincode, minSimsaUser680).fetchJoin()
|
|
|
|
// .leftJoin(minSimsa680.msMaincode, minSimsaUser680).fetchJoin()
|
|
|
|
// .groupBy(minSimsa680.msEdate, minSimsaUser680.msuTeam, qMinUserinfo.name)
|
|
|
|
// .groupBy(minSimsa680.msEdate, minSimsaUser680.msuTeam, qMinUserinfo.name)
|
|
|
@ -36,4 +84,14 @@ class IMinSimsa680RepositoryTest {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// @BeforeAll
|
|
|
|
|
|
|
|
// void beforeAll(){
|
|
|
|
|
|
|
|
// log.debug("initializing...");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// @AfterAll
|
|
|
|
|
|
|
|
// void afterAll(){
|
|
|
|
|
|
|
|
// log.debug("...shutdown");
|
|
|
|
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|