|
@@ -135,7 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
WHERE
|
|
|
ubr.user_id = #{userId}
|
|
|
AND ubr.exam_id = e.exam_id
|
|
|
- AND grade_id = #{gradeId}) do_num,
|
|
|
+ AND grade_id = #{gradeId} and `type` = 1) do_num,
|
|
|
e.exam_id as type_id,
|
|
|
#{gradeId} as grade_id,
|
|
|
2 as type,
|
|
@@ -149,7 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
any_value ( ubr.performance ) performance,
|
|
|
ubr.exam_id
|
|
|
FROM
|
|
|
- ( SELECT record_id, report_status, exam_id, performance FROM user_bank_record WHERE user_id = #{userId} AND grade_id = #{gradeId} ORDER BY record_id DESC LIMIT 9999 ) ubr
|
|
|
+ ( SELECT record_id, report_status, exam_id, performance FROM user_bank_record WHERE user_id = #{userId} AND grade_id = #{gradeId} and `type` = 1 ORDER BY record_id DESC LIMIT 9999 ) ubr
|
|
|
GROUP BY
|
|
|
ubr.exam_id)ubr1 on e.exam_id = ubr1.exam_id
|
|
|
where 1=1
|
|
@@ -161,6 +161,48 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+ <select id="sectionExamList" 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.answer_num,
|
|
|
+ (SELECT
|
|
|
+ count(*)
|
|
|
+ FROM
|
|
|
+ user_bank_record ubr
|
|
|
+ WHERE
|
|
|
+ ubr.user_id = #{userId}
|
|
|
+ AND ubr.exam_id = e.exam_id
|
|
|
+ AND grade_id = #{gradeId} and `type` = 2) 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.exam_id
|
|
|
+ FROM
|
|
|
+ ( SELECT record_id, report_status, exam_id, performance FROM user_bank_record WHERE user_id = #{userId} AND grade_id = #{gradeId} and `type` = 2 ORDER BY record_id DESC LIMIT 9999 ) ubr
|
|
|
+ GROUP BY
|
|
|
+ ubr.exam_id)ubr1 on e.exam_id = ubr1.exam_id
|
|
|
+ where 1=1
|
|
|
+ and cme.chapter_id = #{chapterId}
|
|
|
+ and cme.course_id = #{courseId}
|
|
|
+ and cme.type = 2
|
|
|
+ <if test="moduleId == null ">
|
|
|
+ and cme.module_id = #{moduleId}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="getListTotalTime" parameterType="Long" resultType="java.lang.Long">
|
|
|
SELECT
|
|
|
IFNULL(sum( cs.duration_time ),0) AS duration_time
|