feat:密码模式登陆v1

This commit is contained in:
xiang
2025-08-24 01:01:35 +08:00
commit 62b271798a
20 changed files with 886 additions and 0 deletions

View File

@@ -0,0 +1,164 @@
<?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.xiang.xservice.auth.service.repository.mapper.XUserMapper">
<resultMap id="BaseResultMap" type="com.xiang.xservice.auth.service.entity.XUser" >
<result column="id" property="id" />
<result column="name" property="name" />
<result column="username" property="username" />
<result column="password" property="password" />
<result column="email" property="email" />
<result column="phone" property="phone" />
<result column="avatar" property="avatar" />
<result column="login_ip" property="loginIp" />
<result column="login_date" property="loginDate" />
<result column="status" property="status"/>
<result column="del_flag" property="delFlag" />
<result column="create_by" property="createBy" />
<result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
id,
name,
username,
password,
email,
phone,
avatar,
login_ip,
login_date,
status,
del_flag,
create_by,
create_time,
update_by,
update_time
</sql>
<insert id="insert" useGeneratedKeys="true" keyColumn="id" keyProperty="id" parameterType="com.xiang.xservice.auth.service.entity.XUser">
INSERT INTO x_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="null != name and '' != name">
name,
</if>
<if test="null != username and '' != username">
username,
</if>
<if test="null != password and '' != password">
password,
</if>
<if test="null != email and '' != email">
email,
</if>
<if test="null != phone and '' != phone">
phone,
</if>
<if test="null != avatar and '' != avatar">
avatar,
</if>
<if test="null != loginIp and '' != loginIp">
login_ip,
</if>
<if test="null != loginDate ">
login_date,
</if>
<if test="null != delFlag ">
del_flag,
</if>
<if test="null != status ">
status,
</if>
<if test="null != createBy and '' != createBy">
create_by,
</if>
<if test="null != createTime ">
create_time,
</if>
<if test="null != updateBy and '' != updateBy">
update_by,
</if>
<if test="null != updateTime ">
update_time
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="null != name and '' != name">
#{name},
</if>
<if test="null != username and '' != username">
#{username},
</if>
<if test="null != password and '' != password">
#{password},
</if>
<if test="null != email and '' != email">
#{email},
</if>
<if test="null != phone and '' != phone">
#{phone},
</if>
<if test="null != avatar and '' != avatar">
#{avatar},
</if>
<if test="null != loginIp and '' != loginIp">
#{loginIp},
</if>
<if test="null != loginDate ">
#{loginDate},
</if>
<if test="null != delFlag ">
#{delFlag},
</if>
<if test="null != status ">
#{status},
</if>
<if test="null != createBy and '' != createBy">
#{createBy},
</if>
<if test="null != createTime ">
#{createTime},
</if>
<if test="null != updateBy and '' != updateBy">
#{updateBy},
</if>
<if test="null != updateTime ">
#{updateTime}
</if>
</trim>
</insert>
<update id="delete" >
update x_user set del_flag = 1 where id = #{id}
</update>
<update id="update" parameterType="com.xiang.xservice.auth.service.entity.XUser">
UPDATE x_user
<set>
<if test="null != name and '' != name">name = #{name},</if>
<if test="null != username and '' != username">username = #{username},</if>
<if test="null != password and '' != password">password = #{password},</if>
<if test="null != email and '' != email">email = #{email},</if>
<if test="null != phone and '' != phone">phone = #{phone},</if>
<if test="null != avatar and '' != avatar">avatar = #{avatar},</if>
<if test="null != loginIp and '' != loginIp">login_ip = #{loginIp},</if>
<if test="null != loginDate ">login_date = #{loginDate},</if>
<if test="null != delFlag ">del_flag = #{delFlag},</if>
<if test="null != createBy and '' != createBy">create_by = #{createBy},</if>
<if test="null != createTime ">create_time = #{createTime},</if>
<if test="null != updateBy and '' != updateBy">update_by = #{updateBy},</if>
<if test="null != updateTime ">update_time = #{updateTime}</if>
</set>
WHERE id = #{id}
</update>
<select id="selectByUsername" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
from x_user
where username = #{username} and del_flag = 0 and status = 1
</select>
</mapper>