zoukankan      html  css  js  c++  java
  • 根据地区进行统计人数,如果没有显示为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;
    }
  • 相关阅读:
    C#删除一个字符串数组中的空字符串
    .Net后台获取客户端信息
    Java Script
    ECMAScript闭包,ECMAScript对象
    Java Script函数、变量、对象
    JavaScript3
    JavaScript-2
    变量
    8.22收获
    html
  • 原文地址:https://www.cnblogs.com/luYing666/p/11590646.html
Copyright © 2011-2022 走看看