报错内容如下
Rerun updateInfoByUid()
cn.cyjt.shoot.mapper.UserMapperTests
updateInfoByUid(cn.cyjt.shoot.mapper.UserMapperTests)
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): cn.cyjt.shoot.mapper.UserMapper.updateInfoByUid
at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:235)
at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:53)
at org.apache.ibatis.binding.MapperProxy.lambda$cachedInvoker$0(MapperProxy.java:115)
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
at org.apache.ibatis.binding.MapperProxy.cachedInvoker(MapperProxy.java:102)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85)
at com.sun.proxy.$Proxy77.updateInfoByUid(Unknown Source)
at cn.cyjt.shoot.mapper.UserMapperTests.updateInfoByUid(UserMapperTests.java:67)
。。。。。
问题原因:
绑定异常:无效的绑定语句(未找到):cyjt.拍摄.mapper.UserMapper.updateInfoByUid
解决方法:
在resource目录下的mapper.xml 文件里缺少了sql语句
补上去即可。
如:
<!-- 更新用户的个人资料 -->
<!-- Integer updateInfoByUid(User user) -->
<update id="updateInfoByUid">
UPDATE
t_user
SET
gender=#{gender},
phone=#{phone},
email=#{email},
modified_user=#{modifiedUser},
modified_time=#{modifiedTime}
WHERE
uid=#{uid}
</update>