Ver Fonte

流业务层

he2802 há 4 anos atrás
pai
commit
2310f9bd00

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

@@ -1,8 +1,12 @@
 package com.zhongzheng.controller.course;
 
+import java.util.HashMap;
 import java.util.List;
 import java.util.Arrays;
+import java.util.Map;
 
+import cn.hutool.http.HttpStatus;
+import com.github.pagehelper.PageInfo;
 import com.zhongzheng.modules.course.bo.CourseChapterSectionAddBo;
 import com.zhongzheng.modules.course.bo.CourseChapterSectionEditBo;
 import com.zhongzheng.modules.course.bo.CourseChapterSectionQueryBo;
@@ -48,10 +52,16 @@ public class CourseChapterSectionController extends BaseController {
     @ApiOperation("查询章与节关系列表")
     @PreAuthorize("@ss.hasPermi('system:section:list')")
     @GetMapping("/list/{id}")
-    public TableDataInfo<CourseChapterSectionVo> list(@PathVariable("id" ) Long id) {
+    public AjaxResult list(@PathVariable("id" ) Long id) {
         startPage();
         List<CourseChapterSectionVo> list = iCourseChapterSectionService.getListById(id);
-        return getDataTable(list);
+        Map<String, Object> result = new HashMap<>();
+        result.put("total",new PageInfo(list).getTotal());
+        result.put("code", HttpStatus.HTTP_OK);
+        result.put("list",list);
+        result.put("msg","查询成功");
+        result.put("sectionTotal",new PageInfo(list).getTotal());
+        return AjaxResult.success(result);
     }
 
     /**

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

@@ -14,7 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <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="sort" column="c_sort"/>
         <result property="id" column="id"/>
 
         <result property="code" column="code"/>
@@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="getListById" parameterType="Long"  resultMap="CourseChapterSectionResultVo">
         SELECT
             cs.*,
-            ccs.sort,
+            ccs.sort as c_sort,
             ccs.id,
             ccs.chapter_id
         FROM