Commit 6541d95a authored by zhangqingle's avatar zhangqingle

修改接口、添加新接口

parent 4ed4c66b
...@@ -488,6 +488,21 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -488,6 +488,21 @@ public class BLessonController extends PaginationController<BLesson> {
setTrainIsSignDTO); 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 // * @author: zhangqingle
// * @param // * @param
......
...@@ -477,40 +477,97 @@ public interface BLessonRepository extends BaseMapper<BLesson> { ...@@ -477,40 +477,97 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
*/ */
@Select({"<script>", @Select({"<script>",
" select (select COUNT(1) from b_lesson where del_flag != 1 and flag = 1 " + " 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, " + " and lecturer_id = #{userId} and release_state is not null) publishAllCount, " +
"(select COUNT(1) from b_lesson where del_flag != 1 and flag = 1 " + "(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, " + " and lecturer_id = #{userId} and release_state = '0') notPublishCount, " +
"(select COUNT(1) from b_lesson where del_flag != 1 and flag = 1 " + "(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, " + " and lecturer_id = #{userId} and release_state = '2') publishedCount, " +
"(select COUNT(1) from b_lesson where del_flag != 1 and flag = 1 " + "(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, "+ " and lecturer_id = #{userId} and release_state = '4') closedCount, "+
"(select COUNT(1) from b_lesson_person blp " + "(select COUNT(1) from b_lesson_person blp " +
" LEFT join b_lesson bl on blp.lesson_id = bl.business_id " + " LEFT join b_lesson bl on blp.lesson_id = bl.business_id " +
" where blp.del_flag != 1 and blp.flag = 1 " + " where blp.del_flag != 1 and blp.flag = 1 " +
" and bl.del_flag != 1 and bl.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, " + " and blp.person_id = #{userId} and is_finish is not null ) learnAllCount, " +
"(select COUNT(1) from b_lesson_person blp " + "(select COUNT(1) from b_lesson_person blp " +
" LEFT join b_lesson bl on blp.lesson_id = bl.business_id " + " LEFT join b_lesson bl on blp.lesson_id = bl.business_id " +
" where blp.del_flag != 1 and blp.flag = 1 " + " where blp.del_flag != 1 and blp.flag = 1 " +
" and bl.del_flag != 1 and bl.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, " + " and blp.person_id = #{userId} and is_finish = '2') finishCount, " +
"(select COUNT(1) from b_lesson_person blp " + "(select COUNT(1) from b_lesson_person blp " +
" LEFT join b_lesson bl on blp.lesson_id = bl.business_id " + " LEFT join b_lesson bl on blp.lesson_id = bl.business_id " +
" where blp.del_flag != 1 and blp.flag = 1 " + " where blp.del_flag != 1 and blp.flag = 1 " +
" and bl.del_flag != 1 and bl.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, " + " and blp.person_id = #{userId} and is_finish = '1') notFinishCount, " +
"(select COUNT(1) from b_lesson_person blp " + "(select COUNT(1) from b_lesson_person blp " +
" LEFT join b_lesson bl on blp.lesson_id = bl.business_id " + " LEFT join b_lesson bl on blp.lesson_id = bl.business_id " +
" where blp.del_flag != 1 and blp.flag = 1 " + " where blp.del_flag != 1 and blp.flag = 1 " +
" and bl.del_flag != 1 and bl.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 " + " and blp.person_id = #{userId} and is_finish = '0') notStartCount " +
"</script>"}) "</script>"})
ILessonCountDTO iLessonCount(String userId); 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 * @param lessonId
......
...@@ -6,28 +6,28 @@ import lombok.Data; ...@@ -6,28 +6,28 @@ import lombok.Data;
@Data @Data
public class ILessonCountDTO { public class ILessonCountDTO {
@ApiModelProperty(value = "我发布全部课程数量") @ApiModelProperty(value = "我发布全部课程(我教学全部培训)数量")
private String publishAllCount; private String publishAllCount;
@ApiModelProperty(value = "我发布未发布课程数量") @ApiModelProperty(value = "我发布未发布课程(我教学未发布培训)数量")
private String notPublishCount; private String notPublishCount;
@ApiModelProperty(value = "我发布已发布课程数量") @ApiModelProperty(value = "我发布已发布课程(我教学已发布培训)数量")
private String publishedCount; private String publishedCount;
@ApiModelProperty(value = "我发布已关闭课程数量") @ApiModelProperty(value = "我发布已关闭课程(我教学已关闭培训)数量")
private String closedCount; private String closedCount;
@ApiModelProperty(value = "我学习全部课程数量") @ApiModelProperty(value = "我学习全部课程数量(我报名全部培训数量)")
private String learnAllCount; private String learnAllCount;
@ApiModelProperty(value = "我学完课程数量") @ApiModelProperty(value = "我学完课程数量(我报名已参加培训数量)")
private String finishCount; private String finishCount;
@ApiModelProperty(value = "我未学完课程数量") @ApiModelProperty(value = "我未学完课程数量(我报名缺勤培训数量)")
private String notFinishCount; private String notFinishCount;
@ApiModelProperty(value = "我未开始课程数量") @ApiModelProperty(value = "我未开始课程数量(我报名待参加培训数量)")
private String notStartCount; private String notStartCount;
} }
...@@ -162,6 +162,13 @@ public interface BLessonService{ ...@@ -162,6 +162,13 @@ public interface BLessonService{
* @return * @return
*/ */
ILessonCountDTO iLessonCount(String userId); ILessonCountDTO iLessonCount(String userId);
/**
* 我发布的总数
* @author: zhangqingle
* @param userId
* @return
*/
ILessonCountDTO iTrainCount(String userId);
/** /**
* 分页查询列表页全部 * 分页查询列表页全部
......
...@@ -570,6 +570,12 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -570,6 +570,12 @@ public class BLessonServiceImpl implements BLessonService {
return bLessonRepository.iLessonCount(userId); return bLessonRepository.iLessonCount(userId);
} }
@Override
@Transactional(propagation = Propagation.REQUIRED,readOnly = false)
public ILessonCountDTO iTrainCount(String userId) {
return bLessonRepository.iTrainCount(userId);
}
@Override @Override
@Transactional(propagation = Propagation.REQUIRED,readOnly = false) @Transactional(propagation = Propagation.REQUIRED,readOnly = false)
public List<BLesson> queryListAllLessonByPagination(PageUtil pageUtil, FindListLessonDTO model, List<AllCourseDTO> allCourse) { 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