写作于
2022-10-13 22:17:20
发布于
2022-11-20 16:50:42
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘headerUrl’ not found. Available parameters are [arg1, arg0, param1, param2]
Test
@Test
public void updateUser() {
int rows = userMapper.updateStatus(150, 1);
System.out.println(rows);
rows = userMapper.updateHeader(150, "http://www.nowcoder.com/102.png");
System.out.println(rows);
rows = userMapper.updatePassword(150, "hello");
System.out.println(rows);
}
user-mapper.xml
<update id="updateStatus">
update user set status = #{status} where id = #{id}
update>
<update id="updateHeader">
update user set header_url = #{headerUrl} where id = #{id}
update>
<update id="updatePassword">
update user set password = #{password} where id = #{id}
update>
UserMapper
int updateStatus(int id, int status);
int updateHeader(int id, String headerUrl);
int updatePassword(int id,String password);
修改UserMapper
int updateStatus(@Param("id")int id, @Param("status") int status);
int updateHeader(@Param("id")int id, @Param("headerUrl")String headerUrl);
int updatePassword(@Param("id")int id, @Param("password")String password);