35 lines
1.1 KiB
XML
35 lines
1.1 KiB
XML
<?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">
|
|
insert into user(account, password, username, email, pic)
|
|
values (#{account}, #{password}, #{username}, #{email}, #{pic});
|
|
</insert>
|
|
<delete id="delUser">
|
|
delete
|
|
from user
|
|
where account = #{account};
|
|
</delete>
|
|
<update id="updateUser">
|
|
update user
|
|
set password=#{password} and username = #{username} and email = #{email}
|
|
where account = #{account};
|
|
</update>
|
|
<update id="updateHead" parameterType="com.example.chat.entity.User">
|
|
update user
|
|
set pic=#{pic}
|
|
where account = #{account}
|
|
</update>
|
|
</mapper>
|