CourseStreamingMapper.xml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. </resultMap>
  23. <resultMap type="com.zhongzheng.modules.course.vo.CourseStreamingVo" id="CourseStreamingResultVo">
  24. <result property="id" column="id"/>
  25. <result property="streamingType" column="streaming_type"/>
  26. <result property="streamingName" column="streaming_name"/>
  27. <result property="code" column="code"/>
  28. <result property="liveChannelNumber" column="live_channel_number"/>
  29. <result property="livePushUrl" column="live_push_url"/>
  30. <result property="livePullUrl" column="live_pull_url"/>
  31. <result property="liveUrl" column="live_url"/>
  32. <result property="streamingAddressType" column="streaming_address_type"/>
  33. <result property="introduce" column="introduce"/>
  34. <result property="recordingVideoId" column="recording_video_id"/>
  35. <result property="playbackUrl" column="playback_url"/>
  36. <result property="status" column="status"/>
  37. <collection property="businessList" javaType="java.util.List" resultMap="CourseStreamingBusinessResult"/>
  38. </resultMap>
  39. <resultMap type="com.zhongzheng.modules.course.domain.CourseStreamingBusiness" id="CourseStreamingBusinessResult">
  40. <result property="id" column="join_id"/>
  41. <result property="streamingId" column="streaming_id"/>
  42. <result property="educationTypeId" column="education_type_id"/>
  43. <result property="businessId" column="business_id"/>
  44. <result property="projectId" column="project_id"/>
  45. <result property="educationName" column="education_name"/>
  46. <result property="projectName" column="project_name"/>
  47. <result property="businessName" column="business_name"/>
  48. </resultMap>
  49. <select id="selectList" parameterType="com.zhongzheng.modules.course.bo.CourseStreamingQueryBo" resultMap="CourseStreamingResultVo">
  50. SELECT
  51. cs.*,
  52. csb.education_type_id,
  53. csb.id as join_id,
  54. csb.business_id,
  55. csb.project_id,
  56. cet.education_name,
  57. cpt.project_name,
  58. cb.business_name
  59. FROM
  60. course_streaming cs
  61. LEFT JOIN course_streaming_business csb ON cs.id = csb.streaming_id
  62. LEFT JOIN course_education_type cet ON csb.education_type_id = cet.id
  63. LEFT JOIN course_project_type cpt ON csb.project_id = cpt.id
  64. LEFT JOIN course_business cb ON csb.business_id = cb.id
  65. WHERE
  66. 1 = 1
  67. <if test="businessId != null and businessId != ''">
  68. AND csb.business_id = #{businessId}
  69. </if>
  70. <if test="educationTypeId != null and educationTypeId != ''">
  71. AND csb.education_type_id = #{educationTypeId}
  72. </if>
  73. <if test="streamingAddressType != null and streamingAddressType != ''">
  74. AND cs.streaming_address_type = #{streamingAddressType}
  75. </if>
  76. <if test="streamingType != null and streamingType != ''">
  77. AND cs.streaming_type = #{streamingType}
  78. </if>
  79. <if test="streamingName != null and streamingName != ''">
  80. AND cs.streaming_name like concat('%', #{streamingName}, '%')
  81. </if>
  82. <if test="status != null and status.size()!=0 ">
  83. AND cs.status in
  84. <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
  85. #{item}
  86. </foreach>
  87. </if>
  88. </select>
  89. </mapper>