From 2fe81eab1b653ffd19da3c1876e201d9a10ed6f7 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Sat, 08 Jan 2022 16:33:09 +0800
Subject: [PATCH] 1.登录记录新增修改,页面刷新token 不能算入 2.登录统计接口新增,统计明细查询接口新增

---
 src/main/java/org/springblade/modules/exam/mapper/ExamScoreMapper.xml |   27 ++++++++++++++++-----------
 1 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/src/main/java/org/springblade/modules/exam/mapper/ExamScoreMapper.xml b/src/main/java/org/springblade/modules/exam/mapper/ExamScoreMapper.xml
index 4606748..40af7e9 100644
--- a/src/main/java/org/springblade/modules/exam/mapper/ExamScoreMapper.xml
+++ b/src/main/java/org/springblade/modules/exam/mapper/ExamScoreMapper.xml
@@ -290,7 +290,7 @@
         exam.*,
         user.jurisdiction,
         user.real_name securityName,
-        ke.exam_name examName,sis.enterpriseName trainingUnitName
+        ke.exam_name examName,sis.enterpriseName trainingUnitName,ke.start_time examStartTime
         FROM
         exam_score exam
         left join blade_user user on exam.user_id = user.id
@@ -302,20 +302,23 @@
         WHERE
         1 = 1
         and ke.exam_type = 2
-        <if test="information.jurisdiction!=null and information.jurisdiction!='' and information.jurisdiction!='1372091709474910209'">
-            and (sj.id = #{information.jurisdiction} or sj.parent_id = #{information.jurisdiction})
+        <if test="examScore.jurisdiction!=null and examScore.jurisdiction!='' and examScore.jurisdiction!='1372091709474910209'">
+            and (sj.id = #{examScore.jurisdiction} or sj.parent_id = #{examScore.jurisdiction})
         </if>
-        <if test="information.securityName!=null and information.securityName!=''">
-            AND user.real_name like concat('%',#{information.securityName},'%')
+        <if test="examScore.securityName!=null and examScore.securityName!=''">
+            AND user.real_name like concat('%',#{examScore.securityName},'%')
         </if>
-        <if test="information.trainingUnitName!=null and information.trainingUnitName!=''">
-            AND sis.enterpriseName like concat('%',#{information.trainingUnitName},'%')
+        <if test="examScore.trainingUnitName!=null and examScore.trainingUnitName!=''">
+            AND sis.enterpriseName like concat('%',#{examScore.trainingUnitName},'%')
         </if>
-        <if test="information.deptid!=null and information.deptid!=''">
-            AND user.dept_id = #{information.deptid}
+        <if test="examScore.deptId!=null and examScore.deptId!=''">
+            AND user.dept_id = #{examScore.deptId}
         </if>
-        <if test="information.qualified!=null">
-            AND exam.qualified = #{information.qualified}
+        <if test="examScore.month!=null and examScore.month!=''">
+            AND date_format(ke.start_time,'%Y-%m') = #{examScore.month}
+        </if>
+        <if test="examScore.qualified!=null">
+            AND exam.qualified = #{examScore.qualified}
         </if>
     </select>
 
@@ -460,6 +463,7 @@
             WHERE
                 qualified = 0
                 and training_unit_id = #{information.departmentid}
+                and YEAR ( ke.start_time ) = YEAR ( now() )
                 <if test="information.deptid!=null and information.deptid!=''">
                     and bu.dept_id = #{information.deptid}
                 </if>
@@ -485,6 +489,7 @@
             WHERE
                 qualified = 1
                 and training_unit_id = #{information.departmentid}
+                and YEAR ( ke.start_time ) = YEAR ( now() )
                 <if test="information.deptid!=null and information.deptid!=''">
                     and bu.dept_id = #{information.deptid}
                 </if>

--
Gitblit v1.9.3