Chat/src/main/resources/mapper/LoginMapper.xml

35 lines
1.1 KiB
XML
Raw Normal View History

2023-11-14 18:19:47 +08:00
<?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="dao.Login">
<select id="getUser" resultType="com.example.chat.entity.User">
select *
from user
where account = #{account};
</select>
<select id="emailCheck" resultType="com.example.chat.entity.User">
select *
from user
where email = #{email};
</select>
<insert id="addUser">
2023-12-01 13:44:14 +08:00
insert into user(account, password, username, email, pic)
values (#{account}, #{password}, #{username}, #{email}, #{pic});
2023-11-14 18:19:47 +08:00
</insert>
<delete id="delUser">
delete
from user
where account = #{account};
</delete>
<update id="updateUser">
update user
2023-11-21 13:07:56 +08:00
set password=#{password} and username = #{username} and email = #{email}
2023-11-14 18:19:47 +08:00
where account = #{account};
</update>
2023-12-01 13:44:14 +08:00
<update id="updateHead" parameterType="com.example.chat.entity.User">
update user
set pic=#{pic}
where account = #{account}
</update>
2023-11-14 18:19:47 +08:00
</mapper>