private Map<String, Long> smfname_allowValue() throws Exception {
ItemQueryVO queryVO = new ItemQueryVO();
List<ItemResultVO> list = itemService.selectAllCategCode(queryVO);//查询list结果集
Map<String, Long> allowValues = Maps.newHashMap();
//存name,id结果map
if (CollectionUtils.isNotEmpty(list)) {
//循环存值
for (ItemResultVO res : list) {
allowValues.put(res.getItemname(), res.getId());
}
}
return allowValues;
}
java 将list中name,对应的id放入map
最新推荐文章于 2024-07-07 04:04:08 发布