list map

来源:互联网 发布:数据库日志已截断 编辑:程序博客网 时间:2024/05/29 01:55
    /**
* 资产运行情况(正常运行、设备停机、已监控、未监控)
     */
    @RequestMapping(value="show_Device", method=RequestMethod.POST, produces="text/json;charset=utf-8")
    @ResponseBody
    public Object show_deNormal(HttpServletRequest request,
    HttpServletResponse response){
   
    JSONObject data = new JSONObject();
        int onMachine = this.machineService.selectOnMachine();
        int offMachine= this.machineService.selectOffMachine();
        int onControl = this.machineService.selectonControl();
        int offControl = this.machineService.selectoffControl();
        
        Map<String, Object> machine=new HashMap<String, Object>();
        machine.put("正常运行",onMachine);
        machine.put("设备停机",offMachine);
        machine.put("已监控",onControl);
        machine.put("未监控",offControl);
      
//        Map<String, Object> offMa=new HashMap<String, Object>();
//        offMa.put("设备停机",offMachine);
//        
//        Map<String, Object> onCo=new HashMap<String, Object>();
//        onCo.put("已监控",onControl);
//        
//        Map<String, Object> offCo=new HashMap<String, Object>();
//        offCo.put("未监控",offControl);
        
//        
//        ArrayList<Integer> list=new ArrayList<Integer>();
//        list.add(new Map("正常运行",onMachine));
//        list.add(new Integer("设备停机",offMachine));
//        list.add(new Integer("已监控",onControl));
//        list.add(new Integer("未监控",offControl));
    if(machine!=null){
    data.put("data", machine);
    }
    return data.toString();
    }
原创粉丝点击