在线管理资源完成情况修改

This commit is contained in:
zhaolongfei
2024-07-24 10:50:08 +08:00
parent 4f6fbff5e1
commit 2f150449fe

View File

@@ -209,8 +209,30 @@ public class StudyServiceImpl implements IStudyService{
return pageList;
}
}
return scItemDao.findPage(query.builder());
String sql2 = "select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.progress,item.status from boe_study_course bsc left join " +
"boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " +
"where bsc.`status` in (2,9) and bsc.course_id = '"+ courseId+"' " +
"UNION ALL " +
" select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,0 as progress,1 as status from boe_study_course bsc " +
" LEFT JOIN boe_study_course_item item on item.course_id = bsc.course_id " +
" where bsc.course_id = '"+courseId+"' and bsc.id != (" +
" select bsc.id from boe_study_course bsc " +
" left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " +
" where bsc.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"'" +
" )";
List<Object[]> list = scDao.sqlFindList(sql2);
List<StudyCourseItem> item = new ArrayList<>();
for (Object[] objs : list) {
StudyCourseItem sc = new StudyCourseItem();
sc.setCourseId(objs[1].toString());
sc.setContentId(objs[4].toString());
sc.setProgress((Integer) objs[5]);
sc.setStatus((Integer) objs[6]);
sc.setAname(objs[3].toString());
item.add(sc);
}
PageList<StudyCourseItem> pageList = new PageList<>(item);
return pageList;
}