<?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="org.pojo.UesrinfoMapper"> <select id="froUser" parameterType="Integer" resultType="org.pojo.Uesrinfo"> select * from uesrinfo </select> <insert id="intoUser" parameterType="org.pojo.Uesrinfo"> insert into uesrinfo(username,password,boo) values (#{username},#{password},#{boo}) </insert> <update id="updtUser" parameterType="org.pojo.Uesrinfo"> update uesrinfo set username=#{username},password=#{password},boo=#{boo} where id=#{id} </update> <delete id="deltUser" parameterType="Integer"> delete from uesrinfo where order=#{id} </delete> </mapper>
时间: 2023-12-22 21:04:35 浏览: 113
你的 Mapper XML 文件中 namespace 属性值为 `org.pojo.UesrinfoMapper`,而不是 `org.pojo.UserinfoMapper`。请检查你的代码中是否有拼写错误,应该修改为正确的 Mapper 文件路径:`<mapper namespace="org.pojo.UesrinfoMapper">`。同时,你的 SQL 语句中的表名也有一个拼写错误,`uesrinfo` 应该是 `userinfo`。修改后的 Mapper 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="org.pojo.UserinfoMapper">
<select id="froUser" parameterType="Integer" resultType="org.pojo.Uesrinfo">
select * from userinfo
</select>
<insert id="intoUser" parameterType="org.pojo.Uesrinfo">
insert into userinfo(username,password,boo) values (#{username},#{password},#{boo})
</insert>
<update id="updtUser" parameterType="org.pojo.Uesrinfo">
update userinfo set username=#{username},password=#{password},boo=#{boo} where id=#{id}
</update>
<delete id="deltUser" parameterType="Integer">
delete from userinfo where id=#{id}
</delete>
</mapper>
```
请注意检查 Mapper 文件路径和 SQL 语句是否都正确。
阅读全文