Compare commits

..

90 Commits

Author SHA1 Message Date
670788339
61754d3852 放开redis 2024-08-15 16:26:47 +08:00
670788339
a26ee1c707 放开注释 2024-08-15 15:42:45 +08:00
670788339
1f0060c4dc 放开注释 2024-08-15 15:27:41 +08:00
670788339
6b0050286c 放开注释 2024-08-15 15:19:59 +08:00
670788339
2b07029aca 注释 2024-08-15 12:09:40 +08:00
670788339
d2d7fab96c 注释 2024-08-15 12:03:05 +08:00
670788339
be3bae969c study接口加redis过滤 2024-08-15 11:35:02 +08:00
670788339
8e1b7519ef study接口加redis过滤 2024-08-15 11:31:17 +08:00
670788339
bddb11caf8 study接口加redis过滤 2024-08-15 10:53:26 +08:00
nisen
f0fe015561 Merge branch 'zcwy0731-llf' into master-0705 2024-08-06 17:52:08 +08:00
zhaolongfei
91bcec00ef 修复同步到item表没有名称问题 2024-08-06 14:42:05 +08:00
nisen
7a210ec701 Merge branch 'zcwy0731-llf' into master-0705 2024-08-05 19:03:09 +08:00
zhaolongfei
6c616a1163 在线课作业重复提交报错修复 2024-08-05 15:12:54 +08:00
zhaolongfei
939325d5bd 在线课作业重复提交报错修复 2024-08-05 15:05:28 +08:00
zhaolongfei
4eddbc8e8f 在线管理资源完成情况名称搜索修复 2024-08-05 11:21:14 +08:00
zhaolongfei
50bdd59a26 在线管理资源完成情况名称搜索修复 2024-08-05 11:11:12 +08:00
zhaolongfei
b85eb97bc1 在线管理资源完成情况名称搜索修复 2024-08-05 10:57:14 +08:00
zhaolongfei
28b58a73cf 在线管理资源完成情况名称搜索修复 2024-08-05 10:29:36 +08:00
zhaolongfei
b9adf4c45f 作业多次点击提交报错修复 2024-08-02 17:08:00 +08:00
zhaolongfei
49aab74463 作业多次点击提交报错修复 2024-08-02 13:19:08 +08:00
zhaolongfei
9f30910d04 作业多次点击提交报错修复 2024-08-02 11:32:14 +08:00
zhaolongfei
6658b8c04b 作业多次点击提交报错修复 2024-08-02 11:03:13 +08:00
zhaolongfei
19df4224a9 作业多次点击提交报错修复 2024-08-02 10:16:05 +08:00
zhaolongfei
95ddc9f5d5 作业多次点击提交报错修复 2024-08-02 09:36:36 +08:00
nisen
f3b6bb6fee Merge branch 'zcwy0731-llf' into master-0705
# Conflicts:
#	servers/boe-server-all/src/main/java/com/xboe/module/exam/entity/ExamTest.java
2024-08-01 17:43:07 +08:00
zhaolongfei
64965f5ec6 考试管理删除不同步 2024-07-31 19:01:53 +08:00
zhaolongfei
a407ca2dad 考试管理删除不同步 2024-07-31 18:35:49 +08:00
nisen
16f1c2337b Merge branch 'zcwy0716-llf' into master-0705 2024-07-30 15:46:41 +08:00
nisen
0f0edaf2cd Merge branch 'zcwy0729-llf' into master-0705 2024-07-30 11:56:45 +08:00
nisen
68d00e8c51 Merge branch 'zcwy0716-llf' into master-0705 2024-07-29 19:56:17 +08:00
zhaolongfei
41a542ea23 Merge remote-tracking branch 'java-servse-yx/zcwy0606-llf' into zcwy0729-llf
# Conflicts:
#	servers/boe-server-all/src/main/java/com/xboe/module/exam/api/ExamTestApi.java
#	servers/boe-server-all/src/main/java/com/xboe/module/exam/service/impl/ExamTestServiceImpl.java
2024-07-29 19:52:50 +08:00
nisen
83e71dc5d6 Merge branch 'zcwy0716-llf' into yxmaster 2024-07-29 19:47:41 +08:00
zhaolongfei
fc98025a3a 视频暂存为空判断 2024-07-29 19:21:26 +08:00
nisen
f5f53557b6 Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 22:21:06 +08:00
nisen
4b4f30b412 Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 22:16:40 +08:00
nisen
6f19ff7b0f Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 22:11:30 +08:00
nisen
f8566d2321 Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 22:06:19 +08:00
nisen
d6102d1ce1 Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 21:52:10 +08:00
nisen
6521464676 Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 21:38:42 +08:00
nisen
b6378b6565 Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 21:20:05 +08:00
nisen
66d7f2a3cf Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 20:53:21 +08:00
nisen
faea4f8b2a Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 20:37:09 +08:00
nisen
c203956bc6 Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 20:25:00 +08:00
nisen
cf4004f073 Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 19:00:39 +08:00
nisen
6bf5ccbcec Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 18:59:20 +08:00
nisen
63867db58e Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 18:45:50 +08:00
nisen
7ef0f976fc Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 18:38:12 +08:00
nisen
5a05ff74b7 Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 18:18:17 +08:00
nisen
a93580c387 Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 18:04:08 +08:00
nisen
78184d3a11 Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 17:31:26 +08:00
nisen
bcb8b59e8a Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 16:50:18 +08:00
nisen
1025f8f716 Merge branch 'zcwy0716-llf' into master-0705 2024-07-18 17:27:52 +08:00
joshen
4c6f15a707 Merge branch 'zcwy-0613-wjw' into 'master-0705'
新在线课逻辑删除库名

See merge request !115
2024-07-05 19:21:27 +08:00
xiaozhequ
488e6c2872 新在线课逻辑删除库名 2024-07-05 19:20:11 +08:00
joshen
e86afad4ef Merge branch 'zcwy-0613-wjw' into 'master-0705'
新在线课逻辑打印日志

See merge request !114
2024-07-05 19:00:59 +08:00
xiaozhequ
3285c639b9 新在线课逻辑打印日志 2024-07-05 18:59:29 +08:00
joshen
db3695019a Merge branch 'zcwy-0613-wjw' into 'master-0705'
Zcwy 0613 wjw

See merge request !113
2024-07-05 17:52:48 +08:00
xiaozhequ
84dd5cb192 在线课逻辑更改库名 2024-07-05 15:22:55 +08:00
xiaozhequ
407c7693bb 区分新建课 2024-07-04 16:21:48 +08:00
xiaozhequ
564bf42464 hrbp只读权限 2024-07-04 15:06:42 +08:00
xiaozhequ
55717e4dde 删除筛选 2024-07-04 12:33:35 +08:00
xiaozhequ
2698061eae 更改实体类字段 2024-07-04 12:32:44 +08:00
xiaozhequ
eb401d8fdf 新在线课逻辑 2024-07-04 10:55:17 +08:00
xiaozhequ
20374e274a 新在线课逻辑修复bug 2024-07-04 10:31:28 +08:00
xiaozhequ
c7a39a1f22 新在线课修复bug 2024-07-04 09:49:49 +08:00
xiaozhequ
7eb578127d 新在线课逻辑优化2 2024-07-03 16:30:19 +08:00
xiaozhequ
f2be349301 新在线课逻辑优化 2024-07-03 12:46:55 +08:00
xiaozhequ
e0037b8814 课程权限优化 2024-07-03 09:57:59 +08:00
xiaozhequ
0b0bd748d9 新在线课逻辑 2024-07-02 09:42:47 +08:00
xiaozhequ
9fd4171107 新在线课逻辑 2024-07-02 08:56:28 +08:00
xiaozhequ
625c41f466 在线可权限bug 2024-06-24 16:00:23 +08:00
xiaozhequ
f950788e08 课程权限学习路径图保持一致 2024-06-24 14:58:13 +08:00
xiaozhequ
a26ceb86d1 学习路径图保持一致 2024-06-24 14:04:53 +08:00
xiaozhequ
a2317d0b59 在线可权限更改逻辑 2024-06-24 13:47:34 +08:00
xiaozhequ
53c38baf22 修复查询失败bug 2024-06-21 15:46:43 +08:00
zhaolongfei
e2c697f860 修改bug 2024-06-19 16:43:08 +08:00
xiaozhequ
de69ba1c11 在线课权限查询 2024-06-19 15:34:53 +08:00
zhaolongfei
c6a785bb4f 添加视频暂存点 2024-06-19 13:55:54 +08:00
xiaozhequ
2fcdb6b4b6 代码还原 2024-06-18 15:49:10 +08:00
xiaozhequ
62884bcc15 所有后台人过滤在线课 2024-06-18 14:56:28 +08:00
zhaolongfei
8567fa9ecc content表添加processVideo字段,添加判断 2024-06-18 13:47:46 +08:00
zhaolongfei
359b66e48a content表添加processVideo字段,添加判断 2024-06-18 13:31:39 +08:00
zhaolongfei
8125a6bd77 content表添加processVideo字段,添加判断 2024-06-18 11:12:08 +08:00
zhaolongfei
9b37e8a73d content表添加processVideo字段,添加判断 2024-06-18 09:09:52 +08:00
zhaolongfei
2fa3378e94 content表添加processVideo字段 2024-06-17 16:16:29 +08:00
xiaozhequ
dd0af3cbef 选择在线可时增加数据权限逻辑 2024-06-13 18:11:41 +08:00
zhaolongfei
0b7784779f item添加processVideo字段 2024-06-13 15:28:13 +08:00
zhaolongfei
e03118275d 修改项目下考试结束时间并未生效修复 2024-06-06 18:10:28 +08:00
zhaolongfei
1b1cb17861 Merge branch 'zcwy0525-llf' into zcwy0606-llf 2024-06-06 16:35:40 +08:00
zhaolongfei
a35c1faa49 学员在线删除失败的bug修复 2024-06-06 16:32:33 +08:00
17 changed files with 1840 additions and 1485 deletions

View File

@@ -12,13 +12,10 @@ import com.xboe.module.dict.entity.DictDto;
import com.xboe.module.exam.entity.ExamTest;
import com.xboe.school.study.entity.StudyCourse;
import com.xboe.system.user.dao.UserDao;
import com.xboe.system.user.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Optional;

View File

@@ -17,5 +17,7 @@ public class UserOrgIds {
private Map<String,Boolean> permissions=new HashMap<String,Boolean>();
private List<String> ids;
//hrbp只读权限
private List<String> readIds;
}

View File

@@ -229,8 +229,10 @@ public class OutSideDataServiceImpl implements IOutSideDataService {
public UserOrgIds getOrgIds() {
UserOrgIds uids=new UserOrgIds();
List<String> orgIds = new ArrayList<>();
List<String> readIds = new ArrayList<>();
uids.setIds(orgIds);
uids.setReadIds(readIds);
String token = TokenProxy.getToken(request);
String type="application/json";
String[] headers=new String[] {"token",token,"Content-Type",type};
@@ -281,7 +283,8 @@ public class OutSideDataServiceImpl implements IOutSideDataService {
while (elements.hasNext()){
String oid=elements.next().asText();
if(!orgSetIds.contains(oid)) {
orgIds.add(oid);
// orgIds.add(oid);
readIds.add(oid);
}
}
}

View File

@@ -1,11 +1,7 @@
package com.xboe.module.course.api;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@@ -134,7 +130,6 @@ public class CourseManageApi extends ApiBaseController{
}else {
dto.setIsSystemAdmin(false);
}
String ids="";
if(userOrgIds.getIds()!=null && !userOrgIds.getIds().isEmpty())
{
@@ -142,12 +137,14 @@ public class CourseManageApi extends ApiBaseController{
}
//log.info("获取到的用户的组织机构权限ids",ids);
String aid=getCurrent().getAccountId();
// String aid="1706272694871445506";
//如果前端查询当前人的,这里去掉
if(StringUtils.isNotBlank(dto.getAid())) {
dto.setAid(null);
}
dto.setOrgAid(aid);
dto.setOrgIds(ids);
dto.setReadIds(userOrgIds.getReadIds());
PageList<Course> coursePageList = courseService.findPage(pager.getPageIndex(), pager.getPageSize(),dto);
return success(coursePageList);
}catch(Exception e) {

View File

@@ -2,6 +2,8 @@ package com.xboe.module.course.dto;
import lombok.Data;
import java.util.List;
/**
* 课程查询的条件对象
*/
@@ -102,6 +104,9 @@ public class CourseQueryDto {
* */
private String orgIds;
//hrpb只读
private List<String> readIds;
/**用户权限的查询*/
private String orgAid;
@@ -110,6 +115,11 @@ public class CourseQueryDto {
*/
private Boolean isSystemAdmin;
/**
* 是否是新建在线可
*/
private Boolean isCreateCourse;
private Boolean visible;
private String refId;
@@ -129,4 +139,5 @@ public class CourseQueryDto {
* 登录人id
*/
private String userId;
}

View File

@@ -370,6 +370,9 @@ public class Course extends BaseEntity {
@Column(name = "ref_type",length=32,columnDefinition="varchar(32) comment '反向关联的类型'")
private String refType;
@Transient
private Boolean isPermission=true;
@Transient
private String orgName;

View File

@@ -83,8 +83,13 @@ public class CourseContent extends BaseEntity {
* */
@Column(name = "duration")
private Integer duration;
/**
* 视频播放进度
* */
@Column(name = "progress_video")
private Float progressVideo;
/**用于学习时的状态显示,非存储字段*/
@Transient
private Integer status;

View File

@@ -82,4 +82,7 @@ public interface ICourseContentService{
* @return
*/
CourseAssess getAssess(String ccid);
void updateProcessVideo(String contentId, String courseId, Float processVideo);
}

View File

@@ -1,5 +1,7 @@
package com.xboe.module.course.service.impl;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.List;
import javax.annotation.Resource;
@@ -141,6 +143,17 @@ public class CourseContentServiceImpl implements ICourseContentService {
return assess;
}
@Override
@Transactional
public void updateProcessVideo(String id, String courseId, Float progressVideo) {
// 处理 processVideo 为 null 的情况
if (progressVideo == null) {
progressVideo = 0.00f;
}
String sql = "UPDATE boe_course_content SET progress_video = "+ progressVideo+" WHERE id = "+ id+" AND course_id = "+ courseId+" ";
ccDao.sqlUpdate(sql);
}
@Override
@Transactional
public void updateName(String id, String name) {

View File

@@ -28,7 +28,7 @@ public class ExamTest extends BaseEntity {
/**
* 考试名称
* */
@Column(name = "test_name",nullable = false,length = 50)
@Column(name = "test_name",length = 50)
private String testName;
/**
@@ -46,7 +46,7 @@ public class ExamTest extends BaseEntity {
/**
* 考试时长 分钟
* */
@Column(name = "test_duration",nullable = false)
@Column(name = "test_duration")
private Integer testDuration;
/**
* 显示解析
@@ -107,13 +107,13 @@ public class ExamTest extends BaseEntity {
/**
* 考试的类型
* */
@Column(name = "test_type",nullable = false)
@Column(name = "test_type")
private Integer testType;
/**
* 发布状态 ,是否已发布
*/
@Column(name = "published",length = 1,nullable = false)
@Column(name = "published",length = 1)
private Boolean published;
/**
* 发布时间
@@ -154,7 +154,7 @@ public class ExamTest extends BaseEntity {
/**
* 范围1表独立使用2表课程内部
* */
@Column(name = "range_type",nullable = false)
@Column(name = "range_type")
private Integer rangeType;
/**

View File

@@ -95,7 +95,7 @@ public class ExamTestServiceImpl implements IExamTestService {
@Override
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));
if(et==null){
return true;

View File

@@ -321,8 +321,19 @@ public class StudyCourseApi extends ApiBaseController{
if (StringUtils.isEmpty(token)) {
token = request.getHeader("token");
}
//检查是否已存在
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) {
//如果记录存在但是进度不100无成情况就更新进度一期不会有这种情况
if(item.getProgress()<100 && sci.getProgress()>item.getProgress()) {
@@ -407,6 +418,14 @@ public class StudyCourseApi extends ApiBaseController{
StudyCourseItem item = studyService.checkHas(sci.getStudyId(),sci.getContentId());
if(item!=null) {
//如果记录存在但是进度不到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) {
studyService.updateProcess(item.getId(),sci.getStudyId(),sci.getCourseId(), sci.getContentTotal(),100,token);
}
@@ -512,6 +531,14 @@ public class StudyCourseApi extends ApiBaseController{
token = request.getHeader("token");
}
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);
List<StudyCourse> allUserList = thirdApi.getStudyCourseList(studyId ,courseId, token);
log.info("在线课学习记录"+allUserList);
@@ -529,7 +556,7 @@ public class StudyCourseApi extends ApiBaseController{
* @return
*/
@PostMapping("/study-video-time")
public JsonResponse<Boolean> study(String studyId,String itemId,Integer videoTime){
public JsonResponse<Boolean> study(String itemId,Integer videoTime,String contentId , String courseId,Float progressVideo){
if(StringUtils.isBlank(itemId)){
return error("参数错误");
@@ -539,7 +566,10 @@ public class StudyCourseApi extends ApiBaseController{
}
//检查是否已存在
try {
studyService.updateLastTime(itemId,videoTime,getCurrent().getAccountId());
studyService.updateLastTime(itemId,videoTime, getCurrent().getAccountId());
if (contentId != null && courseId != null && progressVideo != null){
contentService.updateProcessVideo(contentId, courseId, progressVideo);
}
return success(true);
}catch(Exception e) {
log.error("记录最后学习时间错误",e);

View File

@@ -44,7 +44,7 @@ public class StudyAssessServiceImpl implements IStudyAssessService{
LocalDateTime ldt=LocalDateTime.now();
sci.setStudyId(assess.getStudyId());
sci.setContentId(assess.getContentId());
//sci.setContentName(homework.getContentName());
sci.setContentName("评估");
sci.setCourseId(assess.getCourseId());
//sci.setCsectionId(homework.getCsectionId());
sci.setProgress(100);//直接设置为学习完成

View File

@@ -82,7 +82,7 @@ public class StudyExamServiceImpl implements IStudyExamService{
LocalDateTime ldt=LocalDateTime.now();
sci.setStudyId(exam.getStudyId());
sci.setContentId(exam.getContentId());
//sci.setContentName(homework.getContentName());
sci.setContentName("考试");
sci.setCourseId(exam.getCourseId());
//sci.setCsectionId(homework.getCsectionId());
sci.setProgress(prog);//直接设置为学习完成

View File

@@ -46,7 +46,7 @@ public class StudyHomeWorkServiceImpl implements IStudyHomeWorkService{
LocalDateTime ldt=LocalDateTime.now();
sci.setStudyId(homework.getStudyId());
sci.setContentId(homework.getContentId());
//sci.setContentName(homework.getContentName());
sci.setContentName(homework.getHwName());
sci.setCourseId(homework.getCourseId());
//sci.setCsectionId(homework.getCsectionId());
sci.setProgress(100);//直接设置为学习完成
@@ -67,7 +67,7 @@ public class StudyHomeWorkServiceImpl implements IStudyHomeWorkService{
//只是保留一条作业记录,不再保存多条记录了
//dao.save(homework);
//设置id。然后进行悠
homework.setId(obj.toString());
homework.setId(homework.getStudyItemId());
dao.update(homework);
}
}

View File

@@ -193,16 +193,16 @@ public class StudyServiceImpl implements IStudyService{
}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 " +
" 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 " +
" 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+";";
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.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 " +
" 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";
log.info("资源完成情况未开始sql"+sql);
List<Object[]> list = scDao.sqlFindList(sql);
@@ -224,46 +224,22 @@ public class StudyServiceImpl implements IStudyService{
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, " +
"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 " +
"(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 + "' 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 limit "+ pageIndex2+","+ pageSize+";";
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 " +
"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 " +
"(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 + "' 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);