<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="weaver.general.BaseBean" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="java.util.*" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%
    RecordSet rs = new RecordSet();
    String billid = request.getParameter("billid");
    try{
        String citycom = "";
        String sql =" select id,citycom,modedatacreater from uf_threebatches where id="+billid+" and proamout > 50 and sfcj = 1 ";
        out.print("sql:"+sql+"</br>");
        rs.executeQuery(sql);
        if(rs.next()){
            citycom = Util.null2String(rs.getString("citycom"));
        }
        out.print("citycom:"+citycom+"</br>");

        sql =" select id,citycom,modedatacreater from uf_threebatches where id="+billid+"  ";
        out.print("sql:"+sql+"</br>");
        rs.executeQuery(sql);
        if(rs.next()){
            citycom = Util.null2String(rs.getString("citycom"));
        }
        out.print("citycom2:"+citycom+"</br>");

        sql =" select id,citycom,modedatacreater from uf_threebatches where id="+billid+" and proamout > 50 ";
        out.print("sql:"+sql+"</br>");
        rs.executeQuery(sql);
        if(rs.next()){
            citycom = Util.null2String(rs.getString("citycom"));
        }
        out.print("citycom3:"+citycom+"</br>");

        sql =" select id,citycom,modedatacreater from uf_threebatches where id="+billid+" and sfcj = 1 ";
        out.print("sql:"+sql+"</br>");
        rs.executeQuery(sql);
        if(rs.next()){
            citycom = Util.null2String(rs.getString("citycom"));
        }
        out.print("citycom4:"+citycom+"</br>");

        sql =   " select t.id \n" +
                "        from hrmdepartment t\n" +
                "        inner join hrmsubcompany k on k.id = t.subcompanyid1\n" +
                "        where k.subcompanycode='33000000'\n" +
                "        and nvl(t.canceled,0)=0 \n"  ;

        out.print("sql:"+sql+"</br>");
        rs.executeQuery(sql);
        while (rs.next()){
            String resourceid = Util.null2String(rs.getString("resourceid"));
            out.print("resourceid:"+resourceid+"</br>");
        }


        sql =
                "    select id from hrmresource where departmentid in(\n" +
                "        select t.id \n" +
                "        from hrmdepartment t\n" +
                "        inner join hrmsubcompany k on k.id = t.subcompanyid1\n" +
                "        where k.subcompanycode='33000000'\n" +
                "        and nvl(t.canceled,0)=0\n" +
                "    )\n" ;
        out.print("sql:"+sql+"</br>");
        rs.executeQuery(sql);
        while (rs.next()){
            String resourceid = Util.null2String(rs.getString("resourceid"));
            out.print("resourceid:"+resourceid+"</br>");
        }

        sql =   " select resourceid \n" +
                " from hrmrolemembers " +
                " where roleid = 29570 " +
                " and resourcetype=1 \n" +
                " and resourceid in(\n" +
                "    select id from hrmresource where departmentid in(\n" +
                "        select t.id \n" +
                "        from hrmdepartment t\n" +
                "        inner join hrmsubcompany k on k.id = t.subcompanyid1\n" +
                "        where k.subcompanycode='33000000'\n" +
                "        and nvl(t.canceled,0)=0\n" +
                "    )\n" +
                " ) " ;
        out.print("sql:"+sql+"</br>");
        rs.executeQuery(sql);
        while (rs.next()){
            String resourceid = Util.null2String(rs.getString("resourceid"));
            out.print("resourceid:"+resourceid+"</br>");
        }


    }catch (Exception e){
        out.print("e:"+e);
    }
%>
