org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the

落日映苍穹つ 2024-04-18 18:21 190阅读 0赞

所有的错误信息:
在控制台下这个提示为:
org.apache.ibatis.executor。ExecutorException:运行了一个查询,但是没有找到映射语句“com.shiyaxin.dao.IUserDao.findByCondition”的结果映射。很可能既没有指定结果类型,也没有指定结果映射。

  1. org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement 'com.shiyaxin.dao.IUserDao.findByCondition'. It's likely that neither a Result Type nor a Result Map was specified.

这个mybatis的查询语句需要一个resultType,这里出错要莫是忘写,要莫是写错了

  1. <!-- mysql中的动态sql语句-->
  2. <!--根据条件查询-->
  3. <select id="findByCondition" parameterType="user" resultType="user">
  4. select * from user where 1=1
  5. <if test="username != null">
  6. and username = #{username}
  7. </if>
  8. <!-- <if test="userSex != null">-->
  9. <!-- and sex = #{sex}-->
  10. <!-- </if>-->
  11. </select>

发表评论

表情:
评论列表 (有 0 条评论,190人围观)

还没有评论,来说两句吧...

相关阅读