管理登录次数+登录时间的记录

This commit is contained in:
none
2023-02-17 15:13:21 +08:00
parent aed4c60296
commit 9a9226baa3
7 changed files with 114 additions and 28 deletions

View File

@@ -5,23 +5,32 @@
<mapper namespace="xyz.playedu.api.mapper.AdminUserMapper">
<resultMap id="BaseResultMap" type="xyz.playedu.api.domain.AdminUser">
<id property="id" column="id" jdbcType="INTEGER"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="email" column="email" jdbcType="VARCHAR"/>
<result property="password" column="password" jdbcType="VARCHAR"/>
<result property="salt" column="salt" jdbcType="VARCHAR"/>
<result property="loginIp" column="login_ip" jdbcType="VARCHAR"/>
<result property="loginAt" column="login_at" jdbcType="TIMESTAMP"/>
<result property="isBanLogin" column="is_ban_login" jdbcType="TINYINT"/>
<result property="loginTimes" column="login_times" jdbcType="INTEGER"/>
<result property="createdAt" column="created_at" jdbcType="TIMESTAMP"/>
<result property="updatedAt" column="updated_at" jdbcType="TIMESTAMP"/>
<id property="id" column="id" jdbcType="INTEGER"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="email" column="email" jdbcType="VARCHAR"/>
<result property="password" column="password" jdbcType="VARCHAR"/>
<result property="salt" column="salt" jdbcType="VARCHAR"/>
<result property="loginIp" column="login_ip" jdbcType="VARCHAR"/>
<result property="loginAt" column="login_at" jdbcType="TIMESTAMP"/>
<result property="isBanLogin" column="is_ban_login" jdbcType="TINYINT"/>
<result property="loginTimes" column="login_times" jdbcType="INTEGER"/>
<result property="createdAt" column="created_at" jdbcType="TIMESTAMP"/>
<result property="updatedAt" column="updated_at" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
id,name,email,
password,salt,login_ip,
login_at,is_ban_login,login_times,
id
,name,email,
password,salt,login_ip,
login_at,is_ban_login,login_times,
created_at,updated_at
</sql>
<update id="updateLoginAtAndLoginTimes">
UPDATE `admin_users`
SET `login_at` = #{loginAt},
`login_times`= #{loginTimes}
where id = #{id}
and `login_times` = ${loginTimes - 1} limit 1
</update>
</mapper>