From 09135e31580c89fa86ba760904dca6d88f98c040 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期三, 15 五月 2024 15:40:52 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/main/resources/mapper/ExamPaperAnswerMapper.xml |   24 ++++++++----------------
 1 files changed, 8 insertions(+), 16 deletions(-)

diff --git a/src/main/resources/mapper/ExamPaperAnswerMapper.xml b/src/main/resources/mapper/ExamPaperAnswerMapper.xml
index d312ee9..a730052 100644
--- a/src/main/resources/mapper/ExamPaperAnswerMapper.xml
+++ b/src/main/resources/mapper/ExamPaperAnswerMapper.xml
@@ -395,12 +395,14 @@
     where a.create_time
   </select>
 
-  <select id="histogram" resultType="java.util.Map">
+  <select id="histogram" resultType="java.util.TreeMap">
     <![CDATA[
     SELECT
-    COUNT(CASE WHEN a.user_score < 60 THEN 1 END) AS scoreLeq60,
-    COUNT(CASE WHEN a.user_score >= 60 AND a.user_score < 80 THEN 1 END) AS score60To79,
-    COUNT(CASE WHEN a.user_score >= 80 AND a.user_score <= 100 THEN 1 END) AS score80To100,
+    COUNT(CASE WHEN a.user_score < 60 THEN 1 END) AS score0To59,
+    COUNT(CASE WHEN a.user_score >= 60 AND a.user_score < 70 THEN 1 END) AS score60To69,
+    COUNT(CASE WHEN a.user_score >= 70 AND a.user_score < 80 THEN 1 END) AS score70To79,
+    COUNT(CASE WHEN a.user_score >= 80 AND a.user_score < 90 THEN 1 END) AS score80To89,
+    COUNT(CASE WHEN a.user_score >= 90 AND a.user_score <= 100 THEN 1 END) AS score90To100,
     COUNT(CASE WHEN TIMESTAMPDIFF(YEAR, c.birth_day, CURDATE()) BETWEEN 0 AND 19 THEN 1 END) AS age0To19,
     COUNT(CASE WHEN TIMESTAMPDIFF(YEAR, c.birth_day, CURDATE()) BETWEEN 20 AND 29 THEN 1 END) AS age20To29,
     COUNT(CASE WHEN TIMESTAMPDIFF(YEAR, c.birth_day, CURDATE()) BETWEEN 30 AND 39 THEN 1 END) AS age30To39,
@@ -422,22 +424,12 @@
     </if>
   </select>
 
-  <select id="pieChart" resultType="java.util.Map">
+  <select id="pieChart" resultType="java.util.TreeMap">
     SELECT
-    <!-- 搴旇鍙傚姞鑰冭瘯鐨勪汉鏁� -->
-    COUNT(DISTINCT a.user_id) AS totalExpected,
     <!-- 鍙傚姞鑰冭瘯鐨勪汉鏁� -->
     COUNT(DISTINCT c.create_user) AS totalAttended,
-    <!-- 鍙傚姞鑰冭瘯鐨勭櫨鍒嗘瘮锛屽苟鍥涜垗浜斿叆淇濈暀涓や綅灏忔暟 -->
-    ROUND((COUNT(DISTINCT c.create_user) * 100.0 / NULLIF(COUNT(DISTINCT a.user_id), 0)), 2) AS percentageAttended,
-    <!-- 鍙傚姞鑰冭瘯鐨勫皬鏁� -->
-    COUNT(DISTINCT c.create_user) / NULLIF(COUNT(DISTINCT a.user_id), 0) as attended,
     <!-- 缂鸿�冪殑浜烘暟 -->
-    COUNT(DISTINCT a.user_id) - COUNT(DISTINCT c.create_user) AS totalAbsent,
-    <!-- 缂鸿�冪殑鐧惧垎姣旓紝骞跺洓鑸嶄簲鍏ヤ繚鐣欎袱浣嶅皬鏁� -->
-    ROUND(((COUNT(DISTINCT a.user_id) - COUNT(DISTINCT c.create_user)) * 100.0 / COUNT(DISTINCT a.user_id)), 2) AS percentageAbsent,
-    <!-- 缂鸿�冪殑灏忔暟 -->
-    ((COUNT(DISTINCT a.user_id) - COUNT(DISTINCT c.create_user)) / COUNT(DISTINCT a.user_id)) as absent
+    COUNT(DISTINCT a.user_id) - COUNT(DISTINCT c.create_user) AS totalAbsent
     FROM
     t_exam_paper_user a
     INNER JOIN t_exam_paper b ON a.exam_paper_id = b.id

--
Gitblit v1.8.0