From f7196dff53805c9d5e6c945e5334ce4e4423d779 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期五, 15 三月 2024 18:02:23 +0800
Subject: [PATCH] 题目导入模板,待完善
---
src/main/resources/mapper/UserMapper.xml | 43 ++++++++++++++++++++++++++++++++++++++++---
1 files changed, 40 insertions(+), 3 deletions(-)
diff --git a/src/main/resources/mapper/UserMapper.xml b/src/main/resources/mapper/UserMapper.xml
index 2ac7dd0..bd9950c 100644
--- a/src/main/resources/mapper/UserMapper.xml
+++ b/src/main/resources/mapper/UserMapper.xml
@@ -23,7 +23,7 @@
</resultMap>
<sql id="Base_Column_List">
id, user_uuid, user_name, password, real_name, age, sex, birth_day, user_level, phone,
- role, status, image_path, create_time, modify_time, last_active_time, deleted, wx_open_id
+ role, status, image_path, create_time, modify_time, last_active_time, deleted, wx_open_id, dept_admin
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
@@ -220,6 +220,9 @@
<if test="wxOpenId != null">
wx_open_id = #{wxOpenId,jdbcType=VARCHAR},
</if>
+ <if test="deptAdmin != null">
+ dept_admin = #{deptAdmin},
+ </if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
@@ -241,7 +244,8 @@
modify_time = #{modifyTime,jdbcType=TIMESTAMP},
last_active_time = #{lastActiveTime,jdbcType=TIMESTAMP},
deleted = #{deleted,jdbcType=BIT},
- wx_open_id = #{wxOpenId,jdbcType=VARCHAR}
+ wx_open_id = #{wxOpenId,jdbcType=VARCHAR},
+ dept_admin = #{deptAdmin}
where id = #{id,jdbcType=INTEGER}
</update>
@@ -271,6 +275,13 @@
<include refid="Base_Column_List"/>
from t_user
where deleted=0 and user_name=#{value} limit 1
+ </select>
+
+ <select id="getUserByRealName" resultMap="BaseResultMap">
+ select
+ <include refid="Base_Column_List"/>
+ from t_user
+ where deleted=0 and real_name = #{realName}
</select>
<select id="getUserByUserNamePwd" resultMap="BaseResultMap">
@@ -324,7 +335,7 @@
<where>
and deleted=0
<if test="userName != null and userName != ''">
- and user_name like concat('%',#{userName},'%')
+ and real_name like concat('%',#{userName},'%')
</if>
<if test="role != null ">
and role= #{role}
@@ -427,4 +438,30 @@
</if>
</where>
</select>
+
+
+ <update id="updateDeptAdmin">
+ UPDATE t_user SET dept_admin = #{deptAdmin} WHERE id = #{id} AND deleted = 0
+ </update>
+
+ <select id="getUserByDept" resultType="com.mindskip.xzs.domain.ExamPaperAnswer">
+ SELECT
+ tu.id as createUser, tu.real_name as userName, count(tepa.id) as counts
+ FROM
+ t_user tu INNER JOIN t_user_department tud ON tu.id = tud.user_id AND tu.deleted = 0
+ LEFT JOIN t_exam_paper_answer tepa ON tepa.create_user = tu.id
+ <where>
+ <if test="query.deptId != null">
+ AND tud.department_id = #{query.deptId}
+ </if>
+ <if test="query.start != null and query.end != null">
+ AND tepa.create_time between #{query.start} and #{query.end}
+ </if>
+ </where>
+ group by
+ createUser, userName
+ ORDER BY
+ tu.id desc
+ </select>
+
</mapper>
--
Gitblit v1.8.0