HrmRpAgeTemp.jsp
3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<%@ page import="weaver.general.Util" %>
<%@ page import="java.util.*" %>
<%@ page import="java.net.*" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %> <%@ include file="/systeminfo/init_wev8.jsp" %>
<jsp:useBean id="HrmSearchComInfo" class="weaver.hrm.search.HrmSearchComInfo" scope="session" />
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page" />
<%
String whereclause="";
int year=Util.getIntValue(request.getParameter("year"),0);
String[] resourcetypes=Util.TokenizerString2(request.getParameter("resourcetype"),",");
int departmentid=Util.getIntValue(request.getParameter("departmentid"),0);
Calendar today = Calendar.getInstance();
int curyear=today.getTime().getYear()+1900;
int ishead=0;
if(departmentid==0) whereclause="";
else whereclause=" departmentid="+departmentid;
if(Util.contains(resourcetypes,"2")){
if(whereclause.equals("")) whereclause=" resourcetype in('2";
else whereclause+=" and resourcetype in('2";
ishead=1;
}
if(Util.contains(resourcetypes,"1")){
if(whereclause.equals("")) whereclause=" resourcetype in('1";
else{
if(ishead==0) whereclause+=" and resourcetype in('1";
else whereclause+="','1";
}
ishead=1;
}
if(Util.contains(resourcetypes,"3")){
if(whereclause.equals("")) whereclause=" resourcetype in('3";
else{
if(ishead==0) whereclause+=" and resourcetype in('3";
else whereclause+="','3";
}
ishead=1;
}
if(Util.contains(resourcetypes,"4")){
if(whereclause.equals("")) whereclause=" resourcetype in('4";
else{
if(ishead==0) whereclause+=" and resourcetype in('4";
else whereclause+="','4";
}
ishead=1;
}
if(ishead==1) whereclause+="')";
if(year==19){
if(whereclause.equals("")) whereclause=" ("+curyear+"-left(birthday,4))<="+year;
else whereclause+=" and ("+curyear+"-left(birthday,4))<="+year;
}
else if(year==55){
if(whereclause.equals("")) whereclause=" (birthday<>'' and birthday is not null) and ("+curyear+"-left(birthday,4))>="+year;
else whereclause+=" and (birthday<>'' and birthday is not null) and ("+curyear+"-left(birthday,4))>="+year;
}
else if(year==0){
if(whereclause.equals("")) whereclause=" (birthday='' or birthday is null)";
else whereclause+=" and (birthday='' or birthday is null)";
}
else{
int endyear=year+4;
if(whereclause.equals("")) whereclause=" ("+curyear+"-left(birthday,4))>="+year+" and ("+curyear+"-left(birthday,4))<="+endyear;
else whereclause+=" and ("+curyear+"-left(birthday,4))>="+year+" and ("+curyear+"-left(birthday,4))<="+endyear;
}
HrmSearchComInfo.resetSearchInfo();
HrmSearchComInfo.setResourcesql(whereclause);
HrmSearchComInfo.setOrderby("id");
out.print(whereclause);
int userid=user.getUID();
RecordSet.executeSql("select dspperpage from HrmUserDefine where userid="+userid);
RecordSet.next();
String perpage=RecordSet.getString("dspperpage");
if(perpage.equals("")) perpage="10";
response.sendRedirect("/hrm/search/HrmResourceSearchResult.jsp?");
%>