CourseSectionMapper.xml 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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.CourseSectionMapper">
  6. <resultMap type="com.zhongzheng.modules.course.domain.CourseSection" id="CourseSectionResult">
  7. <result property="sectionId" column="section_id"/>
  8. <result property="name" column="name"/>
  9. <result property="sort" column="sort"/>
  10. <result property="createTime" column="create_time"/>
  11. <result property="updateTime" column="update_time"/>
  12. <result property="prefixName" column="prefix_name"/>
  13. <result property="status" column="status"/>
  14. <result property="sectionType" column="section_type"/>
  15. <result property="publishStatus" column="publish_status"/>
  16. <result property="liveUrl" column="live_url"/>
  17. <result property="liveStartTime" column="live_start_time"/>
  18. <result property="liveEndTime" column="live_end_time"/>
  19. <result property="liveDuration" column="live_duration"/>
  20. <result property="recordingUrl" column="recording_url"/>
  21. <result property="recordingDuration" column="recording_duration"/>
  22. <result property="coverUrl" column="cover_url"/>
  23. <result property="code" column="code"/>
  24. </resultMap>
  25. <resultMap type="com.zhongzheng.modules.course.vo.CourseSectionVo" id="CourseSectionResultVo">
  26. <result property="sectionId" column="section_id"/>
  27. <result property="name" column="name"/>
  28. <result property="sort" column="sort"/>
  29. <result property="prefixName" column="prefix_name"/>
  30. <result property="status" column="status"/>
  31. <result property="sectionType" column="section_type"/>
  32. <result property="publishStatus" column="publish_status"/>
  33. <result property="liveUrl" column="live_url"/>
  34. <result property="liveStartTime" column="live_start_time"/>
  35. <result property="liveEndTime" column="live_end_time"/>
  36. <result property="liveDuration" column="live_duration"/>
  37. <result property="recordingUrl" column="recording_url"/>
  38. <result property="recordingDuration" column="recording_duration"/>
  39. <result property="coverUrl" column="cover_url"/>
  40. <result property="code" column="code"/>
  41. <collection property="businessList" javaType="java.util.List" resultMap="CourseStreamingBusinessResult"/>
  42. </resultMap>
  43. <resultMap type="com.zhongzheng.modules.course.domain.CourseStreamingBusiness" id="CourseStreamingBusinessResult">
  44. <result property="id" column="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="selectSectionList" parameterType="com.zhongzheng.modules.course.bo.CourseSectionQueryBo" resultMap="CourseSectionResultVo">
  54. SELECT
  55. c.*,
  56. csb.education_type_id,
  57. csb.id,
  58. csb.business_id,
  59. csb.subject_id,
  60. csb.project_id,
  61. cet.education_name,
  62. cpt.project_name,
  63. cb.business_name,
  64. cs.subject_name,
  65. ccs.chapter_id,
  66. cc.NAME AS chapter_name
  67. FROM
  68. course_section c
  69. LEFT JOIN course_section_business csb ON c.section_id = csb.section_id
  70. LEFT JOIN course_education_type cet ON csb.education_type_id = cet.id
  71. LEFT JOIN course_project_type cpt ON csb.project_id = cpt.id
  72. LEFT JOIN course_business cb ON csb.business_id = cb.id
  73. LEFT JOIN course_subject cs ON csb.subject_id = cs.id
  74. LEFT JOIN course_chapter_section ccs ON csb.id = ccs.section_id
  75. LEFT JOIN course_chapter cc ON ccs.chapter_id = cc.chapter_id
  76. </select>
  77. </mapper>