From 7fead3526920951ed8f68d0f9aaf23fe632158ae Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期四, 09 五月 2024 18:09:28 +0800
Subject: [PATCH] 学生端个人练习管理,todo删除、练习
---
src/main/resources/mapper/ExamTemplatesMapper.xml | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/src/main/resources/mapper/ExamTemplatesMapper.xml b/src/main/resources/mapper/ExamTemplatesMapper.xml
index 3e2fda7..07e28d5 100644
--- a/src/main/resources/mapper/ExamTemplatesMapper.xml
+++ b/src/main/resources/mapper/ExamTemplatesMapper.xml
@@ -34,11 +34,11 @@
<select id="gets" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.domain.vo.ExamTemplatesVO">
select
- e.*
+ DISTINCT e.id
+ , e.name, e.paper_type, e.suggest_time, e.title_name, e.ctime, e.status, e.menu_ids,e.start_time,e.end_time
from t_exam_templates e
inner join t_exam_templates_user u on e.id = u.templates_id
<where>
- paper_type != 7
<if test="status != null">
and e.status = 0
</if>
@@ -47,15 +47,20 @@
</if>
<if test="userId != null">
and u.user_id = #{userId}
+ </if>
+ <if test="now !=null">
+ and #{now} between e.start_time and e.end_time
</if>
</where>
- union all
+ </select>
+
+ <select id="getByadmins" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.domain.vo.ExamTemplatesVO">
select
- e.*
+ DISTINCT e.id
+ , e.name, e.paper_type, e.suggest_time, e.title_name, e.ctime, e.status, e.menu_ids,e.start_time,e.end_time
from t_exam_templates e
- inner join t_exam_templates_user u on e.id = u.templates_id
+ left join t_exam_templates_user u on e.id = u.templates_id
<where>
- paper_type = 7
<if test="status != null">
and e.status = 0
</if>
@@ -64,6 +69,9 @@
</if>
<if test="userId != null">
and u.user_id = #{userId}
+ </if>
+ <if test="deptId != null">
+ and e.dept_id = #{deptId}
</if>
<if test="now !=null">
and #{now} between e.start_time and e.end_time
@@ -88,4 +96,4 @@
where id = #{id}
</delete>
-</mapper>
\ No newline at end of file
+</mapper>
--
Gitblit v1.8.0