Browse Source

我的学时

change 4 years ago
parent
commit
987dad89f4

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseChapterSectionMapper.java

@@ -1,9 +1,11 @@
 package com.zhongzheng.modules.course.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
 import com.zhongzheng.modules.course.domain.CourseChapterBusiness;
 import com.zhongzheng.modules.course.domain.CourseChapterSection;
 import com.zhongzheng.modules.course.vo.CourseChapterSectionVo;
+import com.zhongzheng.modules.course.vo.CourseUserChapterSectionVo;
 
 import java.util.List;
 
@@ -15,5 +17,8 @@ import java.util.List;
  */
 public interface CourseChapterSectionMapper extends BaseMapper<CourseChapterSection> {
     List<CourseChapterSectionVo> getListById(Long id);
+    List<CourseChapterSectionVo> getInformById(Long id);
     Long getListTotalTime(Long id);
+
+    List<CourseUserChapterSectionVo> sectionList(CourseMenuQueryBo bo);
 }

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseChapterSectionServiceImpl.java

@@ -130,7 +130,7 @@ public class CourseChapterSectionServiceImpl extends ServiceImpl<CourseChapterSe
 
     @Override
     public List<CourseUserChapterSectionVo> sectionList(CourseMenuQueryBo bo) {
-        //courseChapterSectionMapper.sectionList(bo)
+        List<CourseUserChapterSectionVo> courseUserChapterSectionVos = courseChapterSectionMapper.sectionList(bo);
         return null;
     }
 }

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/impl/InformServiceImpl.java

@@ -293,12 +293,12 @@ public class InformServiceImpl extends ServiceImpl<InformMapper, Inform> impleme
                 if (courseMenuVo.getType().equals(1)){
                     List<CourseModuleChapterVo> listById = courseModuleChapterMapper.getListById(courseMenuVo.getMenuId());
                     for (CourseModuleChapterVo courseModuleChapterVo : listById) {
-                        courseModuleChapterVo.setCourseChapterSectionList(courseChapterSectionMapper.getListById(courseModuleChapterVo.getChapterId()));
+                        courseModuleChapterVo.setCourseChapterSectionList(courseChapterSectionMapper.getInformById(courseModuleChapterVo.getChapterId()));
                     }
                     courseMenuVo.setCourseModuleChapterVos(listById);
                 }
                 if (courseMenuVo.getType().equals(2)){
-                    courseMenuVo.setCourseChapterSectionList(courseChapterSectionMapper.getListById(courseMenuVo.getMenuId()));
+                    courseMenuVo.setCourseChapterSectionList(courseChapterSectionMapper.getInformById(courseMenuVo.getMenuId()));
                 }
             }
             courseInformVo.setCourseMenuList(list);

+ 17 - 1
zhongzheng-system/src/main/resources/mapper/modules/course/CourseChapterSectionMapper.xml

@@ -29,12 +29,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
     <select id="getListById" parameterType="Long"  resultMap="CourseChapterSectionResultVo">
+        SELECT
+            cs.*,
+            ccs.sort as c_sort,
+            ccs.id,
+            ccs.chapter_id
+        FROM
+            course_chapter_section ccs
+                LEFT JOIN course_section cs ON ccs.section_id = cs.section_id
+        WHERE
+            cs.`status` !=- 1
+	        AND ccs.chapter_id = #{id}
+        ORDER BY
+            c_sort DESC
+    </select>
+
+    <select id="getInformById" parameterType="Long"  resultMap="CourseChapterSectionResultVo">
         SELECT
             cs.*,
             ccs.sort as c_sort,
             ccs.id,
             ccs.chapter_id,
-            3 as type
+               3 as type
         FROM
             course_chapter_section ccs
                 LEFT JOIN course_section cs ON ccs.section_id = cs.section_id