NutzCN Logo
问答 自己写的sql怎么给前端传回Pager
发布于 2556天前 作者 qq_857440e9 1705 次浏览 复制 上一个帖子 下一个帖子
标签:

求大佬告诉我怎么做,用dao可以带pager,但是自己写sql语句查到的结果不知道怎么传回pager

@At("/total")
	@GET
	@AdaptBy(type = JsonAdaptor.class)
	public Object total(@Attr("me")String userId, HttpServletRequest request) {
		 Sql sql = Sqls.create("SELECT b.id as userId,b.realname as realName,c.id as projectId,c.name as projectName,d.total_score as totalScore " + 
		 		"from sys_project_user a " + 
		 		"INNER JOIN sys_user b on b.id = a.u_id " + 
		 		"INNER JOIN sys_project c on c.id = a.p_id " + 
		 		"INNER JOIN sys_score d on a.u_id = d.u_id and a.p_id = d.project_id");
		 sql.setCallback(Sqls.callback.maps());
		 dao.execute(sql);
		 List maps = sql.getList(Map.class);
		 Map<String, Object> map = new HashMap<String, Object>();
		 map.put("maps", maps);
		 return map;
	}
1 回复

map.put("pager", pager);

添加回复
请先登陆
回到顶部