对集合判空使用优雅的Optional List<String> strs = null;System.out.println(strs);// 不判断空指针会报错strs.stream().filter(Objects::nonNull);// 优雅的方式Optional.ofNullable(strs).orElseGet(() -> { System.out.println("strs为null!"); return new ArrayList<>();}).stream().so.
使用stream流进行集合排序取最大值,根据集合中的bigdemal属性排序(正序反序)并取最大值 业务: 求折线图的UPH图相关数据,前端动态修改纵轴的峰值,需要后端获取最大值1)根据集合某个属性(业务以bigdecimal数据为例)进行集合排序,包括升序反序2)根据集合的某个number数值属性取最大值实体类:@Datapublic class EqpUPHVO { @ApiModelProperty(value = "设备名称") private String eqpName; @ApiModelProperty(value = "uph值"...
influxdb的crul请求使用postman发送请求测试转换 curl转换如curl -G 'http://ip:8086/query?pretty=true' --data-urlencode "db=test" --data-urlencode "q=SELECT "字段" FROM "表名" WHERE "条件"可转化为
influxdb安装(win10和centos8) 1、Cent OS 8安装https://jasper-zhang1.gitbooks.io/influxdb/content/Introduction/installation.html[root@izbp1b6ddawe4svwf8j360z influxdb]# cat <<EOF | sudo tee /etc/yum.repos.d/influxdb.repo> [influxdb]> name = InfluxDB Repository - RHEL \$rele