像这样获取分页对象:
Page<Record> paginate = Db.paginate(page, limit, sqlPara);
为什么paginate.getList 不是我想要的数据格式:
我现在需要如下方法才能获取到自己想要的方法:
SqlPara sqlPara = Db.getSqlPara("orderWork.customsBatchInfo", cond); Page<Record> paginate = Db.paginate(page, limit, sqlPara); Map<String, Object> result = new HashMap<String, Object>(); List<Map> list=new ArrayList<>(); for (Record record:paginate.getList()) list.add(record.getColumns());
我sql如下:
SELECT t.`id` AS id, t.`bill_order_no`AS billOrderNo, t.`airplane_no` AS airplaneNo, t.`arrive_date`AS arriveDate, t.`arrive_etd` AS arriveEtd, t.`arrive_eta` AS arriveEta, (SELECT COUNT(1) FROM `logistics_customs_package_info` l WHERE t.`id` = l.`batch_id`) AS totalCount, (SELECT COUNT(1) FROM `logistics_customs_package_info` l WHERE t.`id` = l.`batch_id` AND l.`printmic_sign`=0) AS printmicNum, (SELECT COUNT(1) FROM `logistics_customs_package_info` l WHERE t.`id` = l.`batch_id` AND l.`printrsv_sign`=0) AS printrsvNum FROM `logistics_customs_batch_info` t
项目:JFinal