java小技巧
List<实体类> aList = new ArrayList<>();
List<实体类Ao> bList = JSONArray.parseArray(JSON.toJSONString(aList), 实体类Ao.class);
List<SeaAo> seaAos = seaList.stream().map(sea -> {
SeaAo ao = new SeaAo();
BeanUtils.copyProperties(sea, ao);
return ao;
}).collect(Collectors.toList());
List<实体类> aList = new ArrayList<>();
List<实体类> bList = xxxMapper.selectAll();
aList.addAll(bList);
String manName = "张三,李四,王五,张三";
if (manName.contains(",")) {
String[] mans = manName.split(",");
Set<String> strs = new HashSet<>();
strs.addAll(Arrays.asList(mans));
StringBuilder mansResult = new StringBuilder();
int i = 0;
for (String str : strs) {
if(i>0){
mansResult.append(",");
}
mansResult.append(str);
i++;
}
manName=mansResult.toString();
}