|
楼主 |
发表于 2014-8-19 13:21:32
|
显示全部楼层
//会议室安排
public static Document getRoomQueryData1(String roomDate,String roomIDStr,String roomFilterStr)
{
Element root = DocumentHelper.createElement("root");
Document doc = DocumentHelper.createDocument(root);
Element queryBoardroom = root.addElement("queryBoardroom");
String qsql = "select to_char(t.ID) as ID,t.VALUE_2,t.VALUE_1 " +
"from PARAMGROUP t" +
" where "+roomIDStr+" and ID = '703' order by t.VALUE_1 asc";
HashMap<String, String> sqlMap = new HashMap<String, String>();
sqlMap.put(DatabaseProduct.ORACLE.name(), qsql);
Table table = SQL.select(sqlMap, null, "/HKBF/HR/Meeting/data");
Iterator<Row> rows = table.iterator();
Element data = queryBoardroom.addElement("root").addElement("data");
Element arrs = data.addElement("rows");
while (rows.hasNext()){
Row row = rows.next();
Element arr = arrs.addElement("row");
arr.addElement("OA_MT_Boardroom").setText(row.getString("VALUE_1"));//会议室主键
arr.addElement("fName").setText(row.getString("VALUE_2"));
Element fCode = arr.addElement("fCode");
if(row.getString("VALUE_1")!=null){
fCode.setText(row.getString("VALUE_1"));
}
}
// ====================================================================已安排的
Element arrangeQueryResult = root.addElement("arrangeQueryResult");
String arrangeQueryResultSql = "select to_char(a.LOCATION_NO) as LOCATION_NO,a.LOCATION_NAME,to_char(TO_CHAR(MEET_START_DATETIME,'YYYY-MM-DD')||'T'||TO_CHAR(MEET_START_DATETIME,'HH24:MI:SS')||'.000Z') as MEET_START_DATETIME," +
"to_char(TO_CHAR(MEET_END_DATETIME,'YYYY-MM-DD')||'T'||TO_CHAR(MEET_END_DATETIME,'HH24:MI:SS')||'.000Z') as MEET_END_DATETIME,a.SUBJECT_LONG_NAME,a.ORGANIZER_NAME from MEETING_HEAD a where " +
"a.MEET_START_DATETIME <= to_date(concat('"+roomDate+"' ,' 23:59:59'),'yyyy-mm-dd,hh24:mi:ss') " +
"and a.MEET_END_DATETIME >= to_date(concat('"+roomDate+"' ,'00:00:00'),'yyyy-mm-dd,hh24:mi:ss')" +
"and a.FINISH_STATUS='1' and a.STATUS='1' and"+roomFilterStr;
HashMap<String, String> sqlMap2 = new HashMap<String, String>();
sqlMap2.put(DatabaseProduct.ORACLE.name(), arrangeQueryResultSql);
Table tabArrangeQueryResult = SQL.select(sqlMap2, null, "/HKBF/HR/Meeting/data");
Iterator<Row> rowArrangeQueryResults = tabArrangeQueryResult.iterator();
Element dataArrangeQueryResult = arrangeQueryResult.addElement("root").addElement("data");
Element arrArrangeQueryResults = dataArrangeQueryResult.addElement("rows");
while (rowArrangeQueryResults.hasNext()){
Row rowArrangeQueryResult = rowArrangeQueryResults.next();
Element arrDataApplyQueryResult = arrArrangeQueryResults.addElement("row");
arrDataApplyQueryResult.addElement("fBoardroomID").setText(rowArrangeQueryResult.getString("LOCATION_NO"));
arrDataApplyQueryResult.addElement("fBoardroom").setText(rowArrangeQueryResult.getString("LOCATION_NAME"));
arrDataApplyQueryResult.addElement("fBeginTime").setText(getValue(rowArrangeQueryResult.getValue("MEET_START_DATETIME").toString(),""));
arrDataApplyQueryResult.addElement("fEndTime").setText(getValue(rowArrangeQueryResult.getValue("MEET_END_DATETIME").toString(), ""));
arrDataApplyQueryResult.addElement("fMeetName").setText(rowArrangeQueryResult.getString("SUBJECT_LONG_NAME"));//会议名称必填
Element fUsePsnName = arrDataApplyQueryResult.addElement("fUsePsnName");
if(rowArrangeQueryResult.getString("ORGANIZER_NAME")!=null){
fUsePsnName.setText(rowArrangeQueryResult.getString("ORGANIZER_NAME"));
}
}
return doc;
} |
|