62,614
社区成员
发帖
与我相关
我的任务
分享
public PagerModel getSal(int firstResult, int maxResults, Date startdate,Date enddate) {
String hql = "select count(*) from Salary where month between" + " " + startdate + " " + "and" + " " + enddate;
int total = ((Long)sessionFactory.getCurrentSession().createQuery(hql).uniqueResult()).intValue();
List datas = sessionFactory.getCurrentSession().createQuery("select s from Salary as s where month between" + " " + startdate + " " + "and" + " " + enddate)
.setFirstResult(firstResult)
.setMaxResults(maxResults).list();
PagerModel pm = new PagerModel();
pm.setTotal(total);
pm.setDatas(datas);
return pm;
}
select count(*) from Salary where month between to_date("+startdate +",'YYYY-MM-DD') and to_date("+startdate +",'YYYY-MM-DD')