From c8ebf3038d2a7f69d9eb40f5a276dc3fa826fa9b Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Tue, 10 Aug 2021 21:42:52 +0800
Subject: [PATCH] 报名接口修改,考试计算成绩接口修改,对比答案修改为对比所有题目

---
 src/main/java/org/springblade/modules/apply/mapper/ApplyMapper.xml |   84 ++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 81 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/springblade/modules/apply/mapper/ApplyMapper.xml b/src/main/java/org/springblade/modules/apply/mapper/ApplyMapper.xml
index 38f60b0..7b95dfd 100644
--- a/src/main/java/org/springblade/modules/apply/mapper/ApplyMapper.xml
+++ b/src/main/java/org/springblade/modules/apply/mapper/ApplyMapper.xml
@@ -7,7 +7,7 @@
         SELECT
             sa.id,sa.apply_status applyStatus,sa.user_id userId,sa.candidate_no candidateNo,apply_time,exam_id examId,
             ke.total_score paperScore,ke.exam_type examType,ke.start_time examTime,ke.exam_name examName,
-            bu.real_name name,sa.examination_type,sa.examination_mx,
+            bu.real_name realName,bu.is_apply isApply,
             bd.dept_name deptName,bu.cardid idCardNo,"保安证" applyCard
         FROM
             sys_apply sa
@@ -26,8 +26,10 @@
         WHERE
             1=1
             and is_exam = 1
-        <if test="apply.name!=null and  apply.name!=''">
-            and sa.name like concat('%', #{apply.name},'%')
+            and sa.apply_status = 2
+            and bu.is_apply = 1
+        <if test="apply.realName!=null and  apply.realName!=''">
+            and bu.real_name like concat('%', #{apply.realName},'%')
         </if>
         <if test="apply.deptName!=null and  apply.deptName!=''">
             and bd.dept_name like concat('%', #{apply.deptName},'%')
@@ -196,4 +198,80 @@
         and (apply_status = 1 or apply_status = 2)
         limit 1
     </select>
+
+    <!--查询人员是否已经报名-->
+    <select id="getSecurityApplyInfo" resultType="org.springblade.modules.apply.entity.Apply">
+        select * from sys_apply
+        where 1=1
+        and is_exam = 1
+        and user_id = #{apply.userId}
+        and apply_status = 2
+        limit 1
+    </select>
+
+    <!--查询报名人员未关联考试的ids集合-->
+    <select id="getApplyIds" resultType="java.lang.Long">
+        SELECT
+        sa.id
+        FROM
+        sys_apply sa
+        left join
+        blade_user bu
+        on
+        sa.user_id = bu.id
+        WHERE
+        1=1
+        and is_exam = 1
+        and sa.apply_status = 2
+        and bu.is_apply = 1
+        and sa.exam_id is null
+    </select>
+
+    <!--查询考试人数-->
+    <select id="getApplyDeatailNum" resultType="java.lang.Integer">
+        SELECT
+        count(*)
+        FROM
+        sys_apply sa
+        left join
+        blade_user bu
+        on
+        sa.user_id = bu.id
+        WHERE
+        1=1
+        and is_exam = 1
+        and sa.apply_status = 2
+        and bu.is_apply = 1
+        and sa.exam_id is not null
+    </select>
+
+    <!--查询已报名的的人信息集合-->
+    <select id="getApplyDetailList" resultType="org.springblade.modules.apply.vo.ApplyVO">
+        SELECT
+            sa.candidate_no candidateNo,sa.apply_time applyTime,
+            ke.exam_name examName,
+            bu.real_name realName,bu.cardid idCardNo,bu.sex,
+            bd.dept_name deptName,"保安证" applyCard
+        FROM
+        sys_apply sa
+        left join
+        blade_user bu
+        on
+        sa.user_id = bu.id
+        left join
+        ksxt_exam ke
+        on
+        ke.id = sa.exam_id
+        left join
+        blade_dept bd
+        on
+        bd.id = bu.dept_id
+        WHERE
+        1=1
+        and is_exam = 1
+        and sa.apply_status = 2
+        and bu.is_apply = 1
+        and sa.exam_id is not null
+    </select>
+
 </mapper>

--
Gitblit v1.9.3