From 9a3284f88a52411db022edc686390c0dd8a1823e Mon Sep 17 00:00:00 2001 From: 17808 <1780814303@qq.com> Date: 星期三, 01 十一月 2023 15:13:58 +0800 Subject: [PATCH] 成绩统计后端 --- src/main/resources/mapper/ExamPaperMapper.xml | 32 +++++++++++++++++++++++++++----- 1 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/main/resources/mapper/ExamPaperMapper.xml b/src/main/resources/mapper/ExamPaperMapper.xml index 44d642e..c116640 100644 --- a/src/main/resources/mapper/ExamPaperMapper.xml +++ b/src/main/resources/mapper/ExamPaperMapper.xml @@ -271,10 +271,8 @@ FROM t_exam_paper e LEFT JOIN t_exam_paper_department s on s.exam_paper_id = e.id <where> - and e.deleted=0 and s.deleted = 0 + and e.deleted=0 and e.task_exam_id is null - and s.department_id = - #{level} and e.paper_type=#{paperType} </where> group by e.id @@ -325,6 +323,11 @@ </if> <if test="examPaperType == 3 "> </if> + <foreach item="examPaperType" collection="examPaperType"> + <if test="examPaperType == 4 "> + and #{dateTime} between e.limit_start_time and e.limit_end_time + </if> + </foreach> <if test="examPaperType == 4 "> and #{dateTime} between e.limit_start_time and e.limit_end_time </if> @@ -335,9 +338,21 @@ SELECT e.id,e.name,e.limit_start_time,e.limit_end_time FROM t_exam_paper e LEFT JOIN t_exam_paper_user u on u.exam_paper_id = e.id - where + <where> e.deleted=0 and u.deleted = 0 and e.type = 0 - and u.user_id = #{userId} ORDER BY e.id desc ) t + and u.user_id = #{userId} + and e.paper_type in + <foreach item="examPaperType" collection="examPaperType" open="(" separator="," + close=")"> + #{examPaperType} + </foreach> + <foreach item="examPaperType" collection="examPaperType"> + <if test="examPaperType == 4 "> + and #{dateTime} between e.limit_start_time and e.limit_end_time + </if> + </foreach> + </where> + ORDER BY e.id desc ) t </select> @@ -391,4 +406,11 @@ and deleted = 0 </select> + <select id="getPaperExcelById" resultType="com.mindskip.xzs.domain.vo.PaperExcelVO" parameterType="java.lang.Integer"> + select u.real_name as name,a.create_user as userId,a.user_score as userScore,a.paper_score as paperScore + from t_exam_paper_answer a + left join t_user u on u.id = a.create_user + where a.exam_paper_id = #{id} + </select> + </mapper> -- Gitblit v1.8.0