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

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
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?