Db.paginate(pageNumber, pageSize, "select lst.user_id userid,usr.name user_name ",
"from moap_task_lst lst left join sys_user usr on usr.login_id lst.user_id left join moap_tasks task on "+
"task.task_no = lst.task_no where task.task_status = '4' and task.biz_type = '6' and usr.bank_id = ? group by lst.user_id order by total desc",bankId);
这个是我写的查询语句,sql是没有问题的,在Navicat里面能查询出数据
select count(*) from moap_task_lst lst left join sys_user usr on usr.login_id = lst.user_id left join moap_tasks task on task.task_no = lst.task_no where task.task_status = '4' and task.biz_type = '6' and usr.bank_id = ? group by lst.user_id order by total desc
这个是程序执行的sql,请问多表的分页和分组和排序有其他方法吗
我写的sql和程序执行的sql主要区别在select 和 from之间我需要查询的字段
Db.paginate(pageNumber, pageSize, true, ....);