forked from p4fmevgyr/XYSH
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
1.1 KiB
29 lines
1.1 KiB
<?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="com.forum.dao.UserDao">
|
|
<update id="update">
|
|
update user set password=#{password} where username=#{username}
|
|
</update>
|
|
|
|
<select id="queryByUsernameAndPassword" resultType="com.forum.entity.User">
|
|
select * from user
|
|
where username = #{username} and password = #{password};
|
|
</select>
|
|
|
|
<insert id="addUser" parameterType="user">
|
|
insert into user(username,password,email,create_time,update_time,type,school,avatar)
|
|
values(#{username},#{password},#{email},#{createTime},#{updateTime},#{type},#{school},#{avatar})
|
|
</insert>
|
|
<select id="getAllUser" resultType="com.forum.entity.User">
|
|
select id,username,password,email,create_time,type from user
|
|
</select>
|
|
<delete id="deleteUser" >
|
|
delete from user where id = #{id}
|
|
</delete>
|
|
<select id="count" resultType="Integer" >
|
|
select count(*) from user where type = 0
|
|
</select>
|
|
</mapper>
|