您的位置:首页 > 其它

关于 Mybatis 的Invalid bound statement (not found):错误

2016-07-13 22:56 399 查看
今天遇到一个特别奇怪的问题,最后发现是自己对mybatis的学习还有待提高

返回类型可以用resultType,也可以用resultMap

resultType是直接表示返回类型的,而resultMap则是对外部ResultMap的引用

举个例子:

resultMap:

<select id="findByContract" resultMap="BaseResultMap">
select
*
from
user
where
tel=#{tel}
</select>

resultType:

<select id="getCountGroupbyUserSex" resultType="com.iswust.controller.vo.stat.StatUserSexBean">
select sex as
type,count(*) as count from user group by sex;
</select>

<select id="findConnectByid" resultType="java.lang.String">
select
tel
from
user
id=#{user_id}
</select>

以后再也不要犯这么愚蠢的错误啦
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: