|
@@ -39,12 +39,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="durationTime" column="duration_time"/>
|
|
|
<result property="coverUrl" column="cover_url"/>
|
|
|
<result property="code" column="code"/>
|
|
|
- <collection property="businessList" javaType="java.util.List" resultMap="CourseSectionBusiness"/>
|
|
|
- <collection property="chapterList" javaType="java.util.List" resultMap="CourseChapterSectionListResult"/>
|
|
|
- <collection property="moduleList" javaType="java.util.List" resultMap="CourseModuleChapterListResult"/>
|
|
|
- <collection property="courseList" javaType="java.util.List" resultMap="CourseSectionListResult"/>
|
|
|
+ <collection property="businessList" column="section_id" select="findBusinessList"/>
|
|
|
+ <collection property="chapterList" column="section_id" select="findChapterList"/>
|
|
|
+ <!-- <collection property="moduleList" javaType="java.util.List" resultMap="CourseModuleChapterListResult"/>
|
|
|
+ <collection property="courseList" javaType="java.util.List" resultMap="CourseSectionListResult"/> -->
|
|
|
</resultMap>
|
|
|
|
|
|
+ <select id="findChapterList" resultMap="CourseChapterSectionListResult">
|
|
|
+ SELECT
|
|
|
+ ccs.chapter_id,
|
|
|
+ cc.NAME AS chapter_name
|
|
|
+ FROM
|
|
|
+ course_chapter_section ccs
|
|
|
+ LEFT JOIN course_chapter cc ON ccs.chapter_id = cc.chapter_id
|
|
|
+ WHERE
|
|
|
+ ccs.id =#{section_id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="findBusinessList" resultMap="CourseSectionBusiness">
|
|
|
+ SELECT
|
|
|
+ csb.education_type_id,
|
|
|
+ csb.id,
|
|
|
+ csb.business_id,
|
|
|
+ csb.subject_id,
|
|
|
+ csb.project_id,
|
|
|
+ cet.education_name,
|
|
|
+ cpt.project_name,
|
|
|
+ cb.business_name,
|
|
|
+ cs.subject_name
|
|
|
+ FROM
|
|
|
+ course_section_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
|
|
|
+ LEFT JOIN course_subject cs ON csb.subject_id = cs.id
|
|
|
+ WHERE
|
|
|
+ csb.section_id=#{section_id}
|
|
|
+ </select>
|
|
|
+
|
|
|
<resultMap type="com.zhongzheng.modules.course.domain.CourseSectionBusiness" id="CourseSectionBusiness">
|
|
|
<result property="id" column="id"/>
|
|
|
<result property="subjectId" column="subject_id"/>
|
|
@@ -75,27 +108,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="selectSectionList" parameterType="com.zhongzheng.modules.course.bo.CourseSectionQueryBo" resultMap="CourseSectionResultVo">
|
|
|
SELECT
|
|
|
- c.*,
|
|
|
- csb.education_type_id,
|
|
|
- csb.id,
|
|
|
- csb.business_id,
|
|
|
- csb.subject_id,
|
|
|
- csb.project_id,
|
|
|
- cet.education_name,
|
|
|
- cpt.project_name,
|
|
|
- cb.business_name,
|
|
|
- cs.subject_name,
|
|
|
- ccs.chapter_id,
|
|
|
- cc.NAME AS chapter_name
|
|
|
+ c.*
|
|
|
FROM
|
|
|
course_section c
|
|
|
- LEFT JOIN course_section_business csb ON c.section_id = csb.section_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
|
|
|
- LEFT JOIN course_subject cs ON csb.subject_id = cs.id
|
|
|
- LEFT JOIN course_chapter_section ccs ON csb.id = ccs.section_id
|
|
|
- LEFT JOIN course_chapter cc ON ccs.chapter_id = cc.chapter_id
|
|
|
+ LEFT JOIN course_section_business csb ON csb.section_id = c.section_id
|
|
|
WHERE
|
|
|
1 = 1
|
|
|
<if test="name != null and name != ''">
|
|
@@ -125,13 +141,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
-
|
|
|
+ GROUP BY
|
|
|
+ c.section_id
|
|
|
+ ORDER BY c.section_id DESC
|
|
|
</select>
|
|
|
|
|
|
|
|
|
<select id="selectSectionList_COUNT" resultType="Long">
|
|
|
SELECT
|
|
|
- count( DISTINCT c.section_id )
|
|
|
+ count(c.section_id )
|
|
|
FROM
|
|
|
course_section c
|
|
|
LEFT JOIN course_section_business csb ON c.section_id = csb.section_id
|
|
@@ -164,5 +182,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
+ GROUP BY
|
|
|
+ c.section_id
|
|
|
</select>
|
|
|
</mapper>
|