public String getCodeDataConfig(){
List list = new ArrayList();
String lookup_type = request().getParameter("lookup_type");
String condition = request().getParameter("conditions");
String celId = request().getParameter("celId");
String dir = ServletActionContext.getServletContext().getRealPath("/");
System.out.println("dir="+dir);
try {
FileReader fr = new FileReader(dir + "/WEB-INF/classes/com/dvnchina/boss/util/cache/CODE_DATA_CONFIG.properties");
BufferedReader buf = new BufferedReader(fr);
String line = null;
while((line = buf.readLine()) != null){
// System.out.println(line);
list.add(line);
}
buf.close();
fr.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println(list.size());
List resultList1 = new ArrayList();//存储bs_tb_lookup_cde表中的数据
List resultList2 = new ArrayList();//存储有BS_TB表中对应的数据
for(int i=0;i<list.size();i++){
String str = (String)list.get(i);
String strs[] = str.split("=");
String s1 = strs[0].trim();
String s2 = strs[1].trim();
if(s1.equals(lookup_type)) {
if(s2.indexOf("BS_TB") != -1){
resultList2.add(s2);
}else {
resultList1.add(s2);
}
break;
}
}
String sql1 = "select l.lookup_cde,l.cde_dscr from bs_tb_lookup_cde l where l.lookup_type ="+"'"+resultList1.get(0).toString().trim() +"'";
StringBuffer sql = new StringBuffer(sql1);
sql.append(" ");
sql.append("and 1=1");
if( condition != null && condition.length()>0){
sql.append("and");
sql.append(" ");
sql.append(condition);
}
List result = SpringJdbcTemplateUtil.getInstance().querySpecifiedResultBySql(sql.toString());
System.out.println(sql.toString());
result.add(result.size(), celId);
return super.getMacroReturnPage(result);
}