今天使用jfinal分页查询,但是这个查询比较特殊,要用多字段倒序排序。我的代码是这样的:
public Page<Apply>page(int page){
return dao.paginate(page, Const.SIZE_APPLY, "SELECT apply.*,`subject`.`name` as sname ", "FROM apply INNER JOIN `subject` ON apply.sid = `subject`.id WHERE `subject`.staid = 1 ORDER BY mark DESC,`subject`.id DESC ,apply.id DESC");
}
结果控制台报错
JFinal action report -------- 2015-04-22 21:52:10 ------------------------------
Controller : com.tt.controller.admin.ApplyAdminController.(ApplyAdminController.java:1)
Method : index
Interceptor : com.jfinal.ext.interceptor.SessionInViewInterceptor.(SessionInViewInterceptor.java:1)
com.tt.intercept.AdminInterceptor.(AdminInterceptor.java:1)
--------------------------------------------------------------------------------
Sql: select count(*) FROM apply INNER JOIN `subject` ON apply.sid = `subject`.id