Map mailSizeInfo= new HashMap();
                 try{
                                String sql = " select count(*) as mailCount,Mail_box_coding as mailCoding from oa_mail    where ISSUANCE_ID =:userId    group by Mail_box_coding";
                                SQLQuery sqlQuery = (SQLQuery) super.getSession().createSQLQuery(sql).setString( "userId",userId);
                                List students = sqlQuery.list();
                                 for (Iterator iterator = students.iterator(); iterator.hasNext();) {
                                Object[] mailInfo = iterator.next();
                                             logger.info( "查询出的结果mailInfo    mailCount"+mailInfo[0]+ "mailCoding"+mailInfo[1]);
                                         mailSizeInfo.put(mailInfo[1],mailInfo[0]);
                                }
                } catch(Exception ex){
                        ex.printStackTrace();
                         throw new PageJumpException();
                }
将查询结果放入到map中
到业务逻辑处理中将map中的值取出来,并组装成需要的数据格式
     String record="";
                Iterator it = mailSizeInfo.entrySet().iterator();
                 while (it.hasNext()){
                        Map.Entry pairs = (Map.Entry)it.next();
                        logger.info(pairs.getKey() + " = " + pairs.getValue());
                        String recordNode=pairs.getKey()+ ":'" +pairs.getValue()+ "'";
                             if (record.length() == 0) {
                                        record = recordNode;
                                } else {
                                        record = record + "," + recordNode;
                                }
                }
                String recordsJson = "{"+record + "}";