generate_borrow_condition.jsp
资源名称:NetOffice.rar [点击查看]
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:3k
源码类别:
电子政务应用
开发平台:
Java
- <%@ page import="java.util.*" %>
- <%@ page import="com.vnex.intranet.util.*" %>
- <%@ page import="com.vnex.intranet.archives.value.ConditionBean" %>
- <%
- session.removeAttribute("condition");
- String borrowDate = request.getParameter("borrowDate");
- String displayId = request.getParameter("displayId");
- String archiveTitle = request.getParameter("archiveTitle");
- String borrower = request.getParameter("borrower");
- String returnDate = request.getParameter("returnDate");
- ConditionBean bean = new ConditionBean();
- bean.setBorrowDate(borrowDate);
- bean.setDisplayId(displayId);
- bean.setArchiveTitle(archiveTitle);
- bean.setBorrower(borrower);
- bean.setReturnDate(returnDate);
- String condition = "";
- CommonDBOperation cdb = new CommonDBOperation();
- String DBProductName = cdb.getDBProduct();
- if(DBProductName.startsWith("Oracle"))
- {
- if(borrowDate != null && !borrowDate.equals(""))
- condition += " and to_char(borrow_date, 'yyyy-mm-dd') = '"+borrowDate+"' ";
- if(displayId != null && !displayId.equals(""))
- condition += " and archive_id in (select archive_id from t_archive where archive_display_id like '%"+displayId+"%') ";
- if(archiveTitle != null && !archiveTitle.equals(""))
- condition += " and archive_id in (select archive_id from t_archive where archive_title like '%"+archiveTitle+"%') ";
- if(borrower != null && !borrower.equals(""))
- condition += " and borrower_id in (select emp_id from t_emp where name like '%"+borrower+"%') ";
- if(returnDate != null && !returnDate.equals(""))
- condition += " and to_char(return_date, 'yyyy-mm-dd') = '"+returnDate+"' ";
- }
- else if(DBProductName.startsWith("Microsoft SQL Server"))
- {
- if(borrowDate != null && !borrowDate.equals(""))
- condition += " and CONVERT(char(10),borrow_date,20) = '"+borrowDate+"' ";
- if(displayId != null && !displayId.equals(""))
- condition += " and archive_id in (select archive_id from t_archive where archive_display_id like '%"+cdb.changeCode(displayId)+"%') ";
- if(archiveTitle != null && !archiveTitle.equals(""))
- condition += " and archive_id in (select archive_id from t_archive where archive_title like '%"+cdb.changeCode(archiveTitle)+"%') ";
- if(borrower != null && !borrower.equals(""))
- condition += " and borrower_id in (select emp_id from t_emp where name like '%"+cdb.changeCode(borrower)+"%') ";
- if(returnDate != null && !returnDate.equals(""))
- condition += " and CONVERT(char(10),return_date,20) = '"+returnDate+"' ";
- }
- session.setAttribute("condition", condition);
- session.setAttribute("conditionBean", bean);
- %>
- <html>
- <head>
- <script language=javascript>
- function forward()
- {
- document.location = "/mainctrl/archive/borrowArchiveList?search";
- }
- </script>
- </head>
- <body onload="javascript:forward()">
- </body>
- <html>