<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="weaver.general.*" %>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="weaver.hrm.*" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="bb" class="weaver.general.BaseBean" />
<%
    JSONObject result = new JSONObject();
    User user = HrmUserVarify.getUser(request, response);
    int useridd = user.getUID();
    if(useridd == 1) { //系统管理员
        useridd = 383;  // 刘善玉
    }

    String sql =" select e.id,e.lastname,e.sex,d.departmentname,j.jobtitlename,h.zjf,h.dhjf,h.syjfs from uf_jftz  h " +
            " inner join HrmDepartment d on d.id = h.jfhdrbm " +
            " inner join hrmjobtitles j on j.id = h.jfhdrgw " +
            " inner join hrmresource e on e.id = h.jfhdr " +
            " where e.status in(1,2,3,4) and h.jfhdr = ? " ;
    bb.writeLog("sql:"+sql);
    rs.executeQuery(sql,useridd);
    while (rs.next()){

        String userid = Util.null2String(rs.getString("id"));
        String lastname = Util.null2String(rs.getString("lastname"));
        String sex = Util.null2String(rs.getString("sex"));
        String departmentname = Util.null2o(rs.getString("departmentname"));
        String jobtitlename = Util.null2o(rs.getString("jobtitlename"));
        String zjf = Util.null2o(rs.getString("zjf"));
        String dhjf = Util.null2o(rs.getString("dhjf"));
        String syjfs = Util.null2o(rs.getString("syjfs"));
        String imgurl = "/messager/images/icon_m_wev9.png";
        if("1".equals(sex)){
            imgurl = "/messager/images/icon_w_wev9.png";
        }

        result.put("userid",userid);
        result.put("lastname",lastname);
        result.put("sex",sex);
        result.put("imgurl",imgurl);
        result.put("departmentname",departmentname);
        result.put("jobtitlename",jobtitlename);
        result.put("zjf",zjf);
        result.put("dhjf",dhjf);
        result.put("syjfs",syjfs);
    }

    out.print(result.toJSONString());
%>

