Compare commits
No commits in common. "59da1d6e49f32d414dd83bea096c3434e360197f" and "5aef7dac3336f25e72113ab7a7d3cd7ccb303cb5" have entirely different histories.
59da1d6e49
...
5aef7dac33
|
@ -166,7 +166,11 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory)
|
||||||
where = where.and(audioContent.isAdult.isFalse)
|
where = where.and(audioContent.isAdult.isFalse)
|
||||||
}
|
}
|
||||||
|
|
||||||
var select = queryFactory
|
if (categoryId > 0) {
|
||||||
|
where = where.and(categoryContent.category.id.eq(categoryId))
|
||||||
|
}
|
||||||
|
|
||||||
|
return queryFactory
|
||||||
.select(
|
.select(
|
||||||
QGetAudioContentListItem(
|
QGetAudioContentListItem(
|
||||||
audioContent.id,
|
audioContent.id,
|
||||||
|
@ -183,33 +187,13 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.from(audioContent)
|
.from(audioContent)
|
||||||
.leftJoin(pinContent)
|
|
||||||
.on(audioContent.id.eq(pinContent.content.id).and(pinContent.isActive.ne(false)))
|
|
||||||
|
|
||||||
select = if (categoryId > 0) {
|
|
||||||
select
|
|
||||||
.leftJoin(categoryContent)
|
.leftJoin(categoryContent)
|
||||||
.on(audioContent.id.eq(categoryContent.content.id).and(categoryContent.isActive.ne(false)))
|
.on(audioContent.id.eq(categoryContent.content.id).and(categoryContent.isActive.ne(false)))
|
||||||
.where(where.and(categoryContent.category.id.eq(categoryId)))
|
.leftJoin(pinContent)
|
||||||
} else {
|
.on(audioContent.id.eq(pinContent.content.id).and(pinContent.isActive.ne(false)))
|
||||||
select.where(where)
|
.where(where)
|
||||||
}
|
|
||||||
|
|
||||||
select = select
|
|
||||||
.offset(offset)
|
.offset(offset)
|
||||||
.limit(limit)
|
.limit(limit)
|
||||||
|
|
||||||
select = if (categoryId > 0) {
|
|
||||||
select
|
|
||||||
.orderBy(
|
|
||||||
pinContent.isActive.desc(),
|
|
||||||
pinContent.updatedAt.desc(),
|
|
||||||
orderBy,
|
|
||||||
categoryContent.updatedAt.desc(),
|
|
||||||
audioContent.id.desc()
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
select
|
|
||||||
.orderBy(
|
.orderBy(
|
||||||
pinContent.isActive.desc(),
|
pinContent.isActive.desc(),
|
||||||
pinContent.updatedAt.desc(),
|
pinContent.updatedAt.desc(),
|
||||||
|
@ -217,9 +201,7 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory)
|
||||||
audioContent.updatedAt.desc(),
|
audioContent.updatedAt.desc(),
|
||||||
audioContent.id.desc()
|
audioContent.id.desc()
|
||||||
)
|
)
|
||||||
}
|
.fetch()
|
||||||
|
|
||||||
return select.fetch()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun findTotalCountByCreatorId(
|
override fun findTotalCountByCreatorId(
|
||||||
|
@ -237,20 +219,18 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory)
|
||||||
where = where.and(audioContent.isAdult.isFalse)
|
where = where.and(audioContent.isAdult.isFalse)
|
||||||
}
|
}
|
||||||
|
|
||||||
var select = queryFactory
|
if (categoryId > 0) {
|
||||||
.select(audioContent.id)
|
where = where.and(categoryContent.category.id.eq(categoryId))
|
||||||
.from(audioContent)
|
|
||||||
|
|
||||||
select = if (categoryId > 0) {
|
|
||||||
select
|
|
||||||
.leftJoin(categoryContent)
|
|
||||||
.on(audioContent.id.eq(categoryContent.content.id).and(categoryContent.isActive.ne(false)))
|
|
||||||
.where(where.and(categoryContent.category.id.eq(categoryId)))
|
|
||||||
} else {
|
|
||||||
select.where(where)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return select.fetch().size
|
return queryFactory
|
||||||
|
.select(audioContent.id)
|
||||||
|
.from(audioContent)
|
||||||
|
.leftJoin(categoryContent)
|
||||||
|
.on(audioContent.id.eq(categoryContent.content.id).and(categoryContent.isActive.ne(false)))
|
||||||
|
.where(where)
|
||||||
|
.fetch()
|
||||||
|
.size
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getCreatorOtherContentList(
|
override fun getCreatorOtherContentList(
|
||||||
|
|
Loading…
Reference in New Issue