Browse Source

流业务层

he2802 4 năm trước cách đây
mục cha
commit
9450c6bb13

+ 17 - 8
zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseModuleChapterController.java

@@ -54,6 +54,15 @@ public class CourseModuleChapterController extends BaseController {
         return getDataTable(list);
     }
 
+    @ApiOperation("查询模块与章关系列表")
+    @PreAuthorize("@ss.hasPermi('system:chapter:list')")
+    @GetMapping("/allList")
+    public TableDataInfo<CourseModuleChapterVo> all_list(CourseModuleChapterQueryBo bo) {
+        startPage();
+        List<CourseModuleChapterVo> list = iCourseModuleChapterService.queryList(bo);
+        return getDataTable(list);
+    }
+
     /**
      * 导出模块与章关系列表
      */
@@ -70,43 +79,43 @@ public class CourseModuleChapterController extends BaseController {
     /**
      * 获取模块与章关系详细信息
      */
-    @ApiOperation("获取模块与章关系详细信息")
+   /* @ApiOperation("获取模块与章关系详细信息")
     @PreAuthorize("@ss.hasPermi('system:chapter:query')")
     @GetMapping("/{id}")
     public AjaxResult<CourseModuleChapterVo> getInfo(@PathVariable("id" ) Long id) {
         return AjaxResult.success(iCourseModuleChapterService.queryById(id));
-    }
+    }*/
 
     /**
      * 新增模块与章关系
      */
-    @ApiOperation("新增模块与章关系")
+    /*@ApiOperation("新增模块与章关系")
     @PreAuthorize("@ss.hasPermi('system:chapter:add')")
     @Log(title = "模块与章关系", businessType = BusinessType.INSERT)
     @PostMapping()
     public AjaxResult<Void> add(@RequestBody CourseModuleChapterAddBo bo) {
         return toAjax(iCourseModuleChapterService.insertByAddBo(bo) ? 1 : 0);
-    }
+    }*/
 
     /**
      * 修改模块与章关系
      */
-    @ApiOperation("修改模块与章关系")
+   /* @ApiOperation("修改模块与章关系")
     @PreAuthorize("@ss.hasPermi('system:chapter:edit')")
     @Log(title = "模块与章关系", businessType = BusinessType.UPDATE)
     @PostMapping("/edit")
     public AjaxResult<Void> edit(@RequestBody CourseModuleChapterEditBo bo) {
         return toAjax(iCourseModuleChapterService.updateByEditBo(bo) ? 1 : 0);
-    }
+    }*/
 
     /**
      * 删除模块与章关系
      */
-    @ApiOperation("删除模块与章关系")
+   /* @ApiOperation("删除模块与章关系")
     @PreAuthorize("@ss.hasPermi('system:chapter:remove')")
     @Log(title = "模块与章关系" , businessType = BusinessType.DELETE)
     @PostMapping("/del/{ids}")
     public AjaxResult<Void> remove(@PathVariable Long[] ids) {
         return toAjax(iCourseModuleChapterService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
-    }
+    }*/
 }

+ 30 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseModuleChapterMapper.xml

@@ -8,7 +8,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="id" column="id"/>
         <result property="moduleId" column="module_id"/>
         <result property="chapterId" column="chapter_id"/>
+        <result property="sort" column="c_sort"/>
     </resultMap>
 
+    <resultMap type="com.zhongzheng.modules.course.vo.CourseModuleChapterVo" id="CourseModuleChapterResultVo">
+        <result property="sectionId" column="section_id"/>
+        <result property="chapterId" column="chapter_id"/>
+        <result property="sort" column="c_sort"/>
+        <result property="id" column="id"/>
+
+        <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="CourseModuleChapterResultVo">
+        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>
 
 </mapper>