From 55dd8a6e104190531b51402ad0be6eba0b7d6877 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期一, 01 七月 2024 17:14:56 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev

---
 src/main/resources/mapper/ExamPaperScoreMapper.xml |   57 ++++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 34 insertions(+), 23 deletions(-)

diff --git a/src/main/resources/mapper/ExamPaperScoreMapper.xml b/src/main/resources/mapper/ExamPaperScoreMapper.xml
index 15585f9..cc85278 100644
--- a/src/main/resources/mapper/ExamPaperScoreMapper.xml
+++ b/src/main/resources/mapper/ExamPaperScoreMapper.xml
@@ -2,23 +2,24 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <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_id" jdbcType="INTEGER" property="examId"/>
-        <result column="exam_name" jdbcType="VARCHAR" property="examName"/>
-        <result column="paper_type" jdbcType="INTEGER" property="paperType"/>
-        <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="user_id" jdbcType="INTEGER" property="userId"/>
-        <result column="judge_user" jdbcType="INTEGER" property="judgeUser"/>
-        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
-        <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"/>
+        <id column="id" property="id"/>
+        <result column="paper_id" property="examPaperId"/>
+        <result column="paper_name" property="paperName"/>
+        <result column="paper_type" property="paperType"/>
+        <result column="score" property="score"/>
+        <result column="total_score" property="totalScore"/>
+        <result column="question_correct" property="questionCorrect"/>
+        <result column="question_count" property="questionCount"/>
+        <result column="do_time" property="doTime"/>
+        <result column="status" property="status"/>
+        <result column="user_id" property="userId"/>
+        <result column="judge_user" property="judgeUser"/>
+        <result column="submit_time" property="submitTime"/>
+        <result column="judge_time" property="judgeTime"/>
+        <result column="exam_id" property="examId"/>
+        <result column="exam_name" property="examName"/>
+        <result column="paper_content" property="paperContent"/>
+        <result column="navbar" property="navbar"/>
     </resultMap>
     <sql id="Base_Column_List">
         id,
@@ -55,7 +56,15 @@
         </where>
     </select>
 
-
+    <select id="getByExamIdUserId" resultType="com.ycl.jxkg.domain.entity.ExamPaperScore">
+        SELECT
+        <include refid="Base_Column_List"/>
+        from t_exam_paper_score
+        <where>
+            and user_id = #{userId}
+            and exam_id = #{examId}
+        </where>
+    </select>
     <select id="selectAllCount" resultType="java.lang.Integer">
         SELECT count(*)
         from t_exam_paper_score
@@ -67,11 +76,13 @@
     </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_score
-              WHERE create_time between #{startTime} and #{endTime}) a
-        GROUP BY create_time
+        SELECT submit_time as name, sum(question_count) as value
+        from
+            (
+            SELECT question_count ,DATE_FORMAT(submit_time, '%Y-%m-%d') as submit_time from t_exam_paper_score
+            WHERE submit_time between #{startTime} and #{endTime}
+            ) a
+        GROUP BY submit_time
     </select>
 
 

--
Gitblit v1.8.0