mirror of
https://github.com/FreeeBird/hotel.git
synced 2025-09-14 11:19:45 +08:00
新增管理员的注册、登录、更改密码接口
This commit is contained in:
@@ -39,12 +39,8 @@
|
||||
<if test="password != null">
|
||||
password,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="adminId != null">
|
||||
@@ -56,12 +52,8 @@
|
||||
<if test="password != null">
|
||||
#{password,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
now(),
|
||||
now()
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="cn.mafangui.hotel.entity.Admin">
|
||||
@@ -90,4 +82,25 @@
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where admin_id = #{adminId,jdbcType=INTEGER}
|
||||
</update>
|
||||
<select id="selectByUserName" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
select * from admin
|
||||
where user_name = #{userName,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<select id="selectByUserNameAndPassword" parameterType="cn.mafangui.hotel.entity.Admin">
|
||||
select * from admin
|
||||
where user_name = #{userName,jdbcType=VARCHAR} and password = #{password,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<select id="findAll" resultMap="BaseResultMap">
|
||||
select * from admin
|
||||
</select>
|
||||
<update id="updateByUserNameSelective" parameterType="cn.mafangui.hotel.entity.Admin">
|
||||
update admin
|
||||
<set>
|
||||
<if test="password != null">
|
||||
password = #{password,jdbcType=VARCHAR},
|
||||
</if>
|
||||
update_time = now(),
|
||||
</set>
|
||||
where user_name = #{userName,jdbcType=VARCHAR}
|
||||
</update>
|
||||
</mapper>
|
@@ -64,12 +64,8 @@
|
||||
<if test="idNumber != null">
|
||||
id_number,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">
|
||||
@@ -96,12 +92,8 @@
|
||||
<if test="idNumber != null">
|
||||
#{idNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
now(),
|
||||
now(),
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="cn.mafangui.hotel.entity.User">
|
||||
@@ -186,12 +178,7 @@
|
||||
<if test="idNumber != null">
|
||||
id_number = #{idNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
update_time = now(),
|
||||
</set>
|
||||
where user_name = #{userName,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
Reference in New Issue
Block a user