|
@@ -27,6 +27,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="durationTime" column="duration_time"/>
|
|
|
</resultMap>
|
|
|
|
|
|
+ <resultMap type="com.zhongzheng.modules.course.vo.CourseUserChapterSectionVo" id="CourseUserChapterSectionVo">
|
|
|
+ <result property="typeId" column="type_id"/>
|
|
|
+ <result property="chapterId" column="chapter_id"/>
|
|
|
+ <result property="sort" column="c_sort"/>
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="type" column="type"/>
|
|
|
+
|
|
|
+ <result property="code" column="code"/>
|
|
|
+ <result property="name" column="name"/>
|
|
|
+ <result property="prefixName" column="prefix_name"/>
|
|
|
+ <result property="status" column="status"/>
|
|
|
+ <result property="sectionType" column="section_type"/>
|
|
|
+ <result property="publishStatus" column="publish_status"/>
|
|
|
+ <result property="durationTime" column="duration_time"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
|
|
|
<select id="getListById" parameterType="Long" resultMap="CourseChapterSectionResultVo">
|
|
|
SELECT
|
|
@@ -61,6 +77,53 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
c_sort DESC
|
|
|
</select>
|
|
|
|
|
|
+ <select id="sectionList" parameterType="com.zhongzheng.modules.course.bo.CourseMenuQueryBo" resultMap="CourseUserChapterSectionVo">
|
|
|
+ SELECT
|
|
|
+ cs.section_id as type_id,
|
|
|
+ #{gradeId} as grade_id,
|
|
|
+ <if test="moduleId != null ">
|
|
|
+ #{moduleId} as module_id,
|
|
|
+ </if>
|
|
|
+ <if test="moduleId == null ">
|
|
|
+ 0 as module_id,
|
|
|
+ </if>
|
|
|
+
|
|
|
+ cs.*,
|
|
|
+ ccs.sort as c_sort,
|
|
|
+ ccs.id,
|
|
|
+ ccs.chapter_id,
|
|
|
+ 1 as type,
|
|
|
+ cmc.module_id
|
|
|
+ FROM
|
|
|
+ course_chapter_section ccs
|
|
|
+ LEFT JOIN course_section cs ON ccs.section_id = cs.section_id
|
|
|
+ LEFT JOIN course_module_chapter cmc ON cmc.chapter_id = ccs.chapter_id
|
|
|
+ WHERE
|
|
|
+ cs.`status` = 1
|
|
|
+ AND ccs.chapter_id = #{chapterId}
|
|
|
+ ORDER BY
|
|
|
+ c_sort DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="examList" parameterType="com.zhongzheng.modules.course.bo.CourseMenuQueryBo" resultMap="CourseUserChapterSectionVo">
|
|
|
+ SELECT
|
|
|
+ e.*,
|
|
|
+ cme.course_id,
|
|
|
+ cme.module_id,
|
|
|
+ cme.chapter_id,
|
|
|
+ cme.section_id,
|
|
|
+ e.exam_name as name,
|
|
|
+ e.exam_id as type_id,
|
|
|
+ #{gradeId} as grade_id,
|
|
|
+ 2 as type
|
|
|
+ FROM
|
|
|
+ exam e
|
|
|
+ LEFT JOIN course_menu_exam cme ON cme.exam_id = e.exam_id
|
|
|
+ where 1=1
|
|
|
+ and cme.chapter_id = #{chapterId}
|
|
|
+ and cme.course_id = #{courseId}
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="getListTotalTime" parameterType="Long" resultType="java.lang.Long">
|
|
|
SELECT
|
|
|
IFNULL(sum( cs.duration_time ),0) AS duration_time
|
|
@@ -73,4 +136,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
|
|
|
|
|
|
+ <select id="rebuildCheck" parameterType="map" resultType="integer">
|
|
|
+ SELECT
|
|
|
+ COUNT(up.id)
|
|
|
+ FROM
|
|
|
+ user_period up
|
|
|
+ LEFT JOIN user_period_status ups ON up.id = ups.period_id
|
|
|
+ WHERE
|
|
|
+ up.grade_id =#{gradeId}
|
|
|
+ AND up.user_id = #{userId}
|
|
|
+ AND up.module_id= #{moduleId}
|
|
|
+ and up.chapter_id=#{chapterId}
|
|
|
+ and up.section_id=#{typeId}
|
|
|
+ and up.exam_id=#{examId}
|
|
|
+ AND ups.period_status =1
|
|
|
+ and (ups.`status` = 0 or ups.`status` = 3)
|
|
|
+ </select>
|
|
|
</mapper>
|