select count(1),type from table group by type
这个和springmvc以及mybatis没有关系,,只是一个逻辑的问题而已,查询后按不同的name统计不就可以了吗