Files
en-edu/enlish-service/src/main/resources/mapper/UserDOMapper.xml
lbw 49963bb49c feat(user): 添加用户信息修改功能及对应验证码校验
- 在管理员页面新增修改用户信息表单,支持姓名、手机号、密码修改
- 实现验证码发送倒计时与发送状态管理
- 新增接口支持用户信息更新,包含密码和手机号校验
- 后端校验验证码有效性,编码密码后更新用户信息
- 修改用户信息后强制登出,确保安全性
- 优化登录状态判断,登出后跳转至登录页
- 取消部分日志打印,调整发送验证码缓存过期时间为5分钟
2026-01-05 12:07:15 +08:00

72 lines
2.2 KiB
XML

<?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.yinlihupo.enlish.service.domain.mapper.UserDOMapper">
<resultMap id="BaseResultMap" type="com.yinlihupo.enlish.service.domain.dataobject.UserDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="openid" jdbcType="VARCHAR" property="openid" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="email" jdbcType="VARCHAR" property="email" />
</resultMap>
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
insert into user (password, phone, name)
values (#{password}, #{phone}, #{name})
</insert>
<insert id="createUser">
insert into user (phone, name, password)
values (#{phone}, #{name}, #{password})
</insert>
<update id="updatePassword">
update user
set password = #{password}
where id = #{id}
</update>
<update id="updateUserInfo">
update user
<set>
<if test="password != null">
password = #{password},
</if>
<if test="name != null">
`name` = #{name},
</if>
<if test="phone != null">
phone = #{phone},
</if>
</set>
where id = #{id}
</update>
<select id="selectByPhone" resultMap="BaseResultMap">
select *
from user
where phone = #{phone}
</select>
<select id="selectById">
select *
from user
where id = #{id}
</select>
<select id="selectUserDOList" resultMap="BaseResultMap">
select *
from user
where 1 = 1
<if test="name != null">
and name = #{name}
</if>
limit #{startIndex}, #{pageSize}
</select>
<select id="selectUserTotal" resultType="java.lang.Integer">
select count(*)
from user
</select>
</mapper>