|
楼主 |
发表于 2015-8-3 10:59:32
|
显示全部楼层
Map<String, Object> params = new HashMap<String, Object>();
params.put("dateF", dateF);
params.put("cardId", cardId);
params.put("dateF", dateF);
params.put("dateT", dateT);
params.put("mealType", mealType);
params.put("orderStatus", orderStatus);
params.put("mealTime", mealTime);
params.put("orderId", orderId);
String sql = "select a.DDBH,a.XDSJ,a.XM from DC_DDB a";
String searchStr = "";
if (cardId != null && !cardId.trim().isEmpty()) {
searchStr += " a.YGKH=:cardId and";
}
// if(dateF !=null && !dateF.trim().isEmpty()){
searchStr += " a.XDSJ>:dateF and";
// }
if (mealType != null && !mealType.trim().isEmpty()) {
searchStr += " a.DDLX=:mealType and";
}
if (orderStatus != null && !orderStatus.trim().isEmpty()) {
searchStr += " a.DDZT=rderStatus and";
}
if (mealTime != null && !mealTime.trim().isEmpty()) {
searchStr += " a.CCBH=:mealTime";
}
if (!searchStr.isEmpty()) {
searchStr = " where" + searchStr;
if (searchStr.endsWith(" and")) {
searchStr = searchStr.substring(0, sql.length() - 4);
}
}
System.out.println(sql + searchStr);
Table ddbTable = KSQL.select(sql + searchStr, params, "/BJBusWYST/scj/data", null);
return ddbTable;
|
|