java常用知识
提取对象数组里面的某个字段

List<String> lastTask = lastTasks.stream()
                .map(HistoricActivityInstance::getActivityId)
                .limit(1)
                .collect(Collectors.toList());

对象数组排序
notEmptyList.sort(Comparator.comparing(StationQueryVO::getCurrentValue).reversed());

base64
private static final org.apache.commons.codec.binary.Base64 base64 = new org.apache.commons.codec.binary.Base64();

  

 fastjson解析null值问题: 解决 null的属性不显示问题

JSONObject.toJSONString(jsonMap,SerializerFeature.WriteMapNullValue);  

 mysql 的sql 里面 的 where 1=1 在最后的查询语句里面会被优化调。但是这个where 1=1 可能会造成查询的性能问题。比如只有 where 1=1 ,后面没有其他的查询条件了,会造成全表扫描,影响查询性能

posted on 2023-08-24 09:24  james-roger  阅读(11)  评论(0)    收藏  举报