📄 generate_return_condition.jsp
字号:
<%@ 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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -