0

mongo 查询语句  https://paste.ubuntu.com/p/MHQBDVd3jP/

springdatamongo 查询:

Aggregation agg = Aggregation.newAggregation(
    Aggregation.match(Criteria.where("deviceNo").in(deviceNos)),
    Aggregation.project().and(StringOperators.SubstrCP.valueOf("$hour").substringCP(8, 2)).as("h")
        .and("$statistics.EPI.diffsum").as("diffsum"),
    Aggregation.group("$h").sum("$diffsum").as("epidiffsum"),
    Aggregation.sort(Sort.Direction.ASC, "_id")
);
更改状态以发布