日期:2014-05-19 浏览次数:20724 次
select a.name,sum(t.actualUseNumber) 测样数目
from testTotal t,adminInfo a,order_instrument o
where a.id = t.adminId and o.id = t.instrumentId and sysTime between '2012-10-01' and '2012-12-01'
group by a.name
public List<TestTotal> findBySysTime(Timestamp startTime,Timestamp endTime) {
return this.getHibernateTemplate().find("select t.adminInfo.name, count(t.actualUseNumber) from TestTotal as t where t.sysTime bewteen '"+startTime+"' and '"+endTime+"'"+" group by t.adminInfo.name");
}
org.springframework.orm.hibernate3.HibernateQueryException: unexpected token: bewteen near line 1, column 105 [select t.adminInfo.name, count(t.actualUseNumber) from com.yaxing.entity.TestTotal as t where t.sysTime bewteen '2012-11-01 15:14:11.0' and '2012-11-14 15:14:14.0' group by t.adminInfo.name]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: unexpected token: bewteen near line 1, column 105 [select t.adminInfo.name, count(t.actualUseNumber) from com.yaxing.entity.TestTotal as t where t.sysTime bewteen '2012-11-01 15:14:11.0' and '2012-11-14 15:14:14.0' group by t.adminInfo.name]
org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:660)
org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
<s:iterator value="listTestTotal" id="listTestTotal" status="a">
<s:if test="listTestTotal!=null">
<tr>
<td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1"> <s:property value="#a.index+1"/></span> </div></td>
<td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1"><s:property value="#listTestTotal[0]"/></span></div></td>
<td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1"><s:property value="#listTestTotal[1]"/> </span></div></td>