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