From 81dfe248054eaa3c2751ba32576f48598adcd04f Mon Sep 17 00:00:00 2001
From: qirong <2032486488@qq.com>
Date: 星期四, 17 八月 2023 17:19:00 +0800
Subject: [PATCH] 个人模拟修改

---
 src/main/resources/mapper/ExamPaperMapper.xml |   25 ++++++++++++++++++++-----
 1 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/src/main/resources/mapper/ExamPaperMapper.xml b/src/main/resources/mapper/ExamPaperMapper.xml
index 44d642e..08772a5 100644
--- a/src/main/resources/mapper/ExamPaperMapper.xml
+++ b/src/main/resources/mapper/ExamPaperMapper.xml
@@ -271,10 +271,8 @@
     FROM t_exam_paper e
     LEFT JOIN t_exam_paper_department s on s.exam_paper_id = e.id
     <where>
-      and e.deleted=0 and s.deleted = 0
+      and e.deleted=0
       and e.task_exam_id is null
-      and s.department_id =
-        #{level}
       and e.paper_type=#{paperType}
     </where>
     group by e.id
@@ -325,6 +323,11 @@
           </if>
           <if test="examPaperType == 3 ">
           </if>
+        <foreach item="examPaperType" collection="examPaperType">
+          <if test="examPaperType == 4 ">
+            and #{dateTime} between e.limit_start_time and e.limit_end_time
+          </if>
+        </foreach>
           <if test="examPaperType == 4 ">
               and #{dateTime} between e.limit_start_time and e.limit_end_time
           </if>
@@ -335,9 +338,21 @@
       SELECT e.id,e.name,e.limit_start_time,e.limit_end_time
       FROM t_exam_paper e
       LEFT JOIN t_exam_paper_user u on u.exam_paper_id = e.id
-      where
+      <where>
       e.deleted=0 and u.deleted = 0 and e.type = 0
-      and u.user_id = #{userId} ORDER BY e.id desc ) t
+      and u.user_id = #{userId}
+        and e.paper_type in
+        <foreach item="examPaperType" collection="examPaperType" open="(" separator=","
+                 close=")">
+          #{examPaperType}
+        </foreach>
+        <foreach item="examPaperType" collection="examPaperType">
+          <if test="examPaperType == 4 ">
+            and #{dateTime} between e.limit_start_time and e.limit_end_time
+          </if>
+        </foreach>
+      </where>
+      ORDER BY e.id desc ) t
   </select>
 
 

--
Gitblit v1.8.0