我就是敲了这些代码之后报的错误private String getCondition() {String whereHQL = "";if (messagestatisticsForm.getSendMobileID() != null) {whereHQL = " where sendMobileID="+ messagestatisticsForm.getSendMobileID();} if (!StringUtils.isBlank(messagestatisticsForm.getCreateTimeStart())) {
if ("".equals(whereHQL)) {
whereHQL = " where createTimeStart>='"
+ messagestatisticsForm.getCreateTimeStart() + "'";
} else {
whereHQL = " and createTimeStart>='"
+ messagestatisticsForm.getCreateTimeStart() + "'";
}
}
if (!StringUtils.isBlank(messagestatisticsForm.getCreateTimeEnd())) {
if ("".equals(whereHQL)) {
whereHQL = " where createTimeEnd<='"
+ messagestatisticsForm.getCreateTimeEnd() + "'";
} else {
whereHQL = " and createTimeEnd<='"
+ messagestatisticsForm.getCreateTimeEnd() + "'";
}
}
// whereHQL += " order by id";
return whereHQL;
}控制台中报的错误ERROR [org.hibernate.hql.PARSER] - line 1:56: unexpected token: and
添加回答
举报
0/150
提交
取消