From 3c3c7cb06d7091d06109ad6076e9dcfd965356d9 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期三, 05 六月 2024 15:40:08 +0800
Subject: [PATCH] 打包问题,正式数据备份
---
src/main/resources/mapper/ExamTemplatesMapper.xml | 64 ++++++++++++++++++++++++-------
1 files changed, 49 insertions(+), 15 deletions(-)
diff --git a/src/main/resources/mapper/ExamTemplatesMapper.xml b/src/main/resources/mapper/ExamTemplatesMapper.xml
index 0933165..edeaf7c 100644
--- a/src/main/resources/mapper/ExamTemplatesMapper.xml
+++ b/src/main/resources/mapper/ExamTemplatesMapper.xml
@@ -10,16 +10,18 @@
<result column="ctime" jdbcType="TIMESTAMP" property="ctime"/>
<result column="status" jdbcType="VARCHAR" property="status"/>
<result column="menu_ids" jdbcType="VARCHAR" property="menuIds"/>
+ <result column="start_time" jdbcType="TIMESTAMP" property="startTime"/>
+ <result column="end_time" jdbcType="TIMESTAMP" property="endTime"/>
</resultMap>
<sql id="Base_Column_List">
id
- , name, paper_type, suggest_time, title_name, ctime, status, menu_ids
+ , name, paper_type, suggest_time, title_name, ctime, status, menu_ids,start_time,end_time, dept_id
</sql>
<insert id="add" parameterType="com.mindskip.xzs.domain.ExamTemplates" useGeneratedKeys="true" keyProperty="id">
- insert into t_exam_templates (name, paper_type, suggest_time, title_name, ctime, status, menu_ids)
- values (#{name}, #{paperType}, #{suggestTime}, #{titleName}, #{ctime}, #{status}, #{menuIds})
+ insert into t_exam_templates (name, paper_type, dept_id, suggest_time, title_name, ctime, status, menu_ids,start_time,end_time)
+ values (#{name}, #{paperType}, #{deptId}, #{suggestTime}, #{titleName}, #{ctime}, #{status}, #{menuIds},#{startTime},#{endTime})
</insert>
<select id="getTime" resultMap="BaseResultMap">
@@ -32,17 +34,49 @@
<select id="gets" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.domain.vo.ExamTemplatesVO">
select
- <include refid="Base_Column_List"/>
- from t_exam_templates
- where
- <choose>
- <when test="status != null">
- status = 0
- </when>
- <otherwise>
- status is null
- </otherwise>
- </choose>
+ 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>
+ <if test="status != null">
+ and e.status = 0
+ </if>
+ <if test="status == null">
+ and e.status is null
+ </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>
+ </select>
+
+ <select id="getByadmins" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.domain.vo.ExamTemplatesVO">
+ select
+ 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
+ left join t_exam_templates_user u on e.id = u.templates_id
+ <where>
+ <if test="status != null">
+ and e.status = 0
+ </if>
+ <if test="status == null">
+ and e.status is null
+ </if>
+ <if test="userId != null">
+ and u.user_id = #{userId}
+ </if>
+ <if test="deptId != null and deptId.size() > 0">
+ and e.dept_id in <foreach collection="deptId" item="item" separator="," open="(" close=")"> #{item} </foreach>
+ </if>
+ <if test="now !=null">
+ and #{now} between e.start_time and e.end_time
+ </if>
+ </where>
</select>
<select id="getById" resultMap="BaseResultMap">
@@ -62,4 +96,4 @@
where id = #{id}
</delete>
-</mapper>
\ No newline at end of file
+</mapper>
--
Gitblit v1.8.0