java代码mongodb聚合查询转换成SQL语句
private List<ChartDataVo> getChildModuleChartData(Integer serviceId, String parentModule, String orgId) {
List<String> orgIds = getSonOrgIdsByOrgId(orgId);
Aggregation aggregationTmp = Aggregation.newAggregation(
match(Criteria.where("serviceId").is(serviceId)
.and("moduleInfo.parentModule").is(parentModule)
.and("organization._id").in(orgIds)),
group("moduleInfo.childModule").count().as("value")
.first("moduleInfo.childModule").as("name"),
project("name", "value").andExclude("_id")
);
AggregationResults<ChartDataVo> results = mongoTemplate.aggregate(aggregationTmp, "app_data", ChartDataVo.class);
。。。