<select id="selectEarlyWarnTypeCountByCondition" resultType="java.util.HashMap">
select
early_warn_type as earlyWarnType,count(early_warn_type) as count
from
t_emergency_info
group by early_warn_type
</select>
得到map集合.
for(Map<String,Object> map : countList) {
if(map.get("earlywarntype")!=null) {
retMap.put("earlywarntype_"+map.get("earlywarntype"), map.get("count"));
}
}
通过遍历集合获取值;
list遍历出一个map的内容为<earlywarntype,1>和<count,1>