mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-08 18:36:51 +08:00
Compare commits
56 Commits
zcwy0729-l
...
code-revie
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6dadd80372 | ||
|
|
04a4f528bf | ||
|
|
f7cd9f8469 | ||
|
|
1021f0bd43 | ||
|
|
0d0b45f017 | ||
|
|
2ae3d99f21 | ||
|
|
89573debef | ||
|
|
457597eabc | ||
|
|
24ae3c0ec6 | ||
|
|
fffa12344a | ||
|
|
52a58a6c6f | ||
|
|
a4b034752d | ||
|
|
23e63062e9 | ||
|
|
06415d58ac | ||
|
|
3fc8ce614d | ||
|
|
bebe36d39e | ||
|
|
d4af5ba8d5 | ||
|
|
d42d1b2e83 | ||
|
|
cf64f0406f | ||
|
|
df3b0b95c1 | ||
|
|
f5ff666c07 | ||
|
|
731e62c89f | ||
|
|
7fe53c026e | ||
|
|
6492e3b0dd | ||
|
|
30aab6eab4 | ||
|
|
61754d3852 | ||
|
|
a26ee1c707 | ||
|
|
1f0060c4dc | ||
|
|
6b0050286c | ||
|
|
2b07029aca | ||
|
|
d2d7fab96c | ||
|
|
be3bae969c | ||
|
|
8e1b7519ef | ||
|
|
bddb11caf8 | ||
|
|
f0fe015561 | ||
|
|
91bcec00ef | ||
|
|
7a210ec701 | ||
|
|
6c616a1163 | ||
|
|
939325d5bd | ||
|
|
4eddbc8e8f | ||
|
|
50bdd59a26 | ||
|
|
b85eb97bc1 | ||
|
|
28b58a73cf | ||
|
|
b9adf4c45f | ||
|
|
49aab74463 | ||
|
|
9f30910d04 | ||
|
|
6658b8c04b | ||
|
|
19df4224a9 | ||
|
|
95ddc9f5d5 | ||
|
|
f3b6bb6fee | ||
|
|
64965f5ec6 | ||
|
|
a407ca2dad | ||
|
|
16f1c2337b | ||
|
|
bf476a23a0 | ||
|
|
0f0edaf2cd | ||
|
|
68d00e8c51 |
@@ -58,7 +58,7 @@
|
|||||||
<artifactId>xboe-module-scorm</artifactId>
|
<artifactId>xboe-module-scorm</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xboe</groupId>
|
<groupId>com.xboe</groupId>
|
||||||
<artifactId>xboe-core</artifactId>
|
<artifactId>xboe-core</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
@@ -233,6 +233,31 @@
|
|||||||
<artifactId>spring-retry</artifactId>
|
<artifactId>spring-retry</artifactId>
|
||||||
<version>1.3.1</version>
|
<version>1.3.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-webmvc</artifactId>
|
||||||
|
<version>5.3.26</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.yaml</groupId>
|
||||||
|
<artifactId>snakeyaml</artifactId>
|
||||||
|
<version>2.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-text</artifactId>
|
||||||
|
<version>1.10.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.tomcat.embed</groupId>
|
||||||
|
<artifactId>tomcat-embed-core</artifactId>
|
||||||
|
<version>9.0.83</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
<resources>
|
<resources>
|
||||||
|
|||||||
@@ -12,13 +12,10 @@ import com.xboe.module.dict.entity.DictDto;
|
|||||||
import com.xboe.module.exam.entity.ExamTest;
|
import com.xboe.module.exam.entity.ExamTest;
|
||||||
import com.xboe.school.study.entity.StudyCourse;
|
import com.xboe.school.study.entity.StudyCourse;
|
||||||
import com.xboe.system.user.dao.UserDao;
|
import com.xboe.system.user.dao.UserDao;
|
||||||
import com.xboe.system.user.entity.User;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.data.domain.Page;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|||||||
@@ -178,6 +178,4 @@ public class ExamTest extends BaseEntity {
|
|||||||
|
|
||||||
@Transient
|
@Transient
|
||||||
private String paperName;
|
private String paperName;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ public class ExamTestServiceImpl implements IExamTestService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean has(String paperId) {
|
public Boolean has(String paperId) {
|
||||||
ExamTest et=examTestDao.findOne(FieldFilters.eq("paperId", paperId));
|
ExamTest et=examTestDao.findOne(FieldFilters.eq("paperId", paperId),FieldFilters.eq("deleted", false));
|
||||||
//String etId= (String)examTestDao.findField("id", FieldFilters.eq("paperId", paperId));
|
//String etId= (String)examTestDao.findField("id", FieldFilters.eq("paperId", paperId));
|
||||||
if(et==null){
|
if(et==null){
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import com.xboe.api.vo.*;
|
|||||||
import com.xboe.module.course.vo.TeacherVo;
|
import com.xboe.module.course.vo.TeacherVo;
|
||||||
import com.xboe.module.usergroup.entity.UserGroupItem;
|
import com.xboe.module.usergroup.entity.UserGroupItem;
|
||||||
import com.xboe.module.usergroup.service.IUserGroupService;
|
import com.xboe.module.usergroup.service.IUserGroupService;
|
||||||
|
import com.xboe.school.study.dao.StudyCourseDao;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -65,7 +66,9 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(value="/xboe/school/study/course")
|
@RequestMapping(value="/xboe/school/study/course")
|
||||||
public class StudyCourseApi extends ApiBaseController{
|
public class StudyCourseApi extends ApiBaseController{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
IStudyCourseService service;
|
IStudyCourseService service;
|
||||||
|
|
||||||
@@ -321,8 +324,19 @@ public class StudyCourseApi extends ApiBaseController{
|
|||||||
if (StringUtils.isEmpty(token)) {
|
if (StringUtils.isEmpty(token)) {
|
||||||
token = request.getHeader("token");
|
token = request.getHeader("token");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//检查是否已存在
|
//检查是否已存在
|
||||||
StudyCourseItem item = studyService.checkHas(sci.getStudyId(),sci.getContentId());
|
StudyCourseItem item = studyService.checkHas(sci.getStudyId(),sci.getContentId());
|
||||||
|
|
||||||
|
// 20240815 特训营结营考试 临时代码
|
||||||
|
// if(item != null && redisTemplate.opsForValue().get(item.getId())==null){
|
||||||
|
// redisTemplate.opsForValue().set(item.getId(),item.getId());
|
||||||
|
// //设置过期时间为1天
|
||||||
|
// redisTemplate.expire(item.getId(), 60, TimeUnit.SECONDS);
|
||||||
|
// }else{
|
||||||
|
// return success("");
|
||||||
|
// }
|
||||||
if(item!=null) {
|
if(item!=null) {
|
||||||
//如果记录存在,但是进度不100无成情况,就更新进度,一期不会有这种情况
|
//如果记录存在,但是进度不100无成情况,就更新进度,一期不会有这种情况
|
||||||
if(item.getProgress()<100 && sci.getProgress()>item.getProgress()) {
|
if(item.getProgress()<100 && sci.getProgress()>item.getProgress()) {
|
||||||
@@ -407,6 +421,14 @@ public class StudyCourseApi extends ApiBaseController{
|
|||||||
StudyCourseItem item = studyService.checkHas(sci.getStudyId(),sci.getContentId());
|
StudyCourseItem item = studyService.checkHas(sci.getStudyId(),sci.getContentId());
|
||||||
if(item!=null) {
|
if(item!=null) {
|
||||||
//如果记录存在,但是进度不到100,未完成情况,就更新进度,一期不会有这种情况
|
//如果记录存在,但是进度不到100,未完成情况,就更新进度,一期不会有这种情况
|
||||||
|
// 20240815 特训营结营考试 临时代码
|
||||||
|
// if(item != null && redisTemplate.opsForValue().get(item.getId())==null){
|
||||||
|
// redisTemplate.opsForValue().set(item.getId(),item.getId());
|
||||||
|
// //设置过期时间为1天
|
||||||
|
// redisTemplate.expire(item.getId(), 60, TimeUnit.SECONDS);
|
||||||
|
// }else{
|
||||||
|
// return success("");
|
||||||
|
// }
|
||||||
if(item.getProgress()<100) {
|
if(item.getProgress()<100) {
|
||||||
studyService.updateProcess(item.getId(),sci.getStudyId(),sci.getCourseId(), sci.getContentTotal(),100,token);
|
studyService.updateProcess(item.getId(),sci.getStudyId(),sci.getCourseId(), sci.getContentTotal(),100,token);
|
||||||
}
|
}
|
||||||
@@ -512,6 +534,14 @@ public class StudyCourseApi extends ApiBaseController{
|
|||||||
token = request.getHeader("token");
|
token = request.getHeader("token");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
// 20240815 特训营结营考试 临时代码
|
||||||
|
// if(itemId != null && redisTemplate.opsForValue().get(itemId)==null){
|
||||||
|
// redisTemplate.opsForValue().set(itemId,itemId);
|
||||||
|
// //设置过期时间为1天
|
||||||
|
// redisTemplate.expire(itemId, 60, TimeUnit.SECONDS);
|
||||||
|
// }else{
|
||||||
|
// return success(true);
|
||||||
|
// }
|
||||||
studyService.finishVideoStudyItem(itemId, studyId,courseId,cnum,token);
|
studyService.finishVideoStudyItem(itemId, studyId,courseId,cnum,token);
|
||||||
List<StudyCourse> allUserList = thirdApi.getStudyCourseList(studyId ,courseId, token);
|
List<StudyCourse> allUserList = thirdApi.getStudyCourseList(studyId ,courseId, token);
|
||||||
log.info("在线课学习记录"+allUserList);
|
log.info("在线课学习记录"+allUserList);
|
||||||
@@ -693,9 +723,10 @@ public class StudyCourseApi extends ApiBaseController{
|
|||||||
return error("查询失败",e.getMessage());
|
return error("查询失败",e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping(value="/study-course-content",method = {RequestMethod.GET,RequestMethod.POST})
|
@RequestMapping(value="/study-course-content",method = {RequestMethod.GET,RequestMethod.POST})
|
||||||
public JsonResponse<StudyCourseItem> findStudyCourseItem(String studyId,String contentId){
|
public JsonResponse<StudyCourseItem> findStudyCourseItem(String studyId,String contentId, HttpServletRequest request){
|
||||||
if(StringUtils.isBlank(studyId)){
|
if(StringUtils.isBlank(studyId)){
|
||||||
return error("无学习信息");
|
return error("无学习信息");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import java.util.Map;
|
|||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import com.xboe.api.ThirdApi;
|
import com.xboe.api.ThirdApi;
|
||||||
|
import com.xboe.school.study.dao.StudyCourseDao;
|
||||||
import com.xboe.school.study.entity.StudyCourse;
|
import com.xboe.school.study.entity.StudyCourse;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -32,6 +33,8 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(value="/xboe/school/study/exam")
|
@RequestMapping(value="/xboe/school/study/exam")
|
||||||
public class StudyExamApi extends ApiBaseController{
|
public class StudyExamApi extends ApiBaseController{
|
||||||
|
@Autowired
|
||||||
|
StudyCourseDao scDao;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
IStudyExamService sexamService;
|
IStudyExamService sexamService;
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class StudyAssessServiceImpl implements IStudyAssessService{
|
|||||||
LocalDateTime ldt=LocalDateTime.now();
|
LocalDateTime ldt=LocalDateTime.now();
|
||||||
sci.setStudyId(assess.getStudyId());
|
sci.setStudyId(assess.getStudyId());
|
||||||
sci.setContentId(assess.getContentId());
|
sci.setContentId(assess.getContentId());
|
||||||
//sci.setContentName(homework.getContentName());
|
sci.setContentName("评估");
|
||||||
sci.setCourseId(assess.getCourseId());
|
sci.setCourseId(assess.getCourseId());
|
||||||
//sci.setCsectionId(homework.getCsectionId());
|
//sci.setCsectionId(homework.getCsectionId());
|
||||||
sci.setProgress(100);//直接设置为学习完成
|
sci.setProgress(100);//直接设置为学习完成
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public class StudyExamServiceImpl implements IStudyExamService{
|
|||||||
LocalDateTime ldt=LocalDateTime.now();
|
LocalDateTime ldt=LocalDateTime.now();
|
||||||
sci.setStudyId(exam.getStudyId());
|
sci.setStudyId(exam.getStudyId());
|
||||||
sci.setContentId(exam.getContentId());
|
sci.setContentId(exam.getContentId());
|
||||||
//sci.setContentName(homework.getContentName());
|
sci.setContentName("考试");
|
||||||
sci.setCourseId(exam.getCourseId());
|
sci.setCourseId(exam.getCourseId());
|
||||||
//sci.setCsectionId(homework.getCsectionId());
|
//sci.setCsectionId(homework.getCsectionId());
|
||||||
sci.setProgress(prog);//直接设置为学习完成
|
sci.setProgress(prog);//直接设置为学习完成
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public class StudyHomeWorkServiceImpl implements IStudyHomeWorkService{
|
|||||||
LocalDateTime ldt=LocalDateTime.now();
|
LocalDateTime ldt=LocalDateTime.now();
|
||||||
sci.setStudyId(homework.getStudyId());
|
sci.setStudyId(homework.getStudyId());
|
||||||
sci.setContentId(homework.getContentId());
|
sci.setContentId(homework.getContentId());
|
||||||
//sci.setContentName(homework.getContentName());
|
sci.setContentName(homework.getHwName());
|
||||||
sci.setCourseId(homework.getCourseId());
|
sci.setCourseId(homework.getCourseId());
|
||||||
//sci.setCsectionId(homework.getCsectionId());
|
//sci.setCsectionId(homework.getCsectionId());
|
||||||
sci.setProgress(100);//直接设置为学习完成
|
sci.setProgress(100);//直接设置为学习完成
|
||||||
@@ -67,7 +67,7 @@ public class StudyHomeWorkServiceImpl implements IStudyHomeWorkService{
|
|||||||
//只是保留一条作业记录,不再保存多条记录了
|
//只是保留一条作业记录,不再保存多条记录了
|
||||||
//dao.save(homework);
|
//dao.save(homework);
|
||||||
//设置id。然后进行悠
|
//设置id。然后进行悠
|
||||||
homework.setId(obj.toString());
|
homework.setId(homework.getStudyItemId());
|
||||||
dao.update(homework);
|
dao.update(homework);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,8 +98,12 @@ public class StudyServiceImpl implements IStudyService{
|
|||||||
//sci.setProgress(100);//直接设置为学习完成
|
//sci.setProgress(100);//直接设置为学习完成
|
||||||
sci.setLastTime(ldt);
|
sci.setLastTime(ldt);
|
||||||
scItemDao.saveOrUpdate(sci);
|
scItemDao.saveOrUpdate(sci);
|
||||||
|
if (sci.getId() != null){
|
||||||
dto.setStudyItemId(sci.getId());
|
dto.setStudyItemId(sci.getId());
|
||||||
|
}else {
|
||||||
|
log.info("学习记录插入失败"+sci.getId());
|
||||||
|
throw new IllegalArgumentException("学习记录插入失败");
|
||||||
|
}
|
||||||
//检查是否全部学习完成
|
//检查是否全部学习完成
|
||||||
scDao.finishCheck(dto.getStudyId(),dto.getCourseId(),dto.getContentTotal(),token);
|
scDao.finishCheck(dto.getStudyId(),dto.getCourseId(),dto.getContentTotal(),token);
|
||||||
|
|
||||||
@@ -182,7 +186,7 @@ public class StudyServiceImpl implements IStudyService{
|
|||||||
if(StringUtils.isNotBlank(name)) {
|
if(StringUtils.isNotBlank(name)) {
|
||||||
query.addFilter(FieldFilters.eq("aname", name));
|
query.addFilter(FieldFilters.eq("aname", name));
|
||||||
}
|
}
|
||||||
int pageIndex2 = pageIndex-1;
|
int pageIndex2 = (pageIndex-1)*10;
|
||||||
if(status!=null) {
|
if(status!=null) {
|
||||||
if(status==3) {
|
if(status==3) {
|
||||||
query.addFilter(FieldFilters.eq("status", 2));
|
query.addFilter(FieldFilters.eq("status", 2));
|
||||||
@@ -193,16 +197,16 @@ public class StudyServiceImpl implements IStudyService{
|
|||||||
}else if (status == 1) {
|
}else if (status == 1) {
|
||||||
String sql = "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 " +
|
String sql = "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" +
|
" 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.id not in(" +
|
" 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 " +
|
" select item.study_id from boe_study_course_item item " +
|
||||||
" where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by item.study_id" +
|
" where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' and item.aname like '%"+name+"%' group by item.study_id" +
|
||||||
" ) group by bsc.id limit "+ pageIndex2+","+ pageSize+";";
|
" ) 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 " +
|
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" +
|
" 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.id not in(" +
|
" 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 " +
|
" select item.study_id from boe_study_course_item item " +
|
||||||
" where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' group by item.study_id" +
|
" where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' and item.aname like '%"+name+"%' group by item.study_id" +
|
||||||
" ) group by bsc.id) as total";
|
" ) group by bsc.id) as total";
|
||||||
log.info("资源完成情况未开始sql"+sql);
|
log.info("资源完成情况未开始sql"+sql);
|
||||||
List<Object[]> list = scDao.sqlFindList(sql);
|
List<Object[]> list = scDao.sqlFindList(sql);
|
||||||
@@ -224,46 +228,22 @@ public class StudyServiceImpl implements IStudyService{
|
|||||||
return pageList;
|
return pageList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// String sql = "select * from (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+"' group by bsc.id " +
|
|
||||||
// " 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 not in (" +
|
|
||||||
// " 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+"' group by bsc.id" +
|
|
||||||
// " )group by bsc.id) a group by a.id limit "+ pageIndex+","+ pageSize+";";
|
|
||||||
|
|
||||||
// String sql2 = "select count(*) from (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+"' group by bsc.id " +
|
|
||||||
// " 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 not in (" +
|
|
||||||
// " 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+"' group by bsc.id" +
|
|
||||||
// " )group by bsc.id) a group by a.id";
|
|
||||||
|
|
||||||
String sql = "select a.id, a.course_id, a.course_name, a.aname, " +
|
String sql = "select a.id, a.course_id, a.course_name, a.aname, " +
|
||||||
"IFNULL(b.finish_time, '0') as finish_time, IFNULL(b.progress, 0) as progress, IFNULL(b.status, 1) as status " +
|
"IFNULL(b.finish_time, '0') as finish_time, IFNULL(b.progress, 0) as progress, IFNULL(b.status, 1) as status " +
|
||||||
"from (select id, course_id, course_name, aname, 0, 1 from boe_study_course where course_id = '" + courseId + "') a " +
|
"from (select id, course_id, course_name, aname, 0, 1 from boe_study_course where course_id = '" + courseId + "' and aname like '%"+name+"%') a " +
|
||||||
"left join " +
|
"left join " +
|
||||||
"(select bsc.id, bsc.course_id, bsc.course_name, bsc.aname, item.finish_time, item.progress, item.status " +
|
"(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 " +
|
"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 + "' 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 " +
|
"on a.course_id = b.course_id and a.id = b.id " +
|
||||||
"group by a.id limit "+ pageIndex2+","+ pageSize+";";
|
"group by a.id limit "+ pageIndex2+","+ pageSize+";";
|
||||||
String sql2 = "select count(*) as total from (select a.id, a.course_id, a.course_name, a.aname, " +
|
String sql2 = "select count(*) as total from (select a.id, a.course_id, a.course_name, a.aname, " +
|
||||||
"IFNULL(b.finish_time, 0) as finish_time, IFNULL(b.progress, 0) as progress, IFNULL(b.status, 1) as status " +
|
"IFNULL(b.finish_time, 0) as finish_time, IFNULL(b.progress, 0) as progress, IFNULL(b.status, 1) as status " +
|
||||||
"from (select id, course_id, course_name, aname, 0, 1 from boe_study_course where course_id = '" + courseId + "') a " +
|
"from (select id, course_id, course_name, aname, 0, 1 from boe_study_course where course_id = '" + courseId + "' and aname like '%"+name+"%') a " +
|
||||||
"left join " +
|
"left join " +
|
||||||
"(select bsc.id, bsc.course_id, bsc.course_name, bsc.aname, item.finish_time, item.progress, item.status " +
|
"(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 " +
|
"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 + "' 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 " +
|
"on a.course_id = b.course_id and a.id = b.id " +
|
||||||
"group by a.id) as total";
|
"group by a.id) as total";
|
||||||
log.info("资源完成情况全部sql"+sql);
|
log.info("资源完成情况全部sql"+sql);
|
||||||
|
|||||||
Reference in New Issue
Block a user