您好,我这边在复杂sql调用分页查询的方法的时候 查询只返回了 总体条数 当前第几页 每页多少条
String select = "SELECT * "; String from = " FROM (SELECT p.id, p.name, p.province, p.city, p.district, p.street, p.address, i.image_url,(YEAR(NOW())-YEAR(p.build_time)) AS buildTotal,(SELECT SUM(ph.sell_house_price)/SUM(ph.area) FROM t_person_house_info AS ph WHERE ph.position = p.name) * 10000 AS avgPrice,((SELECT COUNT(ph.id) FROM t_person_house_info AS ph WHERE ph.position = p.name)+ (SELECT COUNT(ph.id) FROM t_rent_person_house AS ph WHERE ph.position = p.name)) AS total,(SELECT COUNT(ph.id) FROM t_rent_person_house AS ph WHERE ph.position = p.name AND ph.is_choiceness = 1) AS checkTotal,(6378.137 * ACOS ( COS ( RADIANS (?) ) * COS(RADIANS( p.latitude )) * COS( RADIANS( p.longitude ) - RADIANS(?) ) + SIN ( RADIANS (?) ) * SIN( RADIANS( p.latitude ) ) ) ) AS distance FROM t_community_manage AS P LEFT JOIN t_community_manage_images AS i ON p.id = i.community_manage_id WHERE 1 = 1 AND LOCATE(?, p.name)>0 GROUP BY p.id ORDER BY total DESC ) AS t";
使用Db.paginate 和 Db.paginateByFullSql 方法 返回的list均为null
项目:JFinal
https://www.jfinal.com/doc/5-6