@Override
public List<Object> getPageAnnouncement(Announcement announcement,Page page) {
if(announcement!=null){
StringBuffer sb=new StringBuffer("from Announcement where 1=1");
Map<String, Object> params=new HashMap<String, Object>();
if(announcement!=null){
if(announcement.getTitle()!=null&&!"".equals(announcement.getTitle())){
sb.append(" and title =:title");
params.put("title", announcement.getTitle());
}
if(announcement.getPublishtime()!=null){
sb.append(" and publishtime =:publishtime");
params.put("publishtime", announcement.getPublishtime());
}
}
Integer pageIndex = null;
Integer pageSize = null;
if(page!=null){
pageIndex = page.getPageIndex();
pageSize = page.getPageSize();
}
return dao.getobObjects(sb.toString(), params, pageIndex, pageSize);
}
return null;
} |
|