<?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.pxl.mapper.UserMapper">
<select id="queryAllUser" resultType="User">
select * from user
</select>
<select id="queryById" resultType="User" >
select * from user where id=#{id}
</select>
<select id="queryByName" resultType="User" parameterType="String">
select * from user where userName=#{userName}
</select>
<insert id="addUser" parameterType="User">
insert into user(id,userName,userPassword) values(#{id},#{userName},#{userPassword})
</insert>
<delete id="deleteUser" parameterType="int">
delete from user where id=#{id}
</delete>
<update id="updateUser" parameterType="User">
update user set userName=#{userName},userPassword=#{userPassword} where id=#{id}
</update>
</mapper>
mapper.xml
最新推荐文章于 2024-01-19 10:14:43 发布