white_season 2019-03-17 17:15 采纳率: 0%
浏览 2862
已结题

springboot 2.0+mybatis 整合 BaseMapper<T> 接口自带方法报未绑定异常


```# 问题:springboot   2.0+mybatis 整合  
BaseMapper<T> 接口自带方法报未绑定异常
queryUserInfoList可以有返回,queryUserInfo报异常:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.yst.springboot.mapper.UserInfoMapper.selectOne。baseMapper自带方法 查询为什么会报这个异常,有没有人可以帮我看下


@Service
public class UserInfoServiceImpl extends ServiceImpl implements IUserInfoService {
@Autowired
private UserInfoMapper userInfoMapper;

@Override
public List<UserInfo> queryUserInfoList() {
    return userInfoMapper.selectUserInfoList();
}

@Override
public UserInfo queryUserInfo() {
    QueryWrapper<UserInfo> queryWrapper=new QueryWrapper<UserInfo>();
    queryWrapper.eq("NAME", "xiaoming");
    return userInfoMapper.selectOne(queryWrapper);
}

}

**queryOne**

[2019-03-17 17:07:55.870d] [http-nio-8088-exec-1] [ERROR] [o.a.c.c.C.[.[.[/test].[dispatcherServlet]] - Servlet.service() for servlet [dispatcherServlet] in context with path [/test] threw exception [Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.yst.springboot.mapper.UserInfoMapper.selectOne] with root cause
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.yst.springboot.mapper.UserInfoMapper.selectOne
at org.apache.ibatis.binding.MapperMethod$SqlCommand.(MapperMethod.java:232)
at org.apache.ibatis.binding.MapperMethod.(MapperMethod.java:50)
at org.apache.ibatis.binding.MapperProxy.lambda$cachedMapperMethod$0(MapperProxy.java:62)
at org.apache.ibatis.binding.MapperProxy$$Lambda$438/810893160.apply(Unknown Source)
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:62)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:57)
at com.sun.proxy.$Proxy57.selectOne(Unknown Source)
at com.yst.springboot.service.impl.UserInfoServiceImpl.queryUserInfo(UserInfoServiceImpl.java:36)
at com.yst.springboot.service.impl.UserInfoServiceImpl$$FastClassBySpringCGLIB$$bc171195.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:684)
at com.yst.springboot.service.impl.UserInfoServiceImpl$$EnhancerBySpringCGLIB$$3371fd46.queryUserInfo()
at com.yst.springboot.controller.UserInfoController.queryUserInfo(UserInfoController.java:41)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)


**queryList**

[2019-03-17 17:12:10.086d] [http-nio-8088-exec-3] [INFO ] [com.yst.springboot.controller.UserInfoController] - 用户信息:[{"age":25,"name":"张三","sn":"1"},{"age":26,"name":"李四","sn":"2"}]

**mapper接口**

public interface UserInfoMapper extends BaseMapper《UserInfo》 {
List《UserInfo》 selectUserInfoList();
}

  • 写回答

2条回答 默认 最新

  • devmiao 2019-03-17 23:58
    关注
    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!