shuos_yan 2019-12-20 15:40 采纳率: 0%
浏览 1225

mybatis-plus not found selectByid

各位大佬,我今天在搞mybatis plus的时候使用本身的selectById方法,报错如下:

Servlet.service() for servlet [dispatcherServlet] in context with path [/server] threw exception [Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.yss.cn.modules.mapper.TBaseAuthMapper.selectById] with root cause

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.yss.cn.modules.mapper.TBaseAuthMapper.selectById

在网上百度了一下:有的说的需要加@TableId 注解,加了但是不行,各个代码如下:

serviceImpl:

@Autowired
    private TBaseAuthMapper tBaseAuthMapper;

 @Override
    public TBaseAuthResult findTBaseAuthResultById(Integer id){
        return BeanUtil.cast(tBaseAuthMapper.selectById(id), TBaseAuthResult.class);
    }

mapper:


public interface TBaseAuthMapper extends BaseMapper<TBaseAuth> {

}

TBaseAuth:

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_base_auth")
public class TBaseAuth implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 序号
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    ...
}

哪位大佬帮忙解决一下,万分感谢!!!

  • 写回答

1条回答 默认 最新

  • 张洪財 2019-12-20 16:32
    关注

    连接的数据库对吗? 是不是没 有找到t_base_auth 这个表。 你的表是否有前缀?

    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器