首页 > 其他 > 详细

根据地区进行统计人数,如果没有显示为0

时间:2019-09-26 15:35:20      阅读:89      评论:0      收藏:0      [点我收藏+]
//Controller 层
/**
* @Description
* 根据地区查询所有用户信息
* @author luying
*
*/

@RequestMapping(value = "/toShiCountPage")
@ResponseBody
public ModelAndView toShiCountPage(Integer cid) {
ModelAndView mv = new ModelAndView("admin/tosignup/toShiCountPage");
// 查询到所有地市级的人数统计
Map<String,Object> areaPersonMap = toSignUpService.areaPersonNum(cid);
mv.addObject("cid",cid);
mv.addObject("areaPersonMap",areaPersonMap);
return mv;
}


//service 层

/**
* @Description
*
* 根据地区进行人员数量统计
* @author luying
*
*/
public Map<String,Object> areaPersonNum(Integer cid){
List<ApplyParticipants> areaNum=null;
Map mapArea = new HashMap<>();

mapArea.put("桂林市","0");
mapArea.put("北海市","0");
mapArea.put("梧州市","0");
mapArea.put("贵港市","0");
mapArea.put("玉林市","0");
mapArea.put("河池市","0");
mapArea.put("百色市","0");
mapArea.put("钦州市","0");
mapArea.put("崇左市","0");
mapArea.put("柳州市","0");
mapArea.put("贺州市","0");
mapArea.put("防城港市","0");
mapArea.put("来宾市","0");
try {
areaNum=participantsMapper.countArea(cid);
for(ApplyParticipants applyParticipants:areaNum){
mapArea.put(applyParticipants.getArea(),applyParticipants.getNum());
}

} catch (Exception e) {
e.printStackTrace();
}
return mapArea;
}

根据地区进行统计人数,如果没有显示为0

原文:https://www.cnblogs.com/luYing666/p/11590646.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!