@Override
public Pagination findPagination(Map<String, Object> queryMap,
int currentPage, int pageSize)
{
RestaurantCriteria restaurantCriteria = new RestaurantCriteria();
Criteria criteria = restaurantCriteria.createCriteria();
// 设置搜索条件参数
if (queryMap != null)
{
if (queryMap.containsKey("merchantId"))
{
criteria.andMerchantIdEqualTo(Long.parseLong((String) queryMap.get("merchantId")));
}
if (queryMap.containsKey("name"))
{
criteria.andNameLike("%" + (String) queryMap.get("name") + "%");
}
if (queryMap.containsKey("address"))
{
criteria.andAddressLike("%" + (String) queryMap.get("address") + "%");
}
if (queryMap.containsKey("contactName"))
{
criteria.andContactNameLike("%" + (String) queryMap.get("contactName") + "%");
}
if (queryMap.containsKey("contactPhone"))
{
criteria.andContactPhoneLike("%" + (String) queryMap.get("contactPhone") + "%");
}
}
// 设置分页参数
restaurantCriteria.setPageSize(pageSize);
restaurantCriteria.setStartIndex((currentPage - 1) * pageSize);
List<Restaurant> items = restaurantMapper.selectByCriteria(restaurantCriteria);
// 设置餐厅主营类型
Map<String, String> shopTypes = getAllShopType();
for(Restaurant r : items)