1.fix sql issue

main
Gary 10 months ago
parent 79f667451c
commit b309f30d90

@ -1,5 +1,6 @@
package com.luoo.music.service; package com.luoo.music.service;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -28,6 +29,9 @@ public class TagService {
} }
public Map<String, List<String>> getTagMap(List<String> journalIds) { public Map<String, List<String>> getTagMap(List<String> journalIds) {
if(journalIds.isEmpty()) {
return Collections.emptyMap();
}
List<Object[]> pairs = tagDao.getJounralId2TagPairs(journalIds); List<Object[]> pairs = tagDao.getJounralId2TagPairs(journalIds);
return pairs.stream().collect(Collectors.groupingBy(s -> s[0].toString(), return pairs.stream().collect(Collectors.groupingBy(s -> s[0].toString(),
Collectors.mapping(s -> s[1].toString(), Collectors.toList()))); Collectors.mapping(s -> s[1].toString(), Collectors.toList())));

Loading…
Cancel
Save