|
@@ -37,6 +37,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="status" column="status"/>
|
|
|
<result property="publishStatus" column="publish_status"/>
|
|
|
<result property="courseId" column="course_id"/>
|
|
|
+
|
|
|
+ <result property="performance" column="performance"/>
|
|
|
+ <result property="reportStatus" column="report_status"/>
|
|
|
+ <result property="answerNum" column="answer_num"/>
|
|
|
+ <result property="doNum" column="do_num"/>
|
|
|
+ <result property="type" column="type"/>
|
|
|
+ <result property="typeId" column="type_id"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="getListById" parameterType="Long" resultMap="CourseModuleChapterResultVo">
|
|
@@ -62,7 +69,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
cmc.sort AS c_sort,
|
|
|
cmc.id,
|
|
|
cmc.module_id,
|
|
|
+ cmc.chapter_id as type_id,
|
|
|
#{gradeId} as grade_id,
|
|
|
+ 1 as type,
|
|
|
#{courseId} as course_id
|
|
|
FROM
|
|
|
course_module_chapter cmc
|
|
@@ -74,6 +83,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
cmc.sort
|
|
|
</select>
|
|
|
|
|
|
+ <select id="examList" parameterType="com.zhongzheng.modules.course.bo.CourseMenuQueryBo" resultMap="CourseUserModuleChapterVo">
|
|
|
+ SELECT
|
|
|
+ e.*,
|
|
|
+ cme.course_id,
|
|
|
+ cme.module_id,
|
|
|
+ cme.chapter_id,
|
|
|
+ cme.section_id,
|
|
|
+ e.exam_name as name,
|
|
|
+ e.answer_num,
|
|
|
+ (SELECT
|
|
|
+ count(*)
|
|
|
+ FROM
|
|
|
+ user_bank_record ubr
|
|
|
+ WHERE
|
|
|
+ ubr.user_id = #{userId}
|
|
|
+ AND ubr.module_exam_id = e.exam_id
|
|
|
+ AND grade_id = #{gradeId}) do_num,
|
|
|
+ e.exam_id as type_id,
|
|
|
+ #{gradeId} as grade_id,
|
|
|
+ 2 as type,
|
|
|
+ ubr1.report_status,
|
|
|
+ ubr1.performance
|
|
|
+ FROM
|
|
|
+ exam e
|
|
|
+ LEFT JOIN course_menu_exam cme ON cme.exam_id = e.exam_id
|
|
|
+ LEFT JOIN (SELECT
|
|
|
+ any_value ( ubr.report_status ) report_status,
|
|
|
+ any_value ( ubr.performance ) performance,
|
|
|
+ ubr.module_exam_id
|
|
|
+ FROM
|
|
|
+ ( SELECT record_id, report_status, module_exam_id, performance FROM user_bank_record WHERE user_id = #{userId} AND grade_id = #{gradeId} ORDER BY record_id DESC LIMIT 9999 ) ubr
|
|
|
+ GROUP BY
|
|
|
+ ubr.module_exam_id)ubr1 on e.exam_id = ubr1.module_exam_id
|
|
|
+ where 1=1
|
|
|
+ and cme.course_id = #{courseId}
|
|
|
+ and cme.type = 3
|
|
|
+ and cme.module_id = #{moduleId}
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="rebuildChapterCheck" parameterType="map" resultType="Integer">
|
|
|
SELECT
|
|
|
COUNT(up.id)
|