pageNo = CommUtil.getPageNO(req);
int pageSize = CommUtil.getPageSize(req);
IRisunSQL sql = new RisunSQLHelp("1=1");
String bData = req.getParameter("bDate");
String eData = req.getParameter("eDate");
if (Strings.IsNullOrEmpty(req.getParameter("orderNo"))) {
sql.append(" and orderNo ='" + req.getParameter("orderNo") + "'");
}
if (Strings.IsNullOrEmpty(req.getParameter("orderStatus")) && !"-1".equals(req.getParameter("orderStatus"))) {
sql.append(" and orderStatus = '" + req.getParameter("orderStatus") + "'");
}
if (Strings.IsNullOrEmpty(req.getParameter("orderType")) && !"0".equals(req.getParameter("orderType"))) {
sql.append(" and orderType = '" + req.getParameter("orderType") + "'");
}
if (Strings.IsNullOrEmpty(bData) && Strings.IsNullOrEmpty(eData)) {
bData += " 00:00:00";
eData += " 23:59:59";
sql.append(" and createDate BETWEEN'" + bData + "' and '" + eData + "'");
}
sql.append(" and softDelete='" + 0 + "' order by createDate desc");
boolean ca = isOk(req.getParameter("orderNo"),bData,eData);
if(ca){
pageNo = 0;
}
page = orderDao.findByWhere(sql, pageNo, pageSize);
7 回复
@wendal ok,谢谢提醒
@wendal IRisunSQL sql = new RisunSQLHelp("1=1"); 如何避免这种死值出现,给点思路呗
@lihongjie0209 IRisunSQL sql = new RisunSQLHelp("1=1");这种死值想规避掉
@wendal 感谢
添加回复
请先登陆