he2802 vor 4 Jahren
Ursprung
Commit
5e0abe2427

+ 29 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseModuleChapterListVo.java

@@ -0,0 +1,29 @@
+package com.zhongzheng.modules.course.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+/**
+ * 模块与章关系视图对象 mall_package
+ *
+ * @author hjl
+ * @date 2021-10-11
+ */
+@Data
+@ApiModel("模块与章关系视图对象")
+public class CourseModuleChapterListVo {
+	private static final long serialVersionUID = 1L;
+
+
+	/** 模块id */
+	@Excel(name = "模块id")
+	@ApiModelProperty("模块id")
+	private Long moduleId;
+	/** 模块名称 */
+	@Excel(name = "模块名称")
+	@ApiModelProperty("模块名称")
+	private String moduleName;
+}

+ 30 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseSectionListVo.java

@@ -0,0 +1,30 @@
+package com.zhongzheng.modules.course.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import com.zhongzheng.modules.course.domain.CourseSectionBusiness;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+
+/**
+ * 课程小节视图对象 mall_package
+ *
+ * @author hjl
+ * @date 2021-10-11
+ */
+@Data
+@ApiModel("课程小节视图对象")
+public class CourseSectionListVo {
+	private static final long serialVersionUID = 1L;
+	/** 课程id */
+	@Excel(name = "课程id")
+	@ApiModelProperty("课程id")
+	private Long courseId;
+	/** 课程名称 */
+	@Excel(name = "课程名称")
+	@ApiModelProperty("课程名称")
+	private String courseName;
+}

+ 9 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseSectionVo.java

@@ -85,7 +85,13 @@ public class CourseSectionVo {
 	/** 业务层级列表 */
 	@ApiModelProperty("业务层级列表")
 	private List<CourseSectionBusiness> businessList;
-	/** 业务层级列表 */
-	@ApiModelProperty("业务层级列表")
-	private List<CourseChapterSectionVo> chapterList;
+	/** 章列表 */
+	@ApiModelProperty("章列表")
+	private List<CourseChapterSectionListVo> chapterList;
+	/** 模块列表 */
+	@ApiModelProperty("模块列表")
+	private List<CourseModuleChapterListVo> moduleList;
+	/** 课程列表 */
+	@ApiModelProperty("课程列表")
+	private List<CourseSectionListVo> courseList;
 }

+ 40 - 20
zhongzheng-system/src/main/resources/mapper/modules/course/CourseSectionMapper.xml

@@ -43,6 +43,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="code" column="code"/>
         <collection property="businessList" javaType="java.util.List" resultMap="CourseSectionBusiness"/>
         <collection property="chapterList" javaType="java.util.List" resultMap="CourseChapterSectionListResult"/>
+        <collection property="moduleList" javaType="java.util.List" resultMap="CourseModuleChapterListResult"/>
+        <collection property="courseList" javaType="java.util.List" resultMap="CourseSectionListResult"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.course.domain.CourseSectionBusiness" id="CourseSectionBusiness">
@@ -63,29 +65,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="chapterId" column="chapter_id"/>
     </resultMap>
 
+    <resultMap type="com.zhongzheng.modules.course.vo.CourseModuleChapterListVo" id="CourseModuleChapterListResult">
+        <result property="moduleId" column="module_id"/>
+        <result property="moduleName" column="module_name"/>
+    </resultMap>
+
+    <resultMap type="com.zhongzheng.modules.course.vo.CourseSectionListVo" id="CourseSectionListResult">
+        <result property="courseId" column="course_id"/>
+        <result property="courseName" column="course_name"/>
+    </resultMap>
+
     <select id="selectSectionList" parameterType="com.zhongzheng.modules.course.bo.CourseSectionQueryBo" resultMap="CourseSectionResultVo">
         SELECT
-            c.*,
-            csb.education_type_id,
-            csb.id,
-            csb.business_id,
-            csb.subject_id,
-            csb.project_id,
-            cet.education_name,
-            cpt.project_name,
-            cb.business_name,
-            cs.subject_name,
-            ccs.chapter_id,
-            cc.NAME AS chapter_name
+        c.*,
+        csb.education_type_id,
+        csb.id,
+        csb.business_id,
+        csb.subject_id,
+        csb.project_id,
+        cet.education_name,
+        cpt.project_name,
+        cb.business_name,
+        cs.subject_name,
+        ccs.chapter_id,
+        cc.NAME AS chapter_name,
+        cmc.module_id,
+        cm.module_name,
+        m.course_id,
+        co.course_name
         FROM
-            course_section c
-                LEFT JOIN course_section_business csb ON c.section_id = csb.section_id
-                LEFT JOIN course_education_type cet ON csb.education_type_id = cet.id
-                LEFT JOIN course_project_type cpt ON csb.project_id = cpt.id
-                LEFT JOIN course_business cb ON csb.business_id = cb.id
-                LEFT JOIN course_subject cs ON csb.subject_id = cs.id
-                LEFT JOIN course_chapter_section ccs ON csb.id = ccs.section_id
-                LEFT JOIN course_chapter cc ON ccs.chapter_id = cc.chapter_id
+        course_section c
+        LEFT JOIN course_section_business csb ON c.section_id = csb.section_id
+        LEFT JOIN course_education_type cet ON csb.education_type_id = cet.id
+        LEFT JOIN course_project_type cpt ON csb.project_id = cpt.id
+        LEFT JOIN course_business cb ON csb.business_id = cb.id
+        LEFT JOIN course_subject cs ON csb.subject_id = cs.id
+        LEFT JOIN course_chapter_section ccs ON csb.id = ccs.section_id
+        LEFT JOIN course_chapter cc ON ccs.chapter_id = cc.chapter_id
+        LEFT JOIN course_module_chapter cmc ON cc.chapter_id = cmc.chapter_id
+        LEFT JOIN course_module cm ON cmc.module_id = cm.module_id
+        LEFT JOIN ( SELECT course_id, menu_id FROM course_menu WHERE type = 4 AND STATUS = 1 ) m ON csb.section_id = m.menu_id
+        LEFT JOIN course co ON m.course_id = co.course_id
         WHERE
             1 = 1
         <if test="name != null and name != ''">