SqlExecutor executor = new SqlExecutor(true);
executor.setMaxRecord(0);
DataMap params = new DataMap();
params.add("tql_order_by", " province,city ");
Map<String, List<DataMap>> provinceAdPushMap = new HashMap<String, List<DataMap>>();
DataTable table = Dao.execQuery("query_t_inf_ad_push", executor, params);
List<DataMap> adPushList = table.toDataMap();
for (DataMap adPush : adPushList) {
String province = adPush.getString("province");
List<DataMap> provinceAdPushList = provinceAdPushMap.get(province);
if (provinceAdPushList == null) {
provinceAdPushList = new ArrayList<DataMap>();
}
provinceAdPushList.add(adPush);
provinceAdPushMap.put(province, provinceAdPushList);
}
// ctx.addOutVal("adPushList", adPushList);
ctx.addOutVal("provinceAdPushMap", provinceAdPushMap);
map和list
最新推荐文章于 2021-03-09 23:09:54 发布