Browse Source

流业务层

he2802 4 years ago
parent
commit
737d26c324

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

@@ -115,7 +115,7 @@ public class CourseSectionController extends BaseController {
     }*/
 
     /**
-     * 获取课程小节详细信息
+     * 获取课程小节业务层次列表
      */
     @ApiOperation("获取课程小节业务层次列表")
     @PreAuthorize("@ss.hasPermi('system:section:query')")

+ 16 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseStreamingController.java

@@ -6,6 +6,9 @@ import java.util.Arrays;
 import com.zhongzheng.modules.course.bo.CourseStreamingAddBo;
 import com.zhongzheng.modules.course.bo.CourseStreamingEditBo;
 import com.zhongzheng.modules.course.bo.CourseStreamingQueryBo;
+import com.zhongzheng.modules.course.domain.CourseSectionBusiness;
+import com.zhongzheng.modules.course.domain.CourseStreamingBusiness;
+import com.zhongzheng.modules.course.service.ICourseStreamingBusinessService;
 import com.zhongzheng.modules.course.service.ICourseStreamingService;
 import com.zhongzheng.modules.course.vo.CourseStreamingVo;
 import lombok.RequiredArgsConstructor;
@@ -42,6 +45,8 @@ public class CourseStreamingController extends BaseController {
 
     private final ICourseStreamingService iCourseStreamingService;
 
+    private final ICourseStreamingBusinessService iCourseStreamingBusinessService;
+
     /**
      * 查询课程流媒体列表
      */
@@ -109,4 +114,15 @@ public class CourseStreamingController extends BaseController {
     public AjaxResult<Void> remove(@PathVariable Long[] ids) {
         return toAjax(iCourseStreamingService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
     }*/
+
+    /**
+     * 获取课程小节业务层次列表
+     */
+    @ApiOperation("获取课程小节业务层次列表")
+    @PreAuthorize("@ss.hasPermi('system:section:query')")
+    @GetMapping("/business/{id}")
+    public AjaxResult<List<CourseStreamingBusiness>> getBusinessList(@PathVariable("id" ) Long id) {
+        List<CourseStreamingBusiness> list = iCourseStreamingBusinessService.getListById(id);
+        return AjaxResult.success(list);
+    }
 }

+ 7 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/domain/CourseStreamingBusiness.java

@@ -34,4 +34,11 @@ private static final long serialVersionUID=1L;
     private Long businessId;
     /** 项目ID */
     private Long projectId;
+
+    @TableField(exist = false)
+    private String educationName;
+    @TableField(exist = false)
+    private String projectName;
+    @TableField(exist = false)
+    private String businessName;
 }

+ 4 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseStreamingBusinessMapper.java

@@ -1,8 +1,11 @@
 package com.zhongzheng.modules.course.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.course.domain.CourseSectionBusiness;
 import com.zhongzheng.modules.course.domain.CourseStreamingBusiness;
 
+import java.util.List;
+
 /**
  * 课程流适用业务关系Mapper接口
  *
@@ -10,5 +13,5 @@ import com.zhongzheng.modules.course.domain.CourseStreamingBusiness;
  * @date 2021-10-11
  */
 public interface CourseStreamingBusinessMapper extends BaseMapper<CourseStreamingBusiness> {
-
+    List<CourseStreamingBusiness> getListById(Long id);
 }

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

@@ -23,6 +23,8 @@ public interface ICourseStreamingBusinessService extends IService<CourseStreamin
 	 */
 	CourseStreamingBusinessVo queryById(Long id);
 
+	List<CourseStreamingBusiness> getListById(Long id);
+
 	/**
 	 * 查询列表
 	 */

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

@@ -7,9 +7,11 @@ import com.zhongzheng.modules.course.bo.CourseStreamingBusinessAddBo;
 import com.zhongzheng.modules.course.bo.CourseStreamingBusinessEditBo;
 import com.zhongzheng.modules.course.bo.CourseStreamingBusinessQueryBo;
 import com.zhongzheng.modules.course.domain.CourseStreamingBusiness;
+import com.zhongzheng.modules.course.mapper.CourseSectionBusinessMapper;
 import com.zhongzheng.modules.course.mapper.CourseStreamingBusinessMapper;
 import com.zhongzheng.modules.course.service.ICourseStreamingBusinessService;
 import com.zhongzheng.modules.course.vo.CourseStreamingBusinessVo;
+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;
@@ -30,12 +32,20 @@ import java.util.stream.Collectors;
 @Service
 public class CourseStreamingBusinessServiceImpl extends ServiceImpl<CourseStreamingBusinessMapper, CourseStreamingBusiness> implements ICourseStreamingBusinessService {
 
+    @Autowired
+    private CourseStreamingBusinessMapper courseStreamingBusinessMapper;
+
     @Override
     public CourseStreamingBusinessVo queryById(Long id){
         CourseStreamingBusiness db = this.baseMapper.selectById(id);
         return BeanUtil.toBean(db, CourseStreamingBusinessVo.class);
     }
 
+    @Override
+    public List<CourseStreamingBusiness> getListById(Long id) {
+        return courseStreamingBusinessMapper.getListById(id);
+    }
+
     @Override
     public List<CourseStreamingBusinessVo> queryList(CourseStreamingBusinessQueryBo bo) {
         LambdaQueryWrapper<CourseStreamingBusiness> lqw = Wrappers.lambdaQuery();

+ 18 - 1
zhongzheng-system/src/main/resources/mapper/modules/course/CourseStreamingBusinessMapper.xml

@@ -10,7 +10,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="educationTypeId" column="education_type_id"/>
         <result property="businessId" column="business_id"/>
         <result property="projectId" column="project_id"/>
-    </resultMap>
 
+        <result property="educationName" column="education_name"/>
+        <result property="projectName" column="project_name"/>
+        <result property="businessName" column="business_name"/>
+    </resultMap>
 
+    <select id="getListById" parameterType="Long"  resultMap="CourseStreamingBusinessResult">
+        SELECT
+            csb.*,
+            cet.education_name,
+            cpt.project_name,
+            cb.business_name
+        FROM
+            course_streaming_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
+        WHERE
+            csb.streaming_id =#{id}
+    </select>
 </mapper>