hql.append(" AND a.writeTime >= :beginTime AND a.writeTime < :endTime");
}
hql.append(" ORDER BY a.id DESC");
try {
Session ssn = getSession();
Query q = ssn.createQuery(hql.toString());
q.setInteger("status", DiaryBean.STATUS_NORMAL);
q.setInteger("cat_type", CatalogBean.TYPE_OWNER);
if(year > 0 || month > 0 || date > 0){
Calendar[] cals = genTimeParams(year,month,date);
q.setTimestamp("beginTime", cals[0].getTime());