|
|
@@ -90,17 +90,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
cm.*,
|
|
|
count( ccs.section_id ) AS section_num,
|
|
|
count( DISTINCT cc.chapter_id ) AS chapter_num,
|
|
|
- COALESCE ( SUM( cs.duration_time ), 0 ) AS duration_time,
|
|
|
- cmb.education_type_id,
|
|
|
- cmb.subject_id,
|
|
|
- cmb.business_id
|
|
|
+ COALESCE ( SUM( cs.duration_time ), 0 ) AS duration_time
|
|
|
FROM
|
|
|
course_module cm
|
|
|
LEFT JOIN course_module_chapter cmc ON cm.module_id = cmc.module_id
|
|
|
LEFT JOIN course_chapter cc ON cmc.chapter_id = cc.chapter_id
|
|
|
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
|
|
|
- LEFT JOIN course_module_business cmb ON cmb.module_id = cm.module_id
|
|
|
WHERE
|
|
|
cm.STATUS !=- 1
|
|
|
GROUP BY
|
|
|
@@ -119,13 +115,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
AND c.publish_status = #{publishStatus}
|
|
|
</if>
|
|
|
<if test="educationTypeId != null and educationTypeId != ''">
|
|
|
- AND cmb.education_type_id = #{educationTypeId}
|
|
|
+ AND (select count(cmb.education_type_id) FROM course_module_business cmb where cmb.module_id = c.module_id and cmb.education_type_id = #{educationTypeId}) >0
|
|
|
</if>
|
|
|
<if test="subjectId != null and subjectId != ''">
|
|
|
- AND cmb.subject_id = #{subjectId}
|
|
|
+ AND (select count(cmb.subject_id) FROM course_module_business cmb where cmb.module_id = c.module_id and cmb.subject_id = #{subjectId})>0
|
|
|
</if>
|
|
|
<if test="businessId != null and businessId != ''">
|
|
|
- AND cmb.business_id = #{businessId}
|
|
|
+ AND (select count(cmb.business_id) FROM course_module_business cmb where cmb.module_id = c.module_id and cmb.business_id = #{businessId})>0
|
|
|
</if>
|
|
|
<if test="moduleName != null and moduleName != ''">
|
|
|
AND c.module_name like concat('%', #{moduleName}, '%')
|