Commit 6541d95a authored by zhangqingle's avatar zhangqingle

修改接口、添加新接口

parent 4ed4c66b
......@@ -488,6 +488,21 @@ public class BLessonController extends PaginationController<BLesson> {
setTrainIsSignDTO);
}
/**
* @author: zhangqingle
* @param
* @return
*/
@ApiOperation(value="628 我的培训总数(学习和教学)", notes="我的培训总数")
@GetMapping(value = "/iTrainCount")
public Result iTrainCount(CurUser curUser, BindingResult bindingResult ) {
String userId = curUser.getUserId();
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
bLessonService.iTrainCount(userId));
}
// /**
// * @author: zhangqingle
// * @param
......
......@@ -477,40 +477,97 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
*/
@Select({"<script>",
" select (select COUNT(1) from b_lesson where del_flag != 1 and flag = 1 " +
" and lesson_type = 0 " +
" and lecturer_id = #{userId} and release_state is not null) publishAllCount, " +
"(select COUNT(1) from b_lesson where del_flag != 1 and flag = 1 " +
" and lesson_type = 0 " +
" and lecturer_id = #{userId} and release_state = '0') notPublishCount, " +
"(select COUNT(1) from b_lesson where del_flag != 1 and flag = 1 " +
" and lesson_type = 0 " +
" and lecturer_id = #{userId} and release_state = '2') publishedCount, " +
"(select COUNT(1) from b_lesson where del_flag != 1 and flag = 1 " +
" and lesson_type = 0 " +
" and lecturer_id = #{userId} and release_state = '4') closedCount, "+
"(select COUNT(1) from b_lesson_person blp " +
" LEFT join b_lesson bl on blp.lesson_id = bl.business_id " +
" where blp.del_flag != 1 and blp.flag = 1 " +
" and bl.del_flag != 1 and bl.flag = 1 " +
" and bl.lesson_type = 0 " +
" and blp.person_id = #{userId} and is_finish is not null ) learnAllCount, " +
"(select COUNT(1) from b_lesson_person blp " +
" LEFT join b_lesson bl on blp.lesson_id = bl.business_id " +
" where blp.del_flag != 1 and blp.flag = 1 " +
" and bl.del_flag != 1 and bl.flag = 1 " +
" and bl.lesson_type = 0 " +
" and blp.person_id = #{userId} and is_finish = '2') finishCount, " +
"(select COUNT(1) from b_lesson_person blp " +
" LEFT join b_lesson bl on blp.lesson_id = bl.business_id " +
" where blp.del_flag != 1 and blp.flag = 1 " +
" and bl.del_flag != 1 and bl.flag = 1 " +
" and bl.lesson_type = 0 " +
" and blp.person_id = #{userId} and is_finish = '1') notFinishCount, " +
"(select COUNT(1) from b_lesson_person blp " +
" LEFT join b_lesson bl on blp.lesson_id = bl.business_id " +
" where blp.del_flag != 1 and blp.flag = 1 " +
" and bl.del_flag != 1 and bl.flag = 1 " +
" and bl.lesson_type = 0 " +
" and blp.person_id = #{userId} and is_finish = '0') notStartCount " +
"</script>"})
ILessonCountDTO iLessonCount(String userId);
/**
* 查询我教学和我学习培训数量
* @param userId
* @return
*/
@Select({"<script>",
" select (select COUNT(1) from b_lesson where del_flag != 1 and flag = 1 " +
" and lesson_type = 1 " +
" and lecturer_id = #{userId} and release_state is not null) publishAllCount, " +
"(select COUNT(1) from b_lesson where del_flag != 1 and flag = 1 " +
" and lesson_type = 1 " +
" and lecturer_id = #{userId} and release_state = '0') notPublishCount, " +
"(select COUNT(1) from b_lesson where del_flag != 1 and flag = 1 " +
" and lesson_type = 1 " +
" and lecturer_id = #{userId} and release_state = '2') publishedCount, " +
"(select COUNT(1) from b_lesson where del_flag != 1 and flag = 1 " +
" and lesson_type = 1 " +
" and lecturer_id = #{userId} and release_state = '4') closedCount, "+
"(select COUNT(1) from b_lesson_person blp " +
" LEFT join b_lesson bl on blp.lesson_id = bl.business_id " +
" where blp.del_flag != 1 and blp.flag = 1 " +
" and bl.del_flag != 1 and bl.flag = 1 " +
" and bl.lesson_type = 1 " +
" and blp.person_id = #{userId} and train_is_sign is not null ) learnAllCount, " +
"(select COUNT(1) from b_lesson_person blp " +
" LEFT join b_lesson bl on blp.lesson_id = bl.business_id " +
" where blp.del_flag != 1 and blp.flag = 1 " +
" and bl.del_flag != 1 and bl.flag = 1 " +
" and bl.lesson_type = 1 " +
" and blp.person_id = #{userId} and train_is_sign = '2') finishCount, " +
"(select COUNT(1) from b_lesson_person blp " +
" LEFT join b_lesson bl on blp.lesson_id = bl.business_id " +
" where blp.del_flag != 1 and blp.flag = 1 " +
" and bl.del_flag != 1 and bl.flag = 1 " +
" and bl.lesson_type = 1 " +
" and blp.person_id = #{userId} and train_is_sign = '1') notFinishCount, " +
"(select COUNT(1) from b_lesson_person blp " +
" LEFT join b_lesson bl on blp.lesson_id = bl.business_id " +
" where blp.del_flag != 1 and blp.flag = 1 " +
" and bl.del_flag != 1 and bl.flag = 1 " +
" and bl.lesson_type = 1 " +
" and blp.person_id = #{userId} and train_is_sign = '0') notStartCount " +
"</script>"})
ILessonCountDTO iTrainCount(String userId);
/**
* 重新统计在学人数
* @param lessonId
......
......@@ -6,28 +6,28 @@ import lombok.Data;
@Data
public class ILessonCountDTO {
@ApiModelProperty(value = "我发布全部课程数量")
@ApiModelProperty(value = "我发布全部课程(我教学全部培训)数量")
private String publishAllCount;
@ApiModelProperty(value = "我发布未发布课程数量")
@ApiModelProperty(value = "我发布未发布课程(我教学未发布培训)数量")
private String notPublishCount;
@ApiModelProperty(value = "我发布已发布课程数量")
@ApiModelProperty(value = "我发布已发布课程(我教学已发布培训)数量")
private String publishedCount;
@ApiModelProperty(value = "我发布已关闭课程数量")
@ApiModelProperty(value = "我发布已关闭课程(我教学已关闭培训)数量")
private String closedCount;
@ApiModelProperty(value = "我学习全部课程数量")
@ApiModelProperty(value = "我学习全部课程数量(我报名全部培训数量)")
private String learnAllCount;
@ApiModelProperty(value = "我学完课程数量")
@ApiModelProperty(value = "我学完课程数量(我报名已参加培训数量)")
private String finishCount;
@ApiModelProperty(value = "我未学完课程数量")
@ApiModelProperty(value = "我未学完课程数量(我报名缺勤培训数量)")
private String notFinishCount;
@ApiModelProperty(value = "我未开始课程数量")
@ApiModelProperty(value = "我未开始课程数量(我报名待参加培训数量)")
private String notStartCount;
}
......@@ -162,6 +162,13 @@ public interface BLessonService{
* @return
*/
ILessonCountDTO iLessonCount(String userId);
/**
* 我发布的总数
* @author: zhangqingle
* @param userId
* @return
*/
ILessonCountDTO iTrainCount(String userId);
/**
* 分页查询列表页全部
......
......@@ -570,6 +570,12 @@ public class BLessonServiceImpl implements BLessonService {
return bLessonRepository.iLessonCount(userId);
}
@Override
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
public ILessonCountDTO iTrainCount(String userId) {
return bLessonRepository.iTrainCount(userId);
}
@Override
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
public List<BLesson> queryListAllLessonByPagination(PageUtil pageUtil, FindListLessonDTO model, List<AllCourseDTO> allCourse) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment