|
@@ -850,4 +850,20 @@ public class BiSnapshotApplication : IBiSnapshotApplication, IScopeDependency
|
|
|
#endif
|
|
|
return query;
|
|
|
}
|
|
|
+
|
|
|
+ public List<Dictionary<string, object>> GetIndustryStatistics(IndustryStatisticsInDto dto)
|
|
|
+ {
|
|
|
+ var query = _industryRepository.Queryable(includeDeleted: true)
|
|
|
+ .LeftJoin<OrderSnapshot>((industry, snapshot) => snapshot.IndustryId == industry.Id && snapshot.CreationTime >= dto.StartTime && snapshot.CreationTime <= dto.EndTime)
|
|
|
+ .LeftJoin<Order>((industry, snapshot, order) => order.Id == snapshot.Id)
|
|
|
+ .Where((industry) => industry.IsEnable == true)
|
|
|
+ .Select((industry, snapshot, order) => new
|
|
|
+ {
|
|
|
+ OrderCount = SqlFunc.AggregateSum(snapshot.Id),
|
|
|
+ order.AllDuration,
|
|
|
+ IsEmphasis = SqlFunc.AggregateSum(SqlFunc.IIF(snapshot.IsEmphasis == true, 1, 0)),
|
|
|
+ });
|
|
|
+ var outDto = new List<Dictionary<string, object>>();
|
|
|
+ return outDto;
|
|
|
+ }
|
|
|
}
|