he2802 4 سال پیش
والد
کامیت
e72b15cba5

+ 3 - 3
zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseChapterSectionController.java

@@ -47,10 +47,10 @@ public class CourseChapterSectionController extends BaseController {
      */
     @ApiOperation("查询章与节关系列表")
     @PreAuthorize("@ss.hasPermi('system:section:list')")
-    @GetMapping("/list")
-    public TableDataInfo<CourseChapterSectionVo> list(CourseChapterSectionQueryBo bo) {
+    @GetMapping("/list/{id}")
+    public TableDataInfo<CourseChapterSectionVo> list(@PathVariable("id" ) Long id) {
         startPage();
-        List<CourseChapterSectionVo> list = iCourseChapterSectionService.queryList(bo);
+        List<CourseChapterSectionVo> list = iCourseChapterSectionService.getListById(id);
         return getDataTable(list);
     }
 

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

@@ -1,7 +1,11 @@
 package com.zhongzheng.modules.course.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.course.domain.CourseChapterBusiness;
 import com.zhongzheng.modules.course.domain.CourseChapterSection;
+import com.zhongzheng.modules.course.vo.CourseChapterSectionVo;
+
+import java.util.List;
 
 /**
  * 章与节关系Mapper接口
@@ -10,5 +14,5 @@ import com.zhongzheng.modules.course.domain.CourseChapterSection;
  * @date 2021-10-12
  */
 public interface CourseChapterSectionMapper extends BaseMapper<CourseChapterSection> {
-
+    List<CourseChapterSectionVo> getListById(Long id);
 }

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

@@ -24,6 +24,8 @@ public interface ICourseChapterSectionService extends IService<CourseChapterSect
 	 */
 	CourseChapterSectionVo queryById(Long id);
 
+	List<CourseChapterSectionVo> getListById(Long id);
+
 	/**
 	 * 查询列表
 	 */

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

@@ -8,9 +8,11 @@ import com.zhongzheng.modules.course.bo.CourseChapterSectionAddBo;
 import com.zhongzheng.modules.course.bo.CourseChapterSectionEditBo;
 import com.zhongzheng.modules.course.bo.CourseChapterSectionQueryBo;
 import com.zhongzheng.modules.course.domain.CourseChapterSection;
+import com.zhongzheng.modules.course.mapper.CourseChapterMapper;
 import com.zhongzheng.modules.course.mapper.CourseChapterSectionMapper;
 import com.zhongzheng.modules.course.service.ICourseChapterSectionService;
 import com.zhongzheng.modules.course.vo.CourseChapterSectionVo;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -31,12 +33,20 @@ import java.util.stream.Collectors;
 @Service
 public class CourseChapterSectionServiceImpl extends ServiceImpl<CourseChapterSectionMapper, CourseChapterSection> implements ICourseChapterSectionService {
 
+    @Autowired
+    private CourseChapterSectionMapper courseChapterSectionMapper;
+
     @Override
     public CourseChapterSectionVo queryById(Long id){
         CourseChapterSection db = this.baseMapper.selectById(id);
         return BeanUtil.toBean(db, CourseChapterSectionVo.class);
     }
 
+    @Override
+    public List<CourseChapterSectionVo> getListById(Long id) {
+        return courseChapterSectionMapper.getListById(id);
+    }
+
     @Override
     public List<CourseChapterSectionVo> queryList(CourseChapterSectionQueryBo bo) {
         LambdaQueryWrapper<CourseChapterSection> lqw = Wrappers.lambdaQuery();

+ 25 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseChapterSectionVo.java

@@ -33,4 +33,29 @@ public class CourseChapterSectionVo {
 	@ApiModelProperty("章ID")
 	private Long chapterId;
 
+	/** 编码 */
+	@Excel(name = "编码")
+	@ApiModelProperty("编码")
+	private String code;
+	/** 名称 */
+	@Excel(name = "名称")
+	@ApiModelProperty("名称")
+	private String name;
+	/** 前缀名称 */
+	@Excel(name = "前缀名称")
+	@ApiModelProperty("前缀名称")
+	private String prefixName;
+	/** 状态 1正常 0关闭 */
+	@Excel(name = "状态 1正常 0关闭")
+	@ApiModelProperty("状态 1正常 0关闭")
+	private Integer status;
+	/** 节类型 1录播 2直播 3回放 */
+	@Excel(name = "节类型 1录播 2直播 3回放")
+	@ApiModelProperty("节类型 1录播 2直播 3回放")
+	private Integer sectionType;
+	/** 发布状态 1发布 0未发布 */
+	@Excel(name = "发布状态 1发布 0未发布")
+	@ApiModelProperty("发布状态 1发布 0未发布")
+	private Integer publishStatus;
+
 }

+ 26 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseChapterSectionMapper.xml

@@ -7,7 +7,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap type="com.zhongzheng.modules.course.domain.CourseChapterSection" id="CourseChapterSectionResult">
         <result property="sectionId" column="section_id"/>
         <result property="chapterId" column="chapter_id"/>
+        <result property="sort" column="sort"/>
     </resultMap>
 
+    <resultMap type="com.zhongzheng.modules.course.vo.CourseChapterSectionVo" id="CourseChapterSectionResultVo">
+        <result property="sectionId" column="section_id"/>
+        <result property="chapterId" column="chapter_id"/>
+        <result property="sort" column="sort"/>
+
+        <result property="code" column="code"/>
+        <result property="name" column="name"/>
+        <result property="prefixName" column="prefix_name"/>
+        <result property="status" column="status"/>
+        <result property="sectionType" column="section_type"/>
+        <result property="publishStatus" column="publish_status"/>
+    </resultMap>
+
+    <select id="getListById" parameterType="Long"  resultMap="CourseChapterSectionResultVo">
+        SELECT
+            cs.*,
+            ccs.sort,
+            ccs.chapter_id
+        FROM
+            course_chapter_section ccs
+                LEFT JOIN course_section cs ON ccs.section_id = cs.section_id
+        WHERE
+            ccs.chapter_id  =#{id}
+    </select>
+
 
 </mapper>