mybatis返回count(*)的整数值

wylc123 1年前 ⋅ 640 阅读

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

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

2、接口文件中方法返回值写成int,即可接收到
int selectNums();

更多内容请访问:IT源点

相关文章推荐

全部评论: 0

    我有话说: