A query was run and no Result Maps were found for the Mapped Statement

Cause: org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement ‘com.shadow.foretaste.UserInfoDao.getPhoneNum’.  It’s likely that neither a Result Type nor a Result Map was specified.

导致这个错误的原因是:

mapper.xml中没有指定返回值类型

<select id="getPhoneNum" >
        select phone_num from user_info where id = #{id}
</select>

修改后:

<select id="getPhoneNum" resultType="String">
        select phone_num  from user_info where id = #{id}
</select>

原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/186587.html

(0)
上一篇 2021年11月4日
下一篇 2021年11月4日

相关推荐

发表回复

登录后才能评论