<%@ page import="java.util.Map" %>
<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%

    List<Map<String,String>> list = new ArrayList<Map<String,String>>();
    RecordSet rs = new RecordSet();
    String sql =" select t.sm,t.yb,t.jd,t.wd,count(k.id) as cou\n" +
                " from uf_sjsj t\n" +
                " left join uf_zzdwdzxx k on k.szs = t.id\n" +
                " group by t.sm,t.yb,t.jd,t.wd ";

    rs.executeQuery(sql);
    while (rs.next()){
        String adcode = rs.getString("yb");
        String name = rs.getString("sm");
        String jd = rs.getString("jd");
        String wd = rs.getString("wd");
        String center = "["+jd+","+wd+"]";
        String cou = rs.getString("cou");

        Map<String,String> map = new HashMap<String,String>();
        map.put("adcode",adcode);
        map.put("name",name);
        map.put("center",center);
        map.put("num",cou);
        list.add(map);
    }

    JSONObject dataJson = new JSONObject();
    dataJson.put("data",list);

%>

<%=dataJson.toJSONString() %>

