|
@@ -26,6 +26,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="coverUrl" column="cover_url"/>
|
|
|
<result property="publishStatus" column="publish_status"/>
|
|
|
<result property="code" column="code"/>
|
|
|
+ <result property="sectionNum" column="section_num"/>
|
|
|
+ <result property="durationTime" column="duration_time"/>
|
|
|
<collection property="businessList" javaType="java.util.List" resultMap="CourseChapterBusiness"/>
|
|
|
<collection property="moduleList" javaType="java.util.List" resultMap="CourseModuleChapterListResult"/>
|
|
|
<collection property="courseList" javaType="java.util.List" resultMap="CourseSectionListResult"/>
|
|
@@ -56,33 +58,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="selectList" parameterType="com.zhongzheng.modules.course.bo.CourseChapterQueryBo" resultMap="CourseChapterResultVo">
|
|
|
SELECT
|
|
|
- c.*,
|
|
|
- ccb.education_type_id,
|
|
|
- ccb.id,
|
|
|
- ccb.business_id,
|
|
|
- ccb.subject_id,
|
|
|
- ccb.project_id,
|
|
|
- cet.education_name,
|
|
|
- cpt.project_name,
|
|
|
- cb.business_name,
|
|
|
- cs.subject_name,
|
|
|
- cmc.module_id,
|
|
|
- cm.module_name,
|
|
|
- m.course_id,
|
|
|
- co.course_name
|
|
|
+ c.*,
|
|
|
+ ccb.education_type_id,
|
|
|
+ ccb.id,
|
|
|
+ ccb.business_id,
|
|
|
+ ccb.subject_id,
|
|
|
+ ccb.project_id,
|
|
|
+ cet.education_name,
|
|
|
+ cpt.project_name,
|
|
|
+ cb.business_name,
|
|
|
+ cs.subject_name,
|
|
|
+ cmc.module_id,
|
|
|
+ cm.module_name,
|
|
|
+ m.course_id,
|
|
|
+ co.course_name
|
|
|
FROM
|
|
|
- course_chapter c
|
|
|
- LEFT JOIN course_chapter_business ccb ON c.chapter_id = ccb.chapter_id
|
|
|
- LEFT JOIN course_education_type cet ON ccb.education_type_id = cet.id
|
|
|
- LEFT JOIN course_project_type cpt ON ccb.project_id = cpt.id
|
|
|
- LEFT JOIN course_business cb ON ccb.business_id = cb.id
|
|
|
- LEFT JOIN course_subject cs ON ccb.subject_id = cs.id
|
|
|
- LEFT JOIN course_module_chapter cmc ON c.chapter_id = cmc.chapter_id
|
|
|
- LEFT JOIN course_module cm ON cmc.module_id = cm.module_id
|
|
|
- LEFT JOIN ( SELECT course_id, menu_id FROM course_menu WHERE type = 3 AND STATUS = 1 ) m ON c.chapter_id = m.menu_id
|
|
|
- LEFT JOIN course co ON m.course_id = co.course_id
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ cc.*,
|
|
|
+ count( ccs.section_id ) AS section_num,
|
|
|
+ COALESCE ( SUM( cs.duration_time ), 0 ) AS duration_time
|
|
|
+ FROM
|
|
|
+ course_chapter cc
|
|
|
+ LEFT JOIN course_chapter_section ccs ON cc.chapter_id = ccs.chapter_id
|
|
|
+ LEFT JOIN course_section cs ON ccs.section_id = cs.section_id
|
|
|
+ GROUP BY
|
|
|
+ cc.chapter_id
|
|
|
+ ) c
|
|
|
+ LEFT JOIN course_chapter_business ccb ON c.chapter_id = ccb.chapter_id
|
|
|
+ LEFT JOIN course_education_type cet ON ccb.education_type_id = cet.id
|
|
|
+ LEFT JOIN course_project_type cpt ON ccb.project_id = cpt.id
|
|
|
+ LEFT JOIN course_business cb ON ccb.business_id = cb.id
|
|
|
+ LEFT JOIN course_subject cs ON ccb.subject_id = cs.id
|
|
|
+ LEFT JOIN course_module_chapter cmc ON c.chapter_id = cmc.chapter_id
|
|
|
+ LEFT JOIN course_module cm ON cmc.module_id = cm.module_id
|
|
|
+ LEFT JOIN ( SELECT course_id, menu_id FROM course_menu WHERE type = 3 AND STATUS = 1 ) m ON c.chapter_id = m.menu_id
|
|
|
+ LEFT JOIN course co ON m.course_id = co.course_id
|
|
|
WHERE
|
|
|
- 1 = 1
|
|
|
+ 1 = 1
|
|
|
<if test="status != null and status.size()!=0 ">
|
|
|
AND c.status in
|
|
|
<foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
|