CourseStreamingMapper.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.zhongzheng.modules.course.mapper.CourseStreamingMapper">
  6. <resultMap type="com.zhongzheng.modules.course.domain.CourseStreaming" id="CourseStreamingResult">
  7. <result property="id" column="id"/>
  8. <result property="streamingType" column="streaming_type"/>
  9. <result property="streamingName" column="streaming_name"/>
  10. <result property="code" column="code"/>
  11. <result property="liveChannelNumber" column="live_channel_number"/>
  12. <result property="livePushUrl" column="live_push_url"/>
  13. <result property="livePullUrl" column="live_pull_url"/>
  14. <result property="liveUrl" column="live_url"/>
  15. <result property="streamingAddressType" column="streaming_address_type"/>
  16. <result property="introduce" column="introduce"/>
  17. <result property="recordingVideoId" column="recording_video_id"/>
  18. <result property="playbackUrl" column="playback_url"/>
  19. <result property="createTime" column="create_time"/>
  20. <result property="updateTime" column="update_time"/>
  21. <result property="status" column="status"/>
  22. <result property="polyvId" column="polyv_id"/>
  23. </resultMap>
  24. <resultMap type="com.zhongzheng.modules.course.vo.CourseStreamingVo" id="CourseStreamingResultVo">
  25. <result property="id" column="id"/>
  26. <result property="streamingType" column="streaming_type"/>
  27. <result property="streamingName" column="streaming_name"/>
  28. <result property="code" column="code"/>
  29. <result property="liveChannelNumber" column="live_channel_number"/>
  30. <result property="livePushUrl" column="live_push_url"/>
  31. <result property="livePullUrl" column="live_pull_url"/>
  32. <result property="liveUrl" column="live_url"/>
  33. <result property="streamingAddressType" column="streaming_address_type"/>
  34. <result property="introduce" column="introduce"/>
  35. <result property="recordingVideoId" column="recording_video_id"/>
  36. <result property="playbackUrl" column="playback_url"/>
  37. <result property="status" column="status"/>
  38. <result property="polyvUrl" column="polyv_url"/>
  39. <result property="createTime" column="create_time"/>
  40. <result property="updateTime" column="update_time"/>
  41. <collection property="businessList" column="id" select="findBusinessList"/>
  42. </resultMap>
  43. <resultMap type="com.zhongzheng.modules.course.domain.CourseStreamingBusiness" id="CourseStreamingBusinessResult">
  44. <result property="id" column="join_id"/>
  45. <result property="streamingId" column="streaming_id"/>
  46. <result property="educationTypeId" column="education_type_id"/>
  47. <result property="businessId" column="business_id"/>
  48. <result property="projectId" column="project_id"/>
  49. <result property="educationName" column="education_name"/>
  50. <result property="projectName" column="project_name"/>
  51. <result property="businessName" column="business_name"/>
  52. </resultMap>
  53. <select id="findBusinessList" resultMap="CourseStreamingBusinessResult">
  54. SELECT
  55. csb.education_type_id,
  56. csb.id AS join_id,
  57. csb.business_id,
  58. csb.project_id,
  59. cet.education_name,
  60. cpt.project_name,
  61. cb.business_name
  62. FROM
  63. course_streaming_business csb
  64. LEFT JOIN course_education_type cet ON csb.education_type_id = cet.id AND cet.status =1
  65. LEFT JOIN course_project_type cpt ON csb.project_id = cpt.id AND cpt.status =1
  66. LEFT JOIN course_business cb ON csb.business_id = cb.id AND cb.status =1
  67. WHERE
  68. csb.streaming_id=#{id}
  69. </select>
  70. <select id="selectList" parameterType="com.zhongzheng.modules.course.bo.CourseStreamingQueryBo" resultMap="CourseStreamingResultVo">
  71. SELECT
  72. cs.*,
  73. pv.mp4 AS polyv_url
  74. FROM
  75. course_streaming cs
  76. LEFT JOIN course_streaming_business csb ON cs.id = csb.streaming_id
  77. LEFT JOIN polyv_video pv ON cs.polyv_id = pv.polyv_id
  78. WHERE
  79. 1 = 1
  80. <if test="businessId != null and businessId.size()!=0 ">
  81. AND csb.business_id in
  82. <foreach collection="businessId" item="item" index="index" open="(" close=")" separator=",">
  83. #{item}
  84. </foreach>
  85. </if>
  86. <if test="educationTypeId != null and educationTypeId != ''">
  87. AND csb.education_type_id = #{educationTypeId}
  88. </if>
  89. <if test="streamingAddressType != null and streamingAddressType != ''">
  90. AND cs.streaming_address_type = #{streamingAddressType}
  91. </if>
  92. <if test="streamingType != null and streamingType != ''">
  93. AND cs.streaming_type = #{streamingType}
  94. </if>
  95. <if test="streamingName != null and streamingName != ''">
  96. AND cs.streaming_name like concat('%', #{streamingName}, '%')
  97. </if>
  98. <if test="recordingVideoId != null and recordingVideoId != ''">
  99. AND cs.recording_video_id = #{recordingVideoId}
  100. </if>
  101. <if test="status != null and status.size()!=0 ">
  102. AND cs.status in
  103. <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
  104. #{item}
  105. </foreach>
  106. </if>
  107. GROUP BY
  108. cs.id
  109. ORDER BY cs.id DESC
  110. </select>
  111. </mapper>