BigDecimal rootProgressiveHIE01 = (BigDecimal)pars.getOtherGridParams().get(ApplicationConsts.ROOT_PROGRESSIVE_HIE01);
BigDecimal progressiveHIE01 = (BigDecimal)pars.getOtherGridParams().get(ApplicationConsts.PROGRESSIVE_HIE01);
BigDecimal progressiveHIE02 = (BigDecimal)pars.getOtherGridParams().get(ApplicationConsts.PROGRESSIVE_HIE02);
CompanyHierarchyLevelVO vo = (CompanyHierarchyLevelVO)pars.getOtherGridParams().get(ApplicationConsts.TREE_FILTER);
if (vo!=null) {
progressiveHIE01 = vo.getProgressiveHIE01();
progressiveHIE02 = vo.getProgressiveHie02HIE01();
}
// retrieve companies list...
String companies = "";
for(int i=0;i<companiesList.size();i++)
companies += "'"+companiesList.get(i).toString()+"',";
companies = companies.substring(0,companies.length()-1);
String sql =
"select SCH10_CALL_OUTS.COMPANY_CODE_SYS01,SCH10_CALL_OUTS.CALL_OUT_CODE,A.DESCRIPTION,B.DESCRIPTION,"+
"SCH10_CALL_OUTS.PROGRESSIVE_HIE02,SCH10_CALL_OUTS.PROGRESSIVE_HIE01,SCH10_CALL_OUTS.PROGRESSIVE_SYS10"+
" from SCH10_CALL_OUTS,SYS10_COMPANY_TRANSLATIONS A,SYS10_COMPANY_TRANSLATIONS B,HIE01_COMPANY_LEVELS where "+
"SCH10_CALL_OUTS.PROGRESSIVE_HIE02=? and "+
"SCH10_CALL_OUTS.COMPANY_CODE_SYS01=A.COMPANY_CODE_SYS01 and "+
"SCH10_CALL_OUTS.PROGRESSIVE_SYS10=A.PROGRESSIVE and "+
"A.LANGUAGE_CODE=? and "+
"HIE01_COMPANY_LEVELS.COMPANY_CODE_SYS01=SCH10_CALL_OUTS.COMPANY_CODE_SYS01 and "+
"HIE01_COMPANY_LEVELS.PROGRESSIVE=SCH10_CALL_OUTS.PROGRESSIVE_HIE01 and "+
"HIE01_COMPANY_LEVELS.COMPANY_CODE_SYS01=B.COMPANY_CODE_SYS01 and "+
"HIE01_COMPANY_LEVELS.PROGRESSIVE=B.PROGRESSIVE and B.LANGUAGE_CODE=? and "+
"SCH10_CALL_OUTS.COMPANY_CODE_SYS01 in ("+companies+") and "+
"SCH10_CALL_OUTS.ENABLED='Y' ";
if (rootProgressiveHIE01==null || !rootProgressiveHIE01.equals(progressiveHIE01)) {
// retrieve all subnodes of the specified node...
pstmt = conn.prepareStatement(
"select HIE01_COMPANY_LEVELS.PROGRESSIVE,HIE01_COMPANY_LEVELS.PROGRESSIVE_HIE01,HIE01_COMPANY_LEVELS.LEV from HIE01_COMPANY_LEVELS "+
"where COMPANY_CODE_SYS01='"+vo.getCompanySys01HIE01()+"' and ENABLED='Y' and PROGRESSIVE_HIE02=? and PROGRESSIVE>=? "+
"order by LEV,PROGRESSIVE_HIE01,PROGRESSIVE"
);
pstmt.setBigDecimal(1,progressiveHIE02);
pstmt.setBigDecimal(2,progressiveHIE01);
ResultSet rset = pstmt.executeQuery();