聚集函数查询:
public Long totalByTimeToRechargeRecord(String stime, String etime,
Long pointid) {
// TODO Auto-generated method stub
String sql="";
sql="select sum(zs.money) from Golddetailtopoint zs where zs.zspoint.pointId="+pointid +" and zs.gdtptime between '"+stime+"' and '"+etime+"' order by zs.gdtpId desc";
Long totalMoney = (Long)this.getSession().createQuery
(sql).uniqueResult();
return totalMoney;
}
avg(...),sum(...), min(...),max(...),count(...)