多表关联查询,怎么获取的res 是空的呢?
StringBuffer baseSql = new StringBuffer();
baseSql.append(" select ")
.append(" t1.id, ")
.append(" t1.term_id, ")
.append(" t6.name as placeName, ")
.append(" CONCAT_WS('', t3.pname, t4.pname, t5.pname) AS area, ")
.append(" t1.comAddr, ")
.append(" t1.trade_no as order_id, ")
.append(" t1.refund_id, ")
.append(" t7.name as refund_way, ")
.append(" t1.refund_fee, ")
.append(" t1.rf_time ")
.append(" from tm_refund t1 ")
.append(" left join tm_term t2 on t1.term_id = t2.id ")
.append(" LEFT JOIN sys_area t3 ON t2.province = t3.id ")
.append(" LEFT JOIN sys_area t4 ON t2.city = t4.id ")
.append(" LEFT JOIN sys_area t5 ON t2.county = t5.id ")
.append(" left join tm_place t6 on t2.placeId = t6.id ")
.append(" left join sys_dict t7 on t7.id = t1.refund_way and t7.typeId=19 ")
.append(" $condition ");
Sql sql = Sqls.queryRecord(baseSql.toString());
sql.setCondition(cri);
sql.setPager(pager);
dao().execute(sql);
List<Record> res = sql.getList(Record.class);
long totalCount = Daos.queryCount(dao(), sql);