From ff8b904fd730846fadd76fb94c7b9cbde4e134b3 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Mon, 27 Dec 2021 13:34:52 +0800
Subject: [PATCH] 上岗证已制证修改

---
 src/main/java/org/springblade/modules/exam/mapper/ExamScoreMapper.xml |   63 +++++++++++++++++++++++++------
 1 files changed, 51 insertions(+), 12 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 00ae3b2..ab7e0d6 100644
--- a/src/main/java/org/springblade/modules/exam/mapper/ExamScoreMapper.xml
+++ b/src/main/java/org/springblade/modules/exam/mapper/ExamScoreMapper.xml
@@ -6,7 +6,7 @@
     <select id="selectExamScorePage" resultType="org.springblade.modules.exam.vo.ExamScoreVO">
         SELECT
         es.id,es.theory_grade theoryGrade,ifnull(learn_grade,-1) learnGrade,es.user_id userId,es.exam_id examId,
-        es.exam_time examTime,all_grade allGrade,exam_end_time examEndTime,qualified,
+        es.exam_time examTime,all_grade allGrade,exam_end_time examEndTime,qualified,es.candidate_no candidateNo,
         ke.exam_name examName,
         sa.is_exam isExam,
         bu.real_name securityName,company,bu.account,
@@ -64,15 +64,16 @@
     </select>
 
 
-    <!--考试成绩分页信息-模拟考试-->
+    <!--考试成绩分页信息-培训考试-->
     <select id="selectTrainExamScorePage" resultType="org.springblade.modules.exam.vo.ExamScoreVO">
         SELECT
             es.id,es.theory_grade theoryGrade,ifnull(learn_grade,-1) learnGrade,es.user_id userId,es.exam_id examId,
-            es.exam_time examTime,all_grade allGrade,exam_end_time examEndTime,qualified,
+            es.exam_time examTime,all_grade allGrade,exam_end_time examEndTime,qualified,es.candidate_no candidateNo,
             ke.exam_name examName,
             str.is_exam isExam,
-            bu.real_name securityName,company,bu.account,
-            bd.dept_name companyName from
+            bu.real_name securityName,company,bu.account,bu.sex,bu.paper_time paperTime,bu.securitynumber securityNumber,bu.avatar,
+            bd.dept_name companyName,bu.user_type isPaper
+        from
             exam_score es
         left join
         ksxt_exam ke
@@ -92,7 +93,7 @@
         str.id = es.apply_id
         where
         1=1
-        and (str.is_exam = 2 or str.is_exam = 3)
+        and (str.is_exam = 2 or str.is_exam = 3 or str.is_exam = 4)
         <if test="examScore.examName!=null and  examScore.examName!=''">
             and ke.exam_name like concat('%', #{examScore.examName},'%')
         </if>
@@ -120,14 +121,35 @@
         <if test="examScore.examType!=null and  examScore.examType!=''">
             and ke.exam_type = #{examScore.examType}
         </if>
+        <if test="examScore.examType!=null and  examScore.examType!=''">
+            and ke.exam_type = #{examScore.examType}
+        </if>
+        <if test="examScore.isPaper==6">
+            and bu.user_type = #{examScore.isPaper}
+        </if>
+        <if test="examScore.isPaper==7">
+            and (bu.user_type = #{examScore.isPaper} or bu.user_type is null)
+        </if>
+        <if test="examScore.isAvatar==1">
+            and bu.avatar is not null and bu.avatar!=""
+        </if>
+        <if test="examScore.isAvatar==2">
+            and (bu.avatar is null or bu.avatar="")
+        </if>
         <if test="examScore.candidateNo!=null and  examScore.candidateNo!=''">
             and es.candidate_no = #{examScore.candidateNo}
         </if>
         <if test="examScore.qualified!=null">
             and es.qualified = #{examScore.qualified}
         </if>
-        <if test="examScore.examDate!=null">
-            and date_format(es.exam_time,'%Y-%m-%d') = #{examScore.examDate}
+        <if test="examScore.examDate!=null  and examScore.examDate!=''">
+            and date_format(ke.start_time,'%Y-%m-%d') = #{examScore.examDate}
+        </if>
+        <if test="examScore.sortName!=null and examScore.sortName!=''">
+            ORDER BY es.${examScore.sortName} ${examScore.sort},es.id desc
+        </if>
+        <if test="examScore.sortName==null or examScore.sortName==''">
+            order by es.id desc
         </if>
     </select>
 
@@ -249,9 +271,13 @@
             blade_user bu
         on
             bu.id = es.user_id
+        left join
+            ksxt_exam ke
+        on
+            ke.id = es.exam_id
         where
             bu.cardid = #{idCardNo}
-            and es.exam_id = #{examId}
+            and DATE_FORMAT(ke.start_time,'%Y-%m-%d') = #{startTime}
     </select>
 
     <!--修改成绩信息-->
@@ -324,7 +350,7 @@
         SELECT
         ke.exam_name examName,bu.real_name securityName,bu.cardid idCardNo,
         bd.dept_name companyName,
-        es.exam_time examTime,exam_end_time examEndTime,
+        es.exam_time examTime,exam_end_time examEndTime,es.candidate_no candidateNo,
         es.theory_grade theoryGrade,es.learn_grade learnGrade,
         all_grade allGrade
          from
@@ -347,7 +373,7 @@
         str.id = es.apply_id
         where
         1=1
-        and (str.is_exam = 2 or str.is_exam = 3)
+        and (str.is_exam = 2 or str.is_exam = 3 or str.is_exam = 4)
         <if test="examScore.examName!=null and  examScore.examName!=''">
             and ke.exam_name like concat('%', #{examScore.examName},'%')
         </if>
@@ -356,6 +382,12 @@
         </if>
         <if test="examScore.securityName!=null and  examScore.securityName!=''">
             and bu.real_name like concat('%', #{examScore.securityName},'%')
+        </if>
+        <if test="examScore.isPaper==6">
+            and bu.user_type = #{examScore.isPaper}
+        </if>
+        <if test="examScore.isPaper==7">
+            and (bu.user_type = #{examScore.isPaper} or bu.user_type is null)
         </if>
         <if test="examScore.account!=null and  examScore.account!=''">
             and bu.account like concat('%', #{examScore.account},'%')
@@ -372,6 +404,12 @@
         <if test="examScore.isExam!=null and  examScore.isExam!=''">
             and str.is_exam = #{examScore.isExam}
         </if>
+        <if test="examScore.isAvatar==1">
+            and bu.avatar is not null and bu.avatar!=""
+        </if>
+        <if test="examScore.isAvatar==2">
+            and (bu.avatar is null or bu.avatar="")
+        </if>
         <if test="examScore.examType!=null and  examScore.examType!=''">
             and ke.exam_type = #{examScore.examType}
         </if>
@@ -382,8 +420,9 @@
             and es.qualified = #{examScore.qualified}
         </if>
         <if test="examScore.examDate!=null and examScore.examDate!=''">
-            and date_format(es.exam_time,'%Y-%m-%d') = #{examScore.examDate}
+            and date_format(ke.start_time,'%Y-%m-%d') = #{examScore.examDate}
         </if>
+        order by es.id desc
     </select>
 
 

--
Gitblit v1.9.3