日期:2014-05-17 浏览次数:20724 次
select toolName ,count(*) as c from Km_Toolclick_Cnt where 1=1 group by toolName;
DetachedCriteria dc = DetachedCriteria.forClass(KmToolclickCnt.class);
if(!ValidateUtils.isEmpty(toolbarclick.getToolName())){
dc.add(Restrictions.ilike("toolName", toolbarclick.getToolName()));
}
if(!ValidateUtils.isEmpty(beginDate)){
dc.add(Restrictions.gt("goTime", beginDate));
}
if(!ValidateUtils.isEmpty(endDate)){
dc.add(Restrictions.lt("goTime", endDate));
}
//dc.setProjection(Property.forName("toolName").group());
dc.setProjection(Projections.alias(Projections.groupProperty("toolName"),"toolName"));
//dc.setProjection(Projections.alias(Projections.rowCount(),"count"));