心得用户个人信息的查询和更改

This commit is contained in:
muamua
2018-10-13 16:46:59 +08:00
parent 3049b3c0b4
commit a1d88bbe9c
5 changed files with 67 additions and 11 deletions

View File

@@ -156,4 +156,43 @@
from user
where user_name = #{userName,jdbcType=VARCHAR} and password = #{password,jdbcType=VARCHAR}
</select>
<select id="selectByUserName" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from user
where user_name = #{userName,jdbcType=VARCHAR}
</select>
<update id="updateByUserNameSelective" parameterType="cn.mafangui.hotel.entity.User">
update user
<set>
<if test="userName != null">
user_name = #{userName,jdbcType=VARCHAR},
</if>
<if test="password != null">
password = #{password,jdbcType=VARCHAR},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="phone != null">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="email != null">
email = #{email,jdbcType=VARCHAR},
</if>
<if test="address != null">
address = #{address,jdbcType=VARCHAR},
</if>
<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>
</set>
where user_name = #{userName,jdbcType=INTEGER}
</update>
</mapper>