//采集 ConditionalOperators.Cond collectionCount = ConditionalOperators.when(Criteria.where("sourceOfCertificate").is("1")) .then(1).otherwise(""); //填报 ConditionalOperators.Cond fillCount = ConditionalOperators.when(Criteria.where("sourceOfCertificate").is("2")) .then(1).otherwise(""); //导入 ConditionalOperators.Cond importCount = ConditionalOperators.when(Criteria.where("sourceOfCertificate").is("3")) .then(1).otherwise(""); //推送 ConditionalOperators.Cond pushCount = ConditionalOperators.when(Criteria.where("sourceOfCertificate").is("4")) .then(1).otherwise(""); Aggregation agg =Aggregation.newAggregation( //筛选条件 Aggregation.match(Criteria.where("orgId").in(orgList)), Aggregation.group("catalog_id").count().as("registerCount").sum(pushCount).as("pushCount") .count(