|
|
|
@ -35,9 +35,9 @@ public class search_fly extends HttpServlet {
|
|
|
|
|
|
|
|
|
|
String departure = req.getParameter("departure");
|
|
|
|
|
String destination = req.getParameter("destination");
|
|
|
|
|
String departureYear = req.getParameter("departureYear");
|
|
|
|
|
String departureMonth = req.getParameter("departureMonth");
|
|
|
|
|
String departureDay = req.getParameter("departureDay");
|
|
|
|
|
//String departureYear = req.getParameter("departureYear");
|
|
|
|
|
//String departureMonth = req.getParameter("departureMonth");
|
|
|
|
|
//String departureDay = req.getParameter("departureDay");
|
|
|
|
|
String date=req.getParameter("date");
|
|
|
|
|
String sql = null;
|
|
|
|
|
/*
|
|
|
|
@ -47,12 +47,7 @@ public class search_fly extends HttpServlet {
|
|
|
|
|
} else {
|
|
|
|
|
sql = "SELECT * FROM flight WHERE 1=1";
|
|
|
|
|
|
|
|
|
|
if (!departure.isEmpty()) {
|
|
|
|
|
sql += " AND f_s_p='" + departure + "'";
|
|
|
|
|
}
|
|
|
|
|
if (!destination.isEmpty()) {
|
|
|
|
|
sql += " AND f_a_p='" + destination + "'";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!departureYear.isEmpty() && !departureMonth.isEmpty() && !departureDay.isEmpty()) {
|
|
|
|
|
// 楠岃瘉鏃ユ湡鏍煎紡
|
|
|
|
|
try {
|
|
|
|
@ -76,8 +71,15 @@ public class search_fly extends HttpServlet {
|
|
|
|
|
} else {
|
|
|
|
|
// 构建SQL查询语句
|
|
|
|
|
sql = "SELECT * FROM flight WHERE 1=1";
|
|
|
|
|
sql += " AND DATE(f_Date)='" + date + "'";
|
|
|
|
|
|
|
|
|
|
if(!date.isEmpty()) {
|
|
|
|
|
sql += " AND DATE(f_Date)='" + date + "'";
|
|
|
|
|
}
|
|
|
|
|
if (!departure.isEmpty()) {
|
|
|
|
|
sql += " AND f_s_p='" + departure + "'";
|
|
|
|
|
}
|
|
|
|
|
if (!destination.isEmpty()) {
|
|
|
|
|
sql += " AND f_a_p='" + destination + "'";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
db_conn conn = new db_conn();
|
|
|
|
|
ArrayList<flight> flightlist = new ArrayList<flight>();
|
|
|
|
|