1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| <?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.xxx.dao.UserMapper">
<select id="getUserList" resultType="user"> SELECT * FROM mybatis.user; </select> <select id="getUserById" parameterType="int" resultType="com.xxx.pojo.User"> SELECT * FROM mybatis.user where iduser = #{id} </select> <insert id="addUser" parameterType="com.xxx.pojo.User"> insert into mybatis.user (iduser,username,pwd) value (#{iduser},#{username},#{pwd}); </insert> <update id="updateUser" parameterType="com.xxx.pojo.User"> update mybatis.user set username=#{username},pwd=#{pwd} where iduser=#{iduser}; </update> <delete id="deleteUser" parameterType="int"> delete from mybatis.user where iduser = #{id}; </delete>
</mapper>
|