String create_time = (String) map.get("create_time");
String ctnNo = (String) map.get("ctnNo");
String ladingBillNumber = (String) map.get("ladingBillNumber");
String state = (String) map.get("state");
String page = (String) map.get("page");
String size = (String) map.get("size");
Sql sql = dao.sqls().create("fxDaoImpl.packingList");// 查询的全部
StringBuffer cnd = new StringBuffer();
if (!"".equals(StringUtil.nvl(create_time))) {
cnd.append(" and date(create_time) = '" + create_time + "' ");
}
if (!"".equals(StringUtil.nvl(ctnNo))) {
cnd.append(" and ctnNo = '" + ctnNo + "' ");
}
if (!"".equals(StringUtil.nvl(ladingBillNumber))) {
cnd.append(" and ladingBillNumber = '" + ladingBillNumber + "' ");
}
if (!"".equals(StringUtil.nvl(state))) {
if("0".equals(state)) {
cnd.append(" and state in(1,2)");
}else {
cnd.append(" and state = '" + state + "' ");
}
}
cnd.append("order by create_time DESC ");
sql.vars().set("condition", cnd.toString());
int pageNumber = StringUtil.parseInt(page);
int pageSize = StringUtil.parseInt(size);
return this.findPaginationBySqls(sql, pageNumber, pageSize);