|
|
@@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<select id="selectCourseList" parameterType="com.zhongzheng.modules.course.bo.CourseQueryBo" resultMap="CourseResult">
|
|
|
SELECT rs.course_name,
|
|
|
rs.course_id,rs.status,sum(section_num) as section_num,count(chapter_id)
|
|
|
- as chapter_num,mc.category_name,sum(total_time) as duration from
|
|
|
+ as chapter_num,mc.category_name,mc.category_id,sum(total_time) as duration from
|
|
|
(SELECT c.*,count(cs.section_id) as section_num,cs.chapter_id,IFNULL(sum(cs.video_time),0) as total_time
|
|
|
FROM course c LEFT JOIN course_chapter cc on c.course_id = cc.course_id
|
|
|
LEFT JOIN course_section cs
|
|
|
@@ -36,17 +36,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
- <if test="courseName != null and courseName != ''">
|
|
|
- AND c.course_name like concat('%', #{courseName}, '%')
|
|
|
- </if>
|
|
|
- <if test="categoryId != null and categoryId != ''">
|
|
|
- AND c.category_id = #{categoryId}
|
|
|
- </if>
|
|
|
+ </if>
|
|
|
+ <if test="courseName != null and courseName != ''">
|
|
|
+ AND c.course_name like concat('%', #{courseName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="categoryId != null and categoryId != ''">
|
|
|
+ AND c.category_id = #{categoryId}
|
|
|
</if>
|
|
|
|
|
|
GROUP BY cs.chapter_id,c.course_id)rs LEFT JOIN major_category mc on rs.category_id = mc.category_id
|
|
|
GROUP BY course_id
|
|
|
-
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|