@Override
public Pagination findPagination(Map<String, Object> queryMap,
int currentPage, int pageSize) throws ParseException
{
CustomerCriteria customerCriteria = new CustomerCriteria();
Criteria criteria = customerCriteria.createCriteria();
// 设置搜索条件参数
if (queryMap != null)
{
if (queryMap.containsKey("loginEmail"))
{
criteria.andLoginEmailLike("%" + (String) queryMap.get("loginEmail") + "%");
}
if (queryMap.containsKey("mobilePhone"))
{
criteria.andMobilePhoneLike("%" + (String) queryMap.get("mobilePhone") + "%");
}
if (queryMap.containsKey("isEnabled"))
{
criteria.andIsEnabledEqualTo(Short.parseShort((String) queryMap.get("isEnabled")));
}
if (queryMap.containsKey("startTime"))
{
if(queryMap.containsKey("endTime"))
{
criteria.andRegisterTimeBetween(
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.andRegisterTimeBetween(
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse((String) queryMap.get("startTime")),
new Date());
}
}
}