공통코드 id값 조회 쿼리 수정
This commit is contained in:
@@ -20,17 +20,8 @@ public class CommonCodeRepositoryImpl implements CommonCodeRepositoryCustom {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<CommonCodeEntity> findByCodeId(Long id) {
|
public Optional<CommonCodeEntity> findByCodeId(Long id) {
|
||||||
QCommonCodeEntity child = new QCommonCodeEntity("child");
|
|
||||||
return Optional.ofNullable(
|
return Optional.ofNullable(
|
||||||
queryFactory
|
queryFactory.selectFrom(commonCodeEntity).where(commonCodeEntity.id.eq(id)).fetchOne());
|
||||||
.selectFrom(commonCodeEntity)
|
|
||||||
.leftJoin(commonCodeEntity.children, child)
|
|
||||||
.on(child.deleted.isFalse().or(child.deleted.isNull()))
|
|
||||||
.where(
|
|
||||||
commonCodeEntity.id.eq(id),
|
|
||||||
commonCodeEntity.deleted.isFalse().or(commonCodeEntity.deleted.isNull()))
|
|
||||||
.orderBy(commonCodeEntity.order.asc(), child.order.asc())
|
|
||||||
.fetchOne());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user