mybatis使用count返回int的方法

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mybatis使用count返回int的方法相关的知识,希望对你有一定的参考价值。

<select id="countByExample" resultType="java.lang.Integer" >
select count(*) from XXXXXX
</select>


直接写"java.lang.Integer",接口中的返回值写int。
抓住楼主就是一个过肩摔~技术分享

以上是关于mybatis使用count返回int的方法的主要内容,如果未能解决你的问题,请参考以下文章

使用MyBatis查询int类型字段,返回NULL值时报异常的解决方法

使用MyBatis查询 返回类型为int,但是当查询结果为空NULL,报异常的解决方法

Mybatis报错:org.apache.ibatis.builder.IncompleteElementException: Could not find result map com.me.myb

Mybatis1

mybatis返回一个count加一个字段该怎么设置返回resultType

mybatis返回一个count加一个字段该怎么设置返回resultType