https://www.icode9.com/content-1-101353.html
public Map<Object,List<YlxMaterialManage>> selectYlxMaterialManageList() {
YlxMaterialManage query = new YlxMaterialManage();
query.setDelFlag(YlxAdminConstant.DEL_FLAG_ZERO);
query.setStatus(YlxAdminConstant.NORMAL_STATUS); //正常
List<YlxMaterialManage> selectList = ylxMaterialManageMapper.selectYlxMaterialManageList(query);
Map<Object,List<YlxMaterialManage>> rstMap = new HashMap<>();
for (YlxMaterialManage manage : selectList) {
if (rstMap.containsKey(manage.getSortName())) {
rstMap.get(manage.getSortName()).add(manage);
} else {
List<YlxMaterialManage> tempList = new ArrayList<>();
tempList.add(manage);
rstMap.put(manage.getSortName(),tempList);
}
}
return rstMap;
}
网友评论