|
|
|
<?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">
|
|
|
|
username = #{username,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="password != null">
|
|
|
|
password = #{password},
|
|
|
|
</if>
|
|
|
|
<if test="phone != null">
|
|
|
|
phone = #{phone,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="nickName != null">
|
|
|
|
nick_name = #{nickName,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="icon != null">
|
|
|
|
icon = #{icon,jdbcType=VARCHAR},
|
|
|
|
</if>
|
|
|
|
<if test="createTime != null">
|
|
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
</if>
|
|
|
|
<if test="status != null">
|
|
|
|
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.degree degree,
|
|
|
|
t.professional_title professionalTitle,
|
|
|
|
t.emergency_contact emergencyContact,
|
|
|
|
t.join_work_time joinWorkTime,
|
|
|
|
t.political_status politicalStatus
|
|
|
|
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
|
|
|
|
FROM
|
|
|
|
ums_student s
|
|
|
|
WHERE
|
|
|
|
s.user_id = #{id}
|
|
|
|
</select>
|
|
|
|
</mapper>
|