优化章节列表
This commit is contained in:
@@ -30,6 +30,7 @@ public class CourseCatalogueChapterServiceImpl extends ServiceImpl<CourseCatalog
|
|||||||
public List<CourseCatalogueChapterEntity> getCourseCatalogueChapterList(int id) {
|
public List<CourseCatalogueChapterEntity> getCourseCatalogueChapterList(int id) {
|
||||||
MPJLambdaWrapper<CourseCatalogueChapterEntity> wrapper = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<CourseCatalogueChapterEntity> wrapper = new MPJLambdaWrapper<>();
|
||||||
wrapper.selectAll(CourseCatalogueChapterEntity.class);
|
wrapper.selectAll(CourseCatalogueChapterEntity.class);
|
||||||
|
wrapper.select("if(MAX(t2.id)>0,1,0) AS isLearned ");
|
||||||
wrapper.selectMax(UserCourseVideoPositionEntity::getId,CourseCatalogueChapterEntity::getIsLearned);
|
wrapper.selectMax(UserCourseVideoPositionEntity::getId,CourseCatalogueChapterEntity::getIsLearned);
|
||||||
wrapper.disableSubLogicDel().leftJoin(CourseCatalogueChapterVideoEntity.class,CourseCatalogueChapterVideoEntity::getChapterId,CourseCatalogueChapterEntity::getId);
|
wrapper.disableSubLogicDel().leftJoin(CourseCatalogueChapterVideoEntity.class,CourseCatalogueChapterVideoEntity::getChapterId,CourseCatalogueChapterEntity::getId);
|
||||||
wrapper.disableSubLogicDel().leftJoin(UserCourseVideoPositionEntity.class,on->on.eq(UserCourseVideoPositionEntity::getVideoId,CourseCatalogueChapterVideoEntity::getId).eq(UserCourseVideoPositionEntity::getUserId,ShiroUtils.getUId()));
|
wrapper.disableSubLogicDel().leftJoin(UserCourseVideoPositionEntity.class,on->on.eq(UserCourseVideoPositionEntity::getVideoId,CourseCatalogueChapterVideoEntity::getId).eq(UserCourseVideoPositionEntity::getUserId,ShiroUtils.getUId()));
|
||||||
|
|||||||
Reference in New Issue
Block a user