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.

28 lines
1.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?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文件相当于DAO接口的“实现类”namespace属性要指定“实现”DAO接口的全限定名 -->
<mapper namespace="com.example.web.UserDao">
<insert id="insert" parameterType="com.example.web.User1">
insert into user1(username,password) values(#{username},#{password})
</insert>
<update id="updateUser" parameterType="com.example.web.User1">
update user1 set username=#{username},password=#{password} where userId=#{userId}
</update>
<delete id="deleteUser" parameterType="com.example.web.User1">
delete from user1 where userId=#{userId}
</delete>
<select id="selectAll" resultType="com.example.web.User1">
select * from user1
</select>
<select id="selectUserById" resultType="com.example.web.User1">
select*from user1 where userId=#{userId}
</select>
</mapper>