<%@page import="weaver.conn.RecordSet"%>
<%@ page import="org.apache.commons.lang3.StringUtils" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="java.util.*" %>
<%@ page import="weaver.conn.RecordSetDataSource" %>
<jsp:useBean id="bb" class="weaver.general.BaseBean" scope="page" />
<%@ page language="java" contentType="text/html; charset=UTF-8" %>

<%

    String dataResource = "E7TEST";

    List<String> E7GroupList = getE7HrmGroupList(dataResource);
    List<String> E9GroupList = getE9HrmGroupList();

    String E7IDS = "";
    out.println("E7比E9多的:</br>");
    for(String e7id : E7GroupList){
        if(!E9GroupList.contains(e7id)){
            E7IDS += StringUtils.isBlank(E7IDS) ? e7id : ","+e7id ;
        }
    }
    out.println(E7IDS+"</br>");

    out.println("E9比E7多的:</br>");
    String E9IDS = "";
    for(String e9id : E9GroupList){
        if(!E7GroupList.contains(e9id)){
            E9IDS += StringUtils.isBlank(E9IDS) ? e9id : ","+ e9id ;
        }
    }
    out.println(E9IDS+"</br>");

%>

<%!
    public List<String> getE7HrmGroupList(String dataResource){

        RecordSetDataSource rsd = new RecordSetDataSource(dataResource);
        List<String> groupList = new ArrayList<String>();
        String sql = " select id from hrmjobgroups" ;
        rsd.execute(sql);
        while (rsd.next()){
            String id = Util.null2String(rsd.getString("id"));
            groupList.add(id);
        }
        return groupList;
    }

    public List<String> getE9HrmGroupList(){

        RecordSet rsd = new RecordSet();
        List<String> groupList = new ArrayList<String>();
        String sql = " select outkey from hrmjobgroups" ;
        rsd.execute(sql);
        while (rsd.next()){
            String outkey = Util.null2String(rsd.getString("outkey"));
            groupList.add(outkey);
        }
        return groupList;
    }



%>




