diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java index 0850b12b..8f0136b9 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java @@ -197,14 +197,14 @@ public class StudyServiceImpl implements IStudyService{ " left join boe_study_course_item item on bsc.course_id = item.course_id and bsc.id = item.study_id" + " where bsc.course_id = '"+courseId+"' and bsc.aname like '%"+name+"%' and bsc.id not in(" + " select item.study_id from boe_study_course_item item " + - " where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' and status = 1 and item.aname like '%"+name+"%' group by item.study_id" + + " where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' and item.status = '1' and item.aname like '%"+name+"%' group by item.study_id" + " ) group by bsc.id limit "+ pageIndex2+","+ pageSize+";"; String sql2 = "select count(*) as total from (select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.content_id,0 as progress,1 as status from boe_study_course bsc " + " left join boe_study_course_item item on bsc.course_id = item.course_id and bsc.id = item.study_id" + " where bsc.course_id = '"+courseId+"' and bsc.aname like '%"+name+"%' and bsc.id not in(" + " select item.study_id from boe_study_course_item item " + - " where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' and item.aname like '%"+name+"%' group by item.study_id" + + " where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' and item.status = '1' and item.aname like '%"+name+"%' group by item.study_id" + " ) group by bsc.id) as total"; log.info("资源完成情况未开始sql"+sql); List list = scDao.sqlFindList(sql); @@ -241,7 +241,7 @@ public class StudyServiceImpl implements IStudyService{ "left join " + "(select bsc.id, bsc.course_id, bsc.course_name, bsc.aname, item.finish_time, 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.course_id = '" + courseId + "' and item.content_id = '" + contentId + "' and item.aname like '%"+name+"%' group by bsc.id) b " + + "where bsc.course_id = '" + courseId + "' and item.content_id = '" + contentId + "' and item.aname like '%"+name+"%' group by bsc.id) b " + "on a.course_id = b.course_id and a.id = b.id " + "group by a.id) as total"; log.info("资源完成情况全部sql"+sql);