Explorar el Código

搜索条件新增

change hace 3 años
padre
commit
d9bf3d3e8a

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/mapper/ClassGradeUserMapper.java

@@ -27,7 +27,7 @@ public interface ClassGradeUserMapper extends BaseMapper<ClassGradeUser> {
 
     List<ClassPeriodVo> listPeriodAudit(ClassGradeUserQueryBo bo);
 
-    List<ClassPeriodChapterVo> listperiodChapter(@Param("moduleId") Long id,@Param("goodsId") Long goodsId,@Param("courseId") Long courseId,@Param("userId") Long userId);
+    List<ClassPeriodChapterVo> listperiodChapter(@Param("moduleId") Long id,@Param("goodsId") Long goodsId,@Param("courseId") Long courseId,@Param("userId") Long userId,@Param("gradeId") Long gradeId);
 
     List<ClassPeriodSectionVo> listPeriodSection(@Param("chapterId") Long id,@Param("goodsId") Long goodsId,@Param("courseId") Long courseId,@Param("userId") Long userId);
 

+ 3 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -231,11 +231,12 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
 
     @Override
     public List<ClassPeriodVo> listPeriodAudit(ClassGradeUserQueryBo bo) {
+        //查找最外层课程目录
         List<ClassPeriodVo> classPeriodVos = baseMapper.listPeriodAudit(bo);
         classPeriodVos.addAll(baseMapper.listPeriodAuditSection(bo));
         for (ClassPeriodVo classPeriodVo : classPeriodVos) {
             if (classPeriodVo.getType() == 1){
-                List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), bo.getGoodsId(),classPeriodVo.getCourseId(), bo.getUserId());
+                List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), bo.getGoodsId(),classPeriodVo.getCourseId(), bo.getUserId(),bo.getGradeId());
                 for (ClassPeriodChapterVo classPeriodChapterVo : classPeriodChapterVos) {
                     if (classPeriodChapterVo.getType() == 2) {
                         List<ClassPeriodSectionVo> classPeriodSectionVos = baseMapper.listPeriodSection(classPeriodChapterVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId());
@@ -417,7 +418,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
 
     @Override
     public List<ClassPeriodChapterVo> listPeriodAuditChapter(ClassGradeUserQueryBo bo) {
-        List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(bo.getModuleId(), bo.getGoodsId(),bo.getCourseId(), bo.getUserId());
+        List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(bo.getModuleId(), bo.getGoodsId(),bo.getCourseId(), bo.getUserId(),bo.getGradeId());
         return classPeriodChapterVos;
     }
 

+ 6 - 0
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml

@@ -497,6 +497,9 @@
         <if test="goodsId != null and goodsId !='' ">
             AND usr.goods_id=#{goodsId}
         </if>
+        <if test="gradeId != null and gradeId !='' ">
+            AND usr.gradeId=#{gradeId}
+        </if>
         ORDER BY
         usr.create_time ASC
         LIMIT 1
@@ -512,6 +515,9 @@
         <if test="goodsId != null and goodsId !='' ">
             AND usr.goods_id=#{goodsId}
         </if>
+        <if test="gradeId != null and gradeId !='' ">
+            AND usr.gradeId=#{gradeId}
+        </if>
         ORDER BY
         usr.create_time DESC
         LIMIT 1

+ 1 - 1
zhongzheng-system/src/main/resources/mapper/modules/user/UserStudyRecordMapper.xml

@@ -160,7 +160,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         (SELECT COUNT(id) FROM course_menu m where  m.course_id = r.course_id and m.type in(1)) as module_num,
         (SELECT COUNT(id)+(SELECT COUNT(p.id) FROM course_module_chapter p LEFT JOIN course_menu m  on m.menu_id = p.module_id where  m.course_id = r.course_id and m.type in(1)) FROM course_menu m where  m.course_id = r.course_id and m.type in(2)) as chapter_num,
         (SELECT COUNT(id)+(SELECT COUNT(n.id) FROM course_chapter_section n LEFT JOIN course_module_chapter p on n.chapter_id = p.chapter_id LEFT JOIN course_menu m on m.menu_id = p.module_id where m.course_id =  r.course_id and m.type in(1))+(SELECT COUNT(n.id) FROM course_chapter_section n  LEFT JOIN course_menu m on m.menu_id = n.chapter_id where m.course_id = r.course_id and m.type in(2)) FROM course_menu m where  m.course_id = r.course_id and m.type in(3)) as section_num,
-        (select COUNT(DISTINCT record_id) FROM user_study_record c where c.course_id = r.course_id and c.user_id=#{userId} and c.status = 1 and c.grade_id = #{gradeId}) as record_num
+        (select COUNT(DISTINCT section_id) FROM user_study_record c where c.course_id = r.course_id and c.user_id=#{userId} and c.status = 1 and c.grade_id = #{gradeId}) as record_num
         FROM
         course r
         LEFT JOIN goods_course c ON c.course_id = r.course_id