mybatis返回count(*)的整数值

1、mybatis中resultType定义为"java.lang.Integer"

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

2、接口中返回值写成int,即可

int selectNums();

 

欢迎关注微信公众号“Java面试达人”,(id:javasuperman),收看更多精彩内容

posted @ 2019-04-16 22:49  程序员阿九  阅读(1711)  评论(0编辑  收藏  举报