|
@@ -103,27 +103,28 @@ namespace TEAMModelOS.Controllers.Research
|
|
|
schoolInfos.Add(item);
|
|
|
}
|
|
|
if (schoolInfos.Count > 0)
|
|
|
+ {
|
|
|
scIds = schoolInfos.Select(s => s.id).ToList();
|
|
|
+ }
|
|
|
StringBuilder statsSql = new($"select value(c) from c where c.year={dateTime.Year}");
|
|
|
if (scIds.Count > 0)
|
|
|
- statsSql.Append($" and {BICommonWay.ManyScSql("c.id", scIds, $"{dateTime.Year}-")}");
|
|
|
-
|
|
|
- await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIterator<StatsInfo>(queryText: statsSql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Statistics") }))
|
|
|
{
|
|
|
- statsInfos.Add(item);
|
|
|
+ statsSql.Append($" and {BICommonWay.ManyScSql("c.id", scIds, $"{dateTime.Year}-")}");
|
|
|
+ await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIterator<StatsInfo>(queryText: statsSql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Statistics") }))
|
|
|
+ {
|
|
|
+ statsInfos.Add(item);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+ List<LastYearLessAndAct> lastYear = new();
|
|
|
StringBuilder lastStsSql = new($"select c.lesson,c.activity from c where c.year={dateTime.Year - 1}");
|
|
|
if (scIds.Count > 0)
|
|
|
{
|
|
|
lastStsSql.Append($" and {BICommonWay.ManyScSql("c.id", scIds, $"{dateTime.Year - 1}-")}");
|
|
|
- }
|
|
|
-
|
|
|
- List<LastYearLessAndAct> lastYear = new();
|
|
|
-
|
|
|
- await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIterator<LastYearLessAndAct>(queryText: lastStsSql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Statistics") }))
|
|
|
- {
|
|
|
- lastYear.Add(item);
|
|
|
+ await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIterator<LastYearLessAndAct>(queryText: lastStsSql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Statistics") }))
|
|
|
+ {
|
|
|
+ lastYear.Add(item);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
StatsInfo statsInfo = null;
|