querydsl 적용(rebuild시 에러 발생하는것 fix)
parent
0c1d3bde3d
commit
e70c818eca
@ -0,0 +1,111 @@
|
|||||||
|
package com.xit.biz.ctgy.repository;
|
||||||
|
|
||||||
|
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||||
|
import org.junit.jupiter.api.AfterEach;
|
||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.DisplayName;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.context.ActiveProfiles;
|
||||||
|
|
||||||
|
import javax.persistence.EntityManager;
|
||||||
|
import javax.transaction.Transactional;
|
||||||
|
import java.sql.Date;
|
||||||
|
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;
|
||||||
|
|
||||||
|
@SpringBootTest
|
||||||
|
@Transactional
|
||||||
|
@ActiveProfiles({"dev"})
|
||||||
|
class RecallRepositoryTest {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
EntityManager em;
|
||||||
|
|
||||||
|
private JPAQueryFactory queryFactory;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMinSimsa680Repository iMinSimsa680Repository;
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
void beforeEach(){
|
||||||
|
queryFactory = new JPAQueryFactory(em);
|
||||||
|
}
|
||||||
|
|
||||||
|
@AfterEach
|
||||||
|
void afterEach(){
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("sim_result:심사목록에서 기간 클릭시")
|
||||||
|
void sim_reg() {
|
||||||
|
|
||||||
|
/*
|
||||||
|
"SELECT COUNT(*) CNT FROM TF680_MAIN INNER JOIN TF680_RECALL ON (MM_CODE=RC_MAINCODE)
|
||||||
|
WHERE MM_DBGB = '11' AND MM_LSTATE != '75' AND RC_GB = '1' AND RC_STATE = '0'
|
||||||
|
AND RC_SEQ >= '""& rtxtsNum &""' AND RC_SEQ <= '""& rtxteNum &""' AND RC_IR_TRANSFER = '""& rstTrans &""'"""
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
주정차의견진술상세자료
|
||||||
|
SELECTROWNUM, RC_SEQ, MM_OCARNO, MM_NCARNO, RC_NAME, GET_RECALL_CONTID(RC_CONT_DOC) CONTDOC,
|
||||||
|
RC_DATE, Get_Recall_Ingb_Str(RC_INGB) INGB
|
||||||
|
FROM TF680_MAIN INNER JOIN TF680_RECALL ON (MM_CODE=RC_MAINCODE)
|
||||||
|
WHERE MM_DBGB = '11' AND MM_LSTATE != '75'
|
||||||
|
AND RC_GB = '1' AND RC_STATE = '0' AND RC_SEQ >= '"& rtxtsNum &"' AND RC_SEQ <= '"& rtxteNum &"' "
|
||||||
|
AND RC_IR_TRANSFER = '"& rstTrans &"' ORDER BY RC_SEQ
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
//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(Date.valueOf(now)),
|
||||||
|
minSimsa680.msEdate.eq(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();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @BeforeAll
|
||||||
|
// void beforeAll(){
|
||||||
|
// log.debug("initializing...");
|
||||||
|
// }
|
||||||
|
|
||||||
|
// @AfterAll
|
||||||
|
// void afterAll(){
|
||||||
|
// log.debug("...shutdown");
|
||||||
|
// }
|
||||||
|
}
|
Loading…
Reference in New Issue