Ver código fonte

流业务层

he2802 4 anos atrás
pai
commit
e175506dfc

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

@@ -55,7 +55,7 @@ public class CourseStreamingController extends BaseController {
     @GetMapping("/list")
     public TableDataInfo<CourseStreamingVo> list(CourseStreamingQueryBo bo) {
         startPage();
-        List<CourseStreamingVo> list = iCourseStreamingService.queryList(bo);
+        List<CourseStreamingVo> list = iCourseStreamingService.selectList(bo);
         return getDataTable(list);
     }
 

+ 2 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseStreamingQueryBo.java

@@ -6,6 +6,7 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 import java.util.Date;
+import java.util.List;
 import java.util.Map;
 import java.util.HashMap;
 
@@ -71,5 +72,5 @@ public class CourseStreamingQueryBo extends BaseEntity {
 	private String playbackUrl;
 	/** 状态 1正常 0关闭 */
 	@ApiModelProperty("状态 1正常 0关闭")
-	private Integer status;
+	private List<Integer> status;
 }

+ 7 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseStreamingMapper.java

@@ -1,7 +1,13 @@
 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.bo.CourseStreamingQueryBo;
 import com.zhongzheng.modules.course.domain.CourseStreaming;
+import com.zhongzheng.modules.course.vo.CourseSectionVo;
+import com.zhongzheng.modules.course.vo.CourseStreamingVo;
+
+import java.util.List;
 
 /**
  * 课程流媒体Mapper接口
@@ -10,5 +16,5 @@ import com.zhongzheng.modules.course.domain.CourseStreaming;
  * @date 2021-10-11
  */
 public interface CourseStreamingMapper extends BaseMapper<CourseStreaming> {
-
+    List<CourseStreamingVo> selectList(CourseStreamingQueryBo bo);
 }

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

@@ -23,6 +23,8 @@ public interface ICourseStreamingService extends IService<CourseStreaming> {
 	 */
 	CourseStreamingVo queryById(Long id);
 
+	List<CourseStreamingVo> selectList(CourseStreamingQueryBo bo);
+
 	/**
 	 * 查询列表
 	 */

+ 9 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseStreamingServiceImpl.java

@@ -8,6 +8,7 @@ import com.zhongzheng.modules.course.bo.*;
 import com.zhongzheng.modules.course.domain.CourseSectionBusiness;
 import com.zhongzheng.modules.course.domain.CourseStreaming;
 import com.zhongzheng.modules.course.domain.CourseStreamingBusiness;
+import com.zhongzheng.modules.course.mapper.CourseSectionMapper;
 import com.zhongzheng.modules.course.mapper.CourseStreamingMapper;
 import com.zhongzheng.modules.course.service.ICourseSectionBusinessService;
 import com.zhongzheng.modules.course.service.ICourseStreamingBusinessService;
@@ -37,12 +38,20 @@ public class CourseStreamingServiceImpl extends ServiceImpl<CourseStreamingMappe
     @Autowired
     private ICourseStreamingBusinessService iCourseStreamingBusinessService;
 
+    @Autowired
+    private CourseStreamingMapper courseStreamingMapper;
+
     @Override
     public CourseStreamingVo queryById(Long id){
         CourseStreaming db = this.baseMapper.selectById(id);
         return BeanUtil.toBean(db, CourseStreamingVo.class);
     }
 
+    @Override
+    public List<CourseStreamingVo> selectList(CourseStreamingQueryBo bo) {
+        return courseStreamingMapper.selectList(bo);
+    }
+
     @Override
     public List<CourseStreamingVo> queryList(CourseStreamingQueryBo bo) {
         LambdaQueryWrapper<CourseStreaming> lqw = Wrappers.lambdaQuery();

+ 7 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseStreamingVo.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.domain.CourseSectionBusiness;
+import com.zhongzheng.modules.course.domain.CourseStreamingBusiness;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import java.util.Date;
-
+import java.util.List;
 
 
 /**
@@ -72,4 +74,8 @@ public class CourseStreamingVo {
 	@Excel(name = "状态 1正常 0关闭")
 	@ApiModelProperty("状态 1正常 0关闭")
 	private Integer status;
+	/** 业务层级列表 */
+	@ApiModelProperty("业务层级列表")
+	private List<CourseStreamingBusiness> businessList;
+
 }

+ 56 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseStreamingMapper.xml

@@ -22,5 +22,61 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="status" column="status"/>
     </resultMap>
 
+    <resultMap type="com.zhongzheng.modules.course.vo.CourseStreamingVo" id="CourseStreamingResultVo">
+        <result property="id" column="id"/>
+        <result property="streamingType" column="streaming_type"/>
+        <result property="streamingName" column="streaming_name"/>
+        <result property="code" column="code"/>
+        <result property="liveChannelNumber" column="live_channel_number"/>
+        <result property="livePushUrl" column="live_push_url"/>
+        <result property="livePullUrl" column="live_pull_url"/>
+        <result property="liveUrl" column="live_url"/>
+        <result property="streamingAddressType" column="streaming_address_type"/>
+        <result property="introduce" column="introduce"/>
+        <result property="recordingVideoId" column="recording_video_id"/>
+        <result property="playbackUrl" column="playback_url"/>
+        <result property="status" column="status"/>
+        <collection property="businessList" javaType="java.util.List" resultMap="CourseStreamingBusinessResult"/>
+    </resultMap>
+
+    <resultMap type="com.zhongzheng.modules.course.domain.CourseStreamingBusiness" id="CourseStreamingBusinessResult">
+        <result property="id" column="join_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="selectList" parameterType="com.zhongzheng.modules.course.bo.CourseStreamingQueryBo" resultMap="CourseStreamingResultVo">
+        SELECT
+        cs.*,
+        csb.education_type_id,
+        csb.id as join_id,
+        csb.business_id,
+        csb.project_id,
+        cet.education_name,
+        cpt.project_name,
+        cb.business_name
+        FROM
+        course_streaming cs
+        LEFT JOIN course_streaming_business csb ON cs.id = csb.streaming_id
+        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
+        1 = 1
+
+        <if test="status != null and status.size()!=0 ">
+            AND cs.status in
+            <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
 
+    </select>
 </mapper>