@Override
public Pagination findPagination(Map<String, Object> queryMap,
int currentPage, int pageSize) throws ParseException
{
SystemNoticeCriteria systemNoticeCriteria = new SystemNoticeCriteria();
Criteria criteria = systemNoticeCriteria.createCriteria();
// 设置搜索条件参数
if (queryMap != null)
{
if (queryMap.containsKey("title"))
{
criteria.andTitleLike("%" + (String) queryMap.get("title") + "%");
}
if (queryMap.containsKey("content"))
{
criteria.andContentLike("%" + (String) queryMap.get("content") + "%");
}
if (queryMap.containsKey("startTime"))
{
if(queryMap.containsKey("endTime"))
{
criteria.andSendTimeBetween(
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse((String) queryMap.get("startTime")),
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse((String) queryMap.get("endTime")));
}
else
{
criteria.andSendTimeBetween(
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse((String) queryMap.get("startTime")),
new Date());
}
}
if (queryMap.containsKey("target"))
{
criteria.andTargetEqualTo(Short.parseShort((String) queryMap.get("target")));
}
}
// 设置分页参数
systemNoticeCriteria.setPageSize(pageSize);
systemNoticeCriteria.setStartIndex((currentPage - 1) * pageSize);
List<SystemNotice> items = systemNoticeMapper.selectByCriteria(systemNoticeCriteria);
for(SystemNotice sn : items)
{
// 公告人