he2802 4 lat temu
rodzic
commit
648a63330a

+ 1 - 1
zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseSectionController.java

@@ -54,7 +54,7 @@ public class CourseSectionController extends BaseController {
     @GetMapping("/list")
     public TableDataInfo<CourseSectionVo> list(CourseSectionQueryBo bo) {
         startPage();
-        List<CourseSectionVo> list = iCourseSectionService.queryList(bo);
+        List<CourseSectionVo> list = iCourseSectionService.selectSectionList(bo);
         return getDataTable(list);
     }
 

+ 6 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseSectionMapper.java

@@ -1,7 +1,12 @@
 package com.zhongzheng.modules.course.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.course.bo.CourseSectionQueryBo;
 import com.zhongzheng.modules.course.domain.CourseSection;
+import com.zhongzheng.modules.course.domain.CourseStreamingBusiness;
+import com.zhongzheng.modules.course.vo.CourseSectionVo;
+
+import java.util.List;
 
 /**
  * 课程小节Mapper接口
@@ -10,5 +15,5 @@ import com.zhongzheng.modules.course.domain.CourseSection;
  * @date 2021-10-11
  */
 public interface CourseSectionMapper extends BaseMapper<CourseSection> {
-
+    List<CourseSectionVo> selectSectionList(CourseSectionQueryBo bo);
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseSectionService.java

@@ -24,6 +24,8 @@ public interface ICourseSectionService extends IService<CourseSection> {
 	 */
 	CourseSectionVo queryById(Long sectionId);
 
+	List<CourseSectionVo> selectSectionList(CourseSectionQueryBo bo);
+
 	/**
 	 * 查询列表
 	 */

+ 8 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSectionServiceImpl.java

@@ -40,12 +40,20 @@ public class CourseSectionServiceImpl extends ServiceImpl<CourseSectionMapper, C
     @Autowired
     private ICourseSectionBusinessService iCourseSectionBusinessService;
 
+    @Autowired
+    private CourseSectionMapper courseSectionMapper;
+
     @Override
     public CourseSectionVo queryById(Long sectionId){
         CourseSection db = this.baseMapper.selectById(sectionId);
         return BeanUtil.toBean(db, CourseSectionVo.class);
     }
 
+    @Override
+    public List<CourseSectionVo> selectSectionList(CourseSectionQueryBo bo) {
+        return courseSectionMapper.selectSectionList(bo);
+    }
+
     @Override
     public List<CourseSectionVo> queryList(CourseSectionQueryBo bo) {
         LambdaQueryWrapper<CourseSection> lqw = Wrappers.lambdaQuery();

+ 6 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseSectionVo.java

@@ -2,11 +2,13 @@ package com.zhongzheng.modules.course.vo;
 
 import com.zhongzheng.common.annotation.Excel;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.zhongzheng.modules.course.bo.CourseSectionBusinessAddBo;
+import com.zhongzheng.modules.course.domain.CourseSectionBusiness;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import java.util.Date;
-
+import java.util.List;
 
 
 /**
@@ -80,4 +82,7 @@ public class CourseSectionVo {
 	@Excel(name = "编码")
 	@ApiModelProperty("编码")
 	private String code;
+	/** 业务层级列表 */
+	@ApiModelProperty("业务层级列表")
+	private List<CourseSectionBusiness> businessList;
 }

+ 21 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseChapterBusinessMapper.xml

@@ -11,7 +11,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="businessId" column="business_id"/>
         <result property="subjectId" column="subject_id"/>
         <result property="projectId" column="project_id"/>
+
+        <result property="educationName" column="education_name"/>
+        <result property="projectName" column="project_name"/>
+        <result property="businessName" column="business_name"/>
+        <result property="subjectName" column="subject_name"/>
     </resultMap>
 
+    <select id="getListById" parameterType="Long"  resultMap="CourseChapterBusinessResult">
+        SELECT
+            ccb.*,
+            cet.education_name,
+            cpt.project_name,
+            cb.business_name
+        FROM
+            course_chapter_business ccb
+                LEFT JOIN course_education_type cet ON ccb.education_type_id = cet.id
+                LEFT JOIN course_project_type cpt ON ccb.project_id = cpt.id
+                LEFT JOIN course_business cb ON ccb.business_id = cb.id
+                LEFT JOIN course_subject cs ON ccb.subject_id = cs.id
+        WHERE
+            ccb.chapter_id =#{id}
+    </select>
+
 
 </mapper>

+ 50 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseSectionMapper.xml

@@ -24,5 +24,55 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="code" column="code"/>
     </resultMap>
 
+    <resultMap type="com.zhongzheng.modules.course.vo.CourseSectionVo" id="CourseSectionResultVo">
+        <result property="sectionId" column="section_id"/>
+        <result property="name" column="name"/>
+        <result property="sort" column="sort"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="prefixName" column="prefix_name"/>
+        <result property="status" column="status"/>
+        <result property="sectionType" column="section_type"/>
+        <result property="publishStatus" column="publish_status"/>
+        <result property="liveUrl" column="live_url"/>
+        <result property="liveStartTime" column="live_start_time"/>
+        <result property="liveEndTime" column="live_end_time"/>
+        <result property="liveDuration" column="live_duration"/>
+        <result property="recordingUrl" column="recording_url"/>
+        <result property="recordingDuration" column="recording_duration"/>
+        <result property="coverUrl" column="cover_url"/>
+        <result property="code" column="code"/>
+        <collection property="businessList" javaType="java.util.List" resultMap="CourseStreamingBusinessResult"/>
+    </resultMap>
+
+    <resultMap type="com.zhongzheng.modules.course.domain.CourseStreamingBusiness" id="CourseStreamingBusinessResult">
+        <result property="id" column="id"/>
+        <result property="streamingId" column="streaming_id"/>
+        <result property="educationTypeId" column="education_type_id"/>
+        <result property="businessId" column="business_id"/>
+        <result property="projectId" column="project_id"/>
+
+        <result property="educationName" column="education_name"/>
+        <result property="projectName" column="project_name"/>
+        <result property="businessName" column="business_name"/>
+    </resultMap>
 
+    <select id="selectSectionList" parameterType="com.zhongzheng.modules.course.bo.CourseSectionQueryBo" resultMap="CourseSectionResultVo">
+        SELECT
+            csb.*,
+            cet.education_name,
+            cpt.project_name,
+            cb.business_name,
+            cs.subject_name ,
+            ccs.chapter_id,
+            cc.name as chapter_name
+        FROM
+            course_section_business csb
+                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
+    </select>
 </mapper>