---
title: "mybatis错误 Mapped Statements collection does not contain value for"
author: "matychen"
date: "2011-07-19T15:08:42Z"
tags: []
categories: ["行业应用"]
slug: "mybatis-mapped-statements-collection-does-not-contain-value-for"
draft: false
lastmod: "2011-07-19T15:08:42Z"
id: 1127995
url: "https://matychen.iteye.com/blog/1127995"
---

java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.**.bank.dao.AmountMapper.selectQueryAccount

出现这个错误有网上说的：命名空间没写对，如果使用mapper，则
<mapper namespace="com.sitech.mapper.StudentMapper">
空间中一定要写上Mapper的名称，否则就会报错。

还有一个情况就是interface的名称和你xml的名称没有一致造成的，我是这种情况，新手开发。。。

比如你mapper的名称为AmountMapper 但是xml的名称为AmountMapper_sqlMap.xml这个是ibatis2的惯用写法。。。囧