From 2bf92184d4584cac58b76b8d1ea0b3b0ff34b4fb Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期五, 24 五月 2024 13:46:30 +0800
Subject: [PATCH] fix:统计修改

---
 src/main/resources/mapper/UserMapper.xml |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/src/main/resources/mapper/UserMapper.xml b/src/main/resources/mapper/UserMapper.xml
index d7252e5..68d3dfc 100644
--- a/src/main/resources/mapper/UserMapper.xml
+++ b/src/main/resources/mapper/UserMapper.xml
@@ -23,7 +23,7 @@
   </resultMap>
   <sql id="Base_Column_List">
     id, user_uuid, user_name, password, real_name, age, sex, birth_day, user_level, phone,
-    role, status, image_path, create_time, modify_time, last_active_time, deleted, wx_open_id, `condition`, condition_detail
+    role, status, image_path, create_time, modify_time, last_active_time, deleted, wx_open_id, `condition`
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     select
@@ -469,11 +469,10 @@
   </update>
 
   <update id="setStatus">
-    UPDATE t_user
-    SET `condition`        = #{condition},
-        `condition_detail` = #{conditionDetail}
-    WHERE id = #{id}
-    AND deleted = 0
+      UPDATE t_user
+      SET `condition` = #{condition}
+      WHERE id = #{id}
+        AND deleted = 0
   </update>
 
     <update id="clearDeptAdmin">
@@ -554,4 +553,19 @@
         </if>
     </select>
 
+    <select id="getUserByExamByTemplateId" resultType="com.mindskip.xzs.domain.User" parameterType="com.mindskip.xzs.domain.ExamPaper">
+        <![CDATA[
+        SELECT DISTINCT
+        d.*
+        FROM
+        t_exam_templates a
+        INNER JOIN t_exam_templates_user_count b ON a.id = b.exam_templates_id and a.id = ${id}
+        LEFT JOIN t_exam_paper_answer c ON b.exam_paper_id = c.exam_paper_id AND c.create_user = b.user_id and invalid = 0
+        LEFT JOIN t_user d ON b.user_id = d.id
+        WHERE
+        ( c.id IS NULL OR ( user_score / paper_score ) < 0.6 )
+        AND b.user_id = #{createUser}
+        ]]>
+    </select>
+
 </mapper>

--
Gitblit v1.8.0