日期:2014-05-20  浏览次数:20941 次

关于在MAP里面做合计的问题
直接上代码:

  ResList = DB.select(); //SELECT方法,检索之后返回一个List
                int rowSize = ResList .size();

                if (rowSize != 0) {
                        for (int i = 0; i < 20; i++) {  //固定只输出20行,不够补空行
                            dataTmp = new HashMap<String, String>();
                            if(i < rowSize){
                                dataTmp.put("KENSU1",
                                    sqlRes_List.get(i).get("KENSU1").toString());
                                dataTmp.put("GAK1", sqlRes_List.get(i).get("GAK1")
                                    .toString());
                                dataTmp.put("KENSU2",
                                    sqlRes_List.get(i).get("KENSU2").toString());
                                dataTmp.put("GAK2", sqlRes_List.get(i).get("GAK2")
                                    .toString());
                                dataTmp.put("KENSU3",
                                    sqlRes_List.get(i).get("KENSU3").toString());
                                dataTmp.put("GAK3", sqlRes_List.get(i).get("GAK3")
                                    .toString());
                                dataTmp.put("KENSU4",