From 84b63179040166b3ab06419c4d45e7cec64c9440 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期一, 01 七月 2024 17:14:26 +0800 Subject: [PATCH] mq消息 --- src/main/resources/mapper/ExamPaperScoreMapper.xml | 95 ++++++++++++++++++++++++++++------------------- 1 files changed, 56 insertions(+), 39 deletions(-) diff --git a/src/main/resources/mapper/ExamPaperScoreMapper.xml b/src/main/resources/mapper/ExamPaperScoreMapper.xml index e96bfef..15585f9 100644 --- a/src/main/resources/mapper/ExamPaperScoreMapper.xml +++ b/src/main/resources/mapper/ExamPaperScoreMapper.xml @@ -3,37 +3,54 @@ <mapper namespace="com.ycl.jxkg.mapper.ExamPaperScoreMapper"> <resultMap id="BaseResultMap" type="com.ycl.jxkg.domain.entity.ExamPaperScore"> <id column="id" jdbcType="INTEGER" property="id"/> - <result column="exam_paper_id" jdbcType="INTEGER" property="examPaperId"/> - <result column="paper_name" jdbcType="VARCHAR" property="paperName"/> + <result column="exam_id" jdbcType="INTEGER" property="examId"/> + <result column="exam_name" jdbcType="VARCHAR" property="examName"/> <result column="paper_type" jdbcType="INTEGER" property="paperType"/> - <result column="subject_id" jdbcType="INTEGER" property="subjectId"/> - <result column="system_score" jdbcType="INTEGER" property="systemScore"/> - <result column="user_score" jdbcType="INTEGER" property="userScore"/> - <result column="paper_score" jdbcType="INTEGER" property="paperScore"/> + <result column="score" jdbcType="INTEGER" property="score"/> + <result column="total_score" jdbcType="INTEGER" property="totalScore"/> <result column="question_correct" jdbcType="INTEGER" property="questionCorrect"/> <result column="question_count" jdbcType="INTEGER" property="questionCount"/> <result column="do_time" jdbcType="INTEGER" property="doTime"/> <result column="status" jdbcType="INTEGER" property="status"/> - <result column="create_user" jdbcType="INTEGER" property="createUser"/> + <result column="user_id" jdbcType="INTEGER" property="userId"/> + <result column="judge_user" jdbcType="INTEGER" property="judgeUser"/> <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> - <result column="task_exam_id" jdbcType="INTEGER" property="taskExamId"/> + <result column="submit_time" jdbcType="TIMESTAMP" property="submitTime"/> + <result column="exam_id" jdbcType="INTEGER" property="examId"/> + <result column="exam_name" jdbcType="INTEGER" property="examName"/> + <result column="paper_content" jdbcType="INTEGER" property="paperContent"/> </resultMap> <sql id="Base_Column_List"> - id - , exam_paper_id, paper_name, paper_type, subject_id, system_score, user_score, - paper_score, question_correct, question_count, do_time, status, create_user, create_time, - task_exam_id + id, + exam_id, + exam_name, + paper_id, + paper_type, + score, + total_score, + question_correct, + question_count, + do_time, + status, + user_id, + judge_user, + submit_time, + paper_content, + navbar, + judge_time, + deleted </sql> - <select id="studentPage" resultMap="BaseResultMap" - parameterType="com.ycl.jxkg.domain.vo.student.exampaper.ExamPaperAnswerPageVO"> + <select id="studentPage" resultType="com.ycl.jxkg.domain.vo.student.exampaper.ExamPaperAnswerPageResponseVO"> SELECT - <include refid="Base_Column_List"/> - FROM t_exam_paper_answer + a.*, + ep.name as paperName + FROM t_exam_paper_score a + INNER JOIN t_exam_paper ep ON ep.id = paper_id AND ep.deleted = 0 <where> - and create_user = #{createUser} - <if test="subjectId != null"> - and subject_id = #{subjectId} + and user_id = #{createUser} + <if test="examName != null and examName != ''"> + and INSTR(exam_name, #{examName}) </if> </where> </select> @@ -41,17 +58,19 @@ <select id="selectAllCount" resultType="java.lang.Integer"> SELECT count(*) - from t_exam_paper_answer + from t_exam_paper_score </select> + <select id="selectAllQuestionCount" resultType="java.lang.Integer"> + SELECT sum(question_count) + from t_exam_paper_score + </select> <select id="selectCountByDate" resultType="com.ycl.jxkg.domain.other.KeyValue"> SELECT create_time as name, COUNT(create_time) as value - from - ( - SELECT DATE_FORMAT(create_time, '%Y-%m-%d') as create_time from t_exam_paper_answer - WHERE create_time between #{startTime} and #{endTime} - ) a + from (SELECT DATE_FORMAT(create_time, '%Y-%m-%d') as create_time + from t_exam_paper_score + WHERE create_time between #{startTime} and #{endTime}) a GROUP BY create_time </select> @@ -59,22 +78,20 @@ <select id="getByPidUid" resultMap="BaseResultMap"> select <include refid="Base_Column_List"/> - from t_exam_paper_answer - where exam_paper_id = #{pid} and create_user=#{uid} + from t_exam_paper_score + where paper_id = #{pid} and user_id=#{uid} limit 1 </select> <select id="adminPage" resultType="com.ycl.jxkg.domain.vo.student.exampaper.ExamPaperAnswerPageResponseVO"> SELECT - a.id , exam_paper_id, paper_name, paper_type, system_score, user_score, paper_score, - question_correct, question_count, do_time, a.status, create_user, a.create_time, b.real_name AS userName - FROM t_exam_paper_answer a - LEFT JOIN t_user b ON a.create_user = b.id + a.*, b.real_name AS userName, c.name as paperName + FROM t_exam_paper_score a + INNER JOIN t_user b ON a.user_id = b.id AND b.deleted = 0 + INNER JOIN t_exam_paper c ON a.paper_id = c.id AND c.deleted = 0 <where> - <if test="examPaperId != null"> - AND exam_paper_id = #{examPaperId} - </if> + exam_id = #{examId} <if test="userName != null and userName != ''"> AND INSTR(b.real_name, #{userName}) </if> @@ -83,9 +100,9 @@ <select id="pageExamPaper" resultType="com.ycl.jxkg.domain.vo.student.exampaper.ExamPaperAnswerPageResponseVO"> SELECT - a.id, + t.id, a.name AS paperName, - a.score AS systemScore, + a.score AS totalScore, a.num as questionCount, a.subject_id, a.paper_type, @@ -97,9 +114,9 @@ t.exam_name FROM t_exam_paper a INNER JOIN t_exam t ON a.id = t.exam_paper_id AND t.deleted = 0 - LEFT JOIN t_subject b ON a.subject_id = b.id - LEFT JOIN t_user c ON t.teacher_id = c.id - LEFT JOIN t_exam_paper_answer d ON a.id = d.exam_paper_id + LEFT JOIN t_subject b ON a.subject_id = b.id AND b.deleted = 0 + LEFT JOIN t_user c ON t.teacher_id = c.id AND c.deleted = 0 + LEFT JOIN t_exam_paper_score d ON t.id = d.exam_id LEFT JOIN t_exam_paper_classes e ON a.id = e.exam_paper_id LEFT JOIN t_classes_user f ON e.classes_id = f.classes_id <where> -- Gitblit v1.8.0