public String queryList(QueryParam queryParam) {
List<T> listTotal = baseDao.getMongoTemplate().findAll(getBeanClass());
int page = queryParam.getPageNumber();
int total = listTotal.size();
Map map = new LinkedMap(3);
map.put("page", page);
map.put("total", total);
Query query = new Query();
if (!StringUtils.isEmpty(queryParam.getQuery())) {
query.addCriteria(Criteria.where(queryParam.getQtype()).is(
queryParam.getQuery()));
}
query.skip(queryParam.getSkip()).limit(queryParam.getLimit()).sort()
.on(queryParam.getSortname(), queryParam.getSortorder());
List<T> list = baseDao.getMongoTemplate().find(query, getBeanClass());
List<Map<String, Object>> mapList = new LinkedList<Map<String, Object>>();
for (T bean : list) {
mapList.add(bean.toMap());
}
map.put("rows", mapList);
String json = JackJson.fromObjectToJson(map);
return json;
}