count is ambiguous in Mapped Statements collection (try using the full name including the namespace, or rename one of the entries)

各位老铁们: 遇到这种问题怎么办?

{"callbackType":"","forwardUrl":"","message":":错误信息:底层异常,错误信息:数据库底层异常,错误信息:数据操作失败,错误信息: ### Error querying database. Cause: java.lang.IllegalArgumentException: count is ambiguous in Mapped Statements collection (try using the full name including the namespace, or rename one of the entries) ### Cause: java.lang.IllegalArgumentException: count is ambiguous in Mapped Statements collection (try using the full name including the namespace, or rename one of the entries) com.etoak.demo.dao.TbTstCustomerDemoDao.findPage()[74行]

com.etoak.demo.manager.TbTstCustomerDemoManager.findPage()[57行]
com.etoak.demo.service.impl.CustomerdemoServiceImpl.findPage()[59行]
com.etoak.demo.service.impl.CustomerdemoServiceImpl$FastClassByCGLIB$b96bb077.invoke()[-1行]
com.etoak.demo.service.impl.CustomerdemoServiceImpl$EnhancerByCGLIB$66273b12.findPage()[-1行]
com.etoak.demo.action.CustomerdemoAction.list()[91行]
com.etoak.demo.manager.TbTstCustomerDemoManager.findPage()[60行]
com.etoak.demo.service.impl.CustomerdemoServiceImpl.findPage()[59行]
com.etoak.demo.service.impl.CustomerdemoServiceImpl$FastClassByCGLIB$b96bb077.invoke()[-1行]
com.etoak.demo.service.impl.CustomerdemoServiceImpl$EnhancerByCGLIB$66273b12.findPage()[-1行]
com.etoak.demo.action.CustomerdemoAction.list()[91行]

com.etoak.demo.service.impl.CustomerdemoServiceImpl.findPage()[62行]
com.etoak.demo.service.impl.CustomerdemoServiceImpl$FastClassByCGLIB$b96bb077.invoke()[-1行]
com.etoak.demo.service.impl.CustomerdemoServiceImpl$EnhancerByCGLIB$66273b12.findPage()[-1行]
com.etoak.demo.action.CustomerdemoAction.list()[91行]
com.etoak.demo.action.CustomerdemoAction.list()[98行]
","navTabId":"020110","object":null,"pager":null,"statusCode":"300","tableId":"","totalSize":0}」
- - - - - - - - - - - - - - -

一般的大家第一时间想到的估计是

是不是重复了,但是检查了一遍又一遍, count 不是一个sql的 id 啊。 这怎么会报这个错误呢,就开始纠结。

还有一种庆魁昂可能你没有考虑到:

Mapper.xml没有配置,或者命名空间错误,系统找不到相关的映射。

或者你的mapper文件没有在mybatis的中得配置文件 的mapper 标签中得resource 路径中没有。 制定的路径扫描不到。

原文地址:https://www.cnblogs.com/wangdong811/p/10291951.html