<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="weaver.general.*" %>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="java.util.*" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="bb" class="weaver.general.BaseBean" />
<%
    List<Map<String,String>> dataList = new ArrayList<Map<String,String>>();
    Map<String,String> dataMap = new HashMap<>();

    String sql =" select top 10 h.id,h.lastname,h.sex,d.departmentname,e.zjf,e.syjfs from hrmresource h " +
                " inner join HrmDepartment d on d.id = h.departmentid " +
                " inner join uf_jftz e on e.jfhdr = h.id " +
                " where h.status in(1,2,3,4) order by e.zjf desc" ;
    bb.writeLog("sql:"+sql);
    rs.executeQuery(sql);
    while (rs.next()){
        String id = Util.null2String(rs.getString("id"));
        String lastname = Util.null2String(rs.getString("lastname"));
        String sex = Util.null2String(rs.getString("sex"));
        String departmentname = Util.null2String(rs.getString("departmentname"));
        String zjf = Util.null2o(rs.getString("zjf"));
        String syjfs = Util.null2o(rs.getString("syjfs"));

        dataMap = new HashMap<String, String>();
        dataMap.put("userid",id);
        dataMap.put("sex",sex);
        dataMap.put("lastname",lastname);
        dataMap.put("departmentname",departmentname);
        dataMap.put("zjf",zjf);
        dataMap.put("syjfs",syjfs);

        dataList.add(dataMap);
    }

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

    out.print(jsonObject.toString());
%>

