查询使用聚合函数
在持久层接口中添加模糊查询方法
int findAllcount();
在用户的映射配置文件中配置
<!--查询总记录条数-->
<select id="findAllcount" resultType="int" >
SELECT count(*) FROM USER
</select>
加入聚合查询的测试方法
@Test
public void testfindallcount() {
int res = userDao.findAllcount();
System.out.println(res);
}