<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%
    RecordSet rs = new RecordSet();
    List<Map<String,String>> requestList = new ArrayList<Map<String,String>>();
    try{
        String sql =" select t.requestid,t.id,k.currentnodetype \n" +
                    " from formtable_main_2992 t \n" +
                    " inner join workflow_requestbase k on k.requestid = t.requestid\n" +
                    " where currentnodetype in(1,2,3,5) " +
                    " order by t.learndate desc ";
        rs.executeQuery(sql);
        int xh = 1;
        while (rs.next()){
            String requestid = Util.null2String(rs.getString("requestid"));
            String id = Util.null2String(rs.getString("id"));
            Map<String,String> map = new HashMap<String,String>();
            map.put("mainid",id);
            map.put("requestid",requestid);
            map.put("xh",xh+"");
            requestList.add(map);
            xh++;
        }
    }catch (Exception e){

    }

    JSONObject jsonObject = new JSONObject();
    jsonObject.put("datas",requestList);
%>

<%=jsonObject.toJSONString() %>