• 根据地区进行统计人数,如果没有显示为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;
    }
  • 相关阅读:
    ios实现下拉刷新,上拉加载
    ios实现瀑布流
    ios收货地址三级联动选择
    ios仿淘宝管理收货地址demo
    引用传值
    继承小结
    is操作符和as操作符
    抽象类和object类
    重写基类
    派生
  • 原文地址:https://www.cnblogs.com/luYing666/p/11590646.html
Copyright © 2020-2023  润新知