From 497df0adf57c8a076596fa763cdbe5a554b96b5b Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Sat, 25 Dec 2021 18:39:46 +0800
Subject: [PATCH] 新增分公司的总公司工商信息管理

---
 src/main/java/org/springblade/modules/exam/mapper/ExamScoreMapper.xml |   27 ++++++++++++++++++++++++---
 1 files changed, 24 insertions(+), 3 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 9645a24..ab7e0d6 100644
--- a/src/main/java/org/springblade/modules/exam/mapper/ExamScoreMapper.xml
+++ b/src/main/java/org/springblade/modules/exam/mapper/ExamScoreMapper.xml
@@ -64,7 +64,7 @@
     </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,
@@ -72,7 +72,8 @@
             ke.exam_name examName,
             str.is_exam isExam,
             bu.real_name securityName,company,bu.account,bu.sex,bu.paper_time paperTime,bu.securitynumber securityNumber,bu.avatar,
-            bd.dept_name companyName from
+            bd.dept_name companyName,bu.user_type isPaper
+        from
             exam_score es
         left join
         ksxt_exam ke
@@ -120,6 +121,15 @@
         <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>
@@ -135,7 +145,12 @@
         <if test="examScore.examDate!=null  and examScore.examDate!=''">
             and date_format(ke.start_time,'%Y-%m-%d') = #{examScore.examDate}
         </if>
-        order by es.id desc
+        <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>
 
     <!--考试成绩详情信息-->
@@ -368,6 +383,12 @@
         <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},'%')
         </if>

--
Gitblit v1.9.3