<%@ page import="weaver.general.*" %>
<%@page import="weaver.conn.RecordSet"%>
<%@ page import="org.apache.commons.lang3.StringUtils" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="java.util.HashMap" %>
<jsp:useBean id="bb" class="weaver.general.BaseBean" scope="page" />
<%@ page language="java" contentType="text/html; charset=UTF-8" %>

<%
    List<Map<String,String>> dataList = new ArrayList<Map<String,String>>();
    Map<String,String> dataMap = null;
    RecordSet rs = new RecordSet();
    String seccategory = Util.null2String(request.getParameter("seccategory"));
    if(StringUtils.isNotBlank(seccategory)){
        String sql = " select docsubject,id,doccreatedate,doccreatetime from docdetail  \n" +
                    " where seccategory="+seccategory+"  \n" + // and doccreatedate >= DATEADD(day, -7, GETDATE())
                    " order by doccreatedate desc, doccreatetime desc ";
        rs.executeQuery(sql);
        while (rs.next()){
            String id = Util.null2String(rs.getString("id"));
            String docsubject = Util.null2String(rs.getString("docsubject"));
            String doccreatedate = Util.null2String(rs.getString("doccreatedate"));
            String doccreatetime = Util.null2String(rs.getString("doccreatetime"));

            dataMap = new HashMap<String, String>();
            dataMap.put("userid",id);
            dataMap.put("docsubject",docsubject);
            dataMap.put("doccreatedate",doccreatedate);
            dataMap.put("doccreatetime",doccreatetime);
            dataList.add(dataMap);
        }
    }

    JSONObject jsonObject = new JSONObject();
    jsonObject.put("data",dataList);


%>
<%=jsonObject.toString()  %>


