You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
88 lines
3.1 KiB
88 lines
3.1 KiB
<?xml version="1.0" encoding="UTF-8"?> |
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
<mapper namespace="com.teaching.backend.mapper.umsAdmin.UmsUserMapper"> |
|
|
|
<update id="updateUserInformation"> |
|
update ums_user |
|
<set> |
|
<if test="username != null and username != ''"> |
|
username = #{username,jdbcType=VARCHAR}, |
|
</if> |
|
<if test="password != null and password != ''"> |
|
password = #{password}, |
|
</if> |
|
<if test="phone != null and phone != ''"> |
|
phone = #{phone,jdbcType=VARCHAR}, |
|
</if> |
|
<if test="nickName != null and nickName != ''"> |
|
nick_name = #{nickName,jdbcType=VARCHAR}, |
|
</if> |
|
<if test="icon != null and icon != ''"> |
|
icon = #{icon,jdbcType=VARCHAR}, |
|
</if> |
|
<if test="createTime != null and createTime != ''"> |
|
create_time = #{createTime,jdbcType=TIMESTAMP}, |
|
</if> |
|
<if test="status != null and status != ''"> |
|
status = #{status,jdbcType=INTEGER}, |
|
</if> |
|
</set> |
|
where id = #{id,jdbcType=BIGINT} |
|
</update> |
|
<select id="getByIdRoleInfo" resultType="com.teaching.backend.model.entity.umsAdmin.UmsRole" parameterType="java.lang.String"> |
|
SELECT |
|
r.* |
|
FROM |
|
ums_admin_role_relation arr |
|
LEFT JOIN ums_role r ON arr.role_id = r.id |
|
WHERE |
|
arr.admin_id = #{id} |
|
</select> |
|
<select id="getByIdTeacher" resultType="com.teaching.backend.model.entity.umsAdmin.UmsTeacher" parameterType="java.lang.String"> |
|
SELECT |
|
t.id id, |
|
t.name name, |
|
t.sex sex, |
|
t.nationality nationality, |
|
t.profession profession, |
|
t.education education, |
|
t.academic_degree academicDegree, |
|
t.professional_title professionalTitle, |
|
t.emergency_contact emergencyContact, |
|
t.join_work_time joinWorkTime, |
|
t.political_status politicalStatus, |
|
t.user_id userId |
|
FROM |
|
ums_teacher t |
|
WHERE |
|
t.user_id = #{id} |
|
</select> |
|
<select id="getByIdStudent" resultType="com.teaching.backend.model.vo.umsAdmin.UmsStudentVO" parameterType="java.lang.String"> |
|
SELECT |
|
s.id id, |
|
s.name name, |
|
s.sex sex, |
|
s.nationality nationality, |
|
s.number number, |
|
s.birthday birthday, |
|
s.phone phone, |
|
s.faculty faculty, |
|
s.major major, |
|
s.year_age yearAge, |
|
s.class_name className, |
|
S.user_id userId |
|
FROM |
|
ums_student s |
|
WHERE |
|
s.user_id = #{id} |
|
</select> |
|
<select id="getByIdRoleId" parameterType="java.lang.String" resultType="java.lang.String"> |
|
SELECT |
|
us.role_id roleId |
|
FROM |
|
ums_user us |
|
WHERE |
|
us.id = #{userId} |
|
</select> |
|
|
|
</mapper>
|
|
|