|
@@ -242,11 +242,11 @@ namespace TEAMModelBI.Controllers.BIHome
|
|
|
foreach (var itemSchool in schoolIds)
|
|
|
{
|
|
|
//查询全部教师人数
|
|
|
- string sqlT = $"select count(c.id) as totals from c join a1 in c.schools where a1.schoolId='{itemSchool}'";
|
|
|
+ string sqlT = $"select value(count(c.id)) from c join a1 in c.schools where a1.schoolId='{itemSchool}'";
|
|
|
teacherCount += await CommonFind.GetSqlValueCount(cosmosClient, "Teacher", sqlT, "Base");
|
|
|
|
|
|
//查询全部学生人数
|
|
|
- string sqlS = $"select count(c.id) as totals from c";
|
|
|
+ string sqlS = $"select value(count(c.id)) from c";
|
|
|
teacherCount += await CommonFind.GetSqlValueCount(cosmosClient, "Student", sqlS, $"Base-{itemSchool}");
|
|
|
}
|
|
|
|
|
@@ -302,12 +302,12 @@ namespace TEAMModelBI.Controllers.BIHome
|
|
|
foreach (var itemSchool in schoolIds)
|
|
|
{
|
|
|
//查询全部教师人数
|
|
|
- string sqlT = $"select count(c.id) as totals from c join a1 in c.schools where a1.schoolId='{itemSchool}'";
|
|
|
+ string sqlT = $"select value(count(c.id)) from c join a1 in c.schools where a1.schoolId='{itemSchool}'";
|
|
|
teachCount += await CommonFind.GetSqlValueCount(cosmosClient, "Teacher", sqlT, "Base");
|
|
|
|
|
|
//查询全部学生人数
|
|
|
- string sqlS = $"select count(c.id) as totals from c";
|
|
|
- stuCount += await CommonFind.FindTotals(cosmosClient, sqlS, "Student", $"Base-{itemSchool}");
|
|
|
+ string sqlS = $"select value(count(c.id)) from c";
|
|
|
+ stuCount += await CommonFind.GetSqlValueCount(cosmosClient, "Student", sqlS, $"Base-{itemSchool}");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -373,12 +373,12 @@ namespace TEAMModelBI.Controllers.BIHome
|
|
|
foreach (var itemSchool in schoolIds)
|
|
|
{
|
|
|
//查询学校教师人数
|
|
|
- string sqlT = $"select count(c.id) as totals from c join a1 in c.schools where a1.schoolId='{itemSchool}'";
|
|
|
- tempCode.teacherCount += await CommonFind.FindTotals(cosmosClient, sqlT, "Teacher", "Base");
|
|
|
+ string sqlT = $"select value(count(c.id)) from c join a1 in c.schools where a1.schoolId='{itemSchool}'";
|
|
|
+ tempCode.teacherCount += await CommonFind.GetSqlValueCount(cosmosClient, "Teacher", sqlT, "Base");
|
|
|
|
|
|
//查询学校学生人数
|
|
|
- string sqlStu = $"select count(c.id) as totals from c";
|
|
|
- tempCode.studentCount += await CommonFind.FindTotals(cosmosClient, sqlStu, "Student", $"Base-{itemSchool}");
|
|
|
+ string sqlStu = $"select value(count(c.id)) from c";
|
|
|
+ tempCode.studentCount += await CommonFind.GetSqlValueCount(cosmosClient, "Student", sqlStu, $"Base-{itemSchool}");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -406,12 +406,12 @@ namespace TEAMModelBI.Controllers.BIHome
|
|
|
foreach (var itemSchool in schoolIds)
|
|
|
{
|
|
|
//查询学校教师人数
|
|
|
- string sqlT = $"select count(c.id) as totals from c join a1 in c.schools where a1.schoolId='{itemSchool}'";
|
|
|
- tempProvinceStics.teacherCount += await CommonFind.FindTotals(cosmosClient, sqlT, "Teacher", "Base");
|
|
|
+ string sqlT = $"select value(count(c.id)) from c join a1 in c.schools where a1.schoolId='{itemSchool}'";
|
|
|
+ tempProvinceStics.teacherCount += await CommonFind.GetSqlValueCount(cosmosClient, "Teacher", sqlT, "Base");
|
|
|
|
|
|
//查询学校学生人数
|
|
|
- string sqlStu = "select count(c.id) as totals from c";
|
|
|
- tempProvinceStics.studentCount += await CommonFind.FindTotals(cosmosClient, sqlStu, "Student", $"Base-{itemSchool}");
|
|
|
+ string sqlStu = "select value(count(c.id)) from c";
|
|
|
+ tempProvinceStics.studentCount += await CommonFind.GetSqlValueCount(cosmosClient, "Student", sqlStu, $"Base-{itemSchool}");
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -466,8 +466,8 @@ namespace TEAMModelBI.Controllers.BIHome
|
|
|
if (tempCode != null)
|
|
|
{
|
|
|
//string sqlTxt = $"select count(c.id) totals from c where c.standard='{itemStandrd.standard}'";
|
|
|
- string sqlTxt = $"select count(c.id) totals from c where c.areaId='{itemStandrd.areaId}' and c.standard='{itemStandrd.standard}'";
|
|
|
- tempCode.schoolCount += await CommonFind.FindTotals(cosmosClient, sqlTxt, "School", "Base");
|
|
|
+ string sqlTxt = $"select value(count(c.id)) from c where c.areaId='{itemStandrd.areaId}' and c.standard='{itemStandrd.standard}'";
|
|
|
+ tempCode.schoolCount += await CommonFind.GetSqlValueCount(cosmosClient, "School", sqlTxt, "Base");
|
|
|
|
|
|
var tempModel = citySchools.Where(x => x.cityCode == tempCode.cityCode).FirstOrDefault();
|
|
|
if (tempModel != null)
|
|
@@ -481,8 +481,8 @@ namespace TEAMModelBI.Controllers.BIHome
|
|
|
citySchool.cityName = itemStandrd.cityName;
|
|
|
|
|
|
//string sqlTxt = $"select count(c.id) totals from c where c.standard='{itemStandrd.standard}'";
|
|
|
- string sqlTxt = $"select count(c.id) totals from c where c.areaId='{itemStandrd.areaId}' and c.standard='{itemStandrd.standard}'";
|
|
|
- citySchool.schoolCount += await CommonFind.FindTotals(cosmosClient, sqlTxt, "School", "Base");
|
|
|
+ string sqlTxt = $"select value(count(c.id)) from c where c.areaId='{itemStandrd.areaId}' and c.standard='{itemStandrd.standard}'";
|
|
|
+ citySchool.schoolCount += await CommonFind.GetSqlValueCount(cosmosClient, "School", sqlTxt, "Base");
|
|
|
|
|
|
citySchools.Add(citySchool);
|
|
|
}
|
|
@@ -548,14 +548,14 @@ namespace TEAMModelBI.Controllers.BIHome
|
|
|
foreach (var itemSchool in schoolIds)
|
|
|
{
|
|
|
//查询学校教师人数
|
|
|
- string sqlT = $"select count(c.id) as totals from c join a1 in c.schools where a1.schoolId='{itemSchool}'";
|
|
|
+ string sqlT = $"select value(count(c.id)) from c join a1 in c.schools where a1.schoolId='{itemSchool}'";
|
|
|
//string sqlT = $"select count(c.id) as totals from c where c.code='Teacher-{itemSchool}' and contains(c.roles,'teacher')";
|
|
|
|
|
|
- districtStics.teacherCount += await CommonFind.FindTotals(cosmosClient, sqlT, "Teacher", "Base");
|
|
|
+ districtStics.teacherCount += await CommonFind.GetSqlValueCount(cosmosClient, "Teacher", sqlT, "Base");
|
|
|
|
|
|
//查询学校学生人数
|
|
|
- string sqlS = $"select count(c.id) as totals from c ";
|
|
|
- districtStics.studentCount += await CommonFind.FindTotals(cosmosClient, sqlS, "Student", $"Base-{itemSchool}");
|
|
|
+ string sqlS = $"select value(count(c.id)) from c ";
|
|
|
+ districtStics.studentCount += await CommonFind.GetSqlValueCount(cosmosClient, "Student", sqlS, $"Base-{itemSchool}");
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -631,10 +631,10 @@ namespace TEAMModelBI.Controllers.BIHome
|
|
|
foreach (var itemSchool in schoolIds)
|
|
|
{
|
|
|
//查询学校教师人数
|
|
|
- districtStics.teacherCount += await CommonFind.FindTotals(cosmosClient, $"select count(c.id) totals from c join a1 in c.schools where a1.schoolId='{itemSchool}'", "Teacher", "Base");
|
|
|
+ districtStics.teacherCount += await CommonFind.GetSqlValueCount(cosmosClient, "Teacher", $"select value(count(c.id)) from c join a1 in c.schools where a1.schoolId='{itemSchool}'", "Base");
|
|
|
|
|
|
//查询学校学生人数
|
|
|
- districtStics.studentCount += await CommonFind.FindTotals(cosmosClient, "select count(c.id) totals from c", "Student", $"Base-{itemSchool}");
|
|
|
+ districtStics.studentCount += await CommonFind.GetSqlValueCount(cosmosClient, "Student", "select value( count(c.id)) from c", $"Base-{itemSchool}");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -665,10 +665,10 @@ namespace TEAMModelBI.Controllers.BIHome
|
|
|
foreach (var itemSchool in schoolIds)
|
|
|
{
|
|
|
//查询学校教师人数
|
|
|
- districtStics.teacherCount += await CommonFind.FindTotals(cosmosClient, $"select count(c.id) as totals from c join a1 in c.schools where a1.schoolId='{itemSchool}'", "Teacher", "Base");
|
|
|
+ districtStics.teacherCount += await CommonFind.GetSqlValueCount(cosmosClient, "Teacher", $"select value(count(c.id)) from c join a1 in c.schools where a1.schoolId='{itemSchool}'", "Base");
|
|
|
|
|
|
//查询学校学生人数
|
|
|
- districtStics.studentCount += await CommonFind.FindTotals(cosmosClient, $"select count(c.id) as totals from c", "Student","Base");
|
|
|
+ districtStics.studentCount += await CommonFind.GetSqlValueCount(cosmosClient, "Student", $"select value(count(c.id)) from c", "Base");
|
|
|
}
|
|
|
tempDistrictStics.Add(districtStics);
|
|
|
}
|
|
@@ -765,7 +765,7 @@ namespace TEAMModelBI.Controllers.BIHome
|
|
|
|
|
|
|
|
|
//查询学校空间和学校Id
|
|
|
- totalSize = await CommonFind.FindTotals(cosmosClient, "select sum(c.size) as totals from c", "School", "Base");
|
|
|
+ totalSize = await CommonFind.GetSqlValueCount(cosmosClient, "School", "select value(sum(c.size)) from c", "Base");
|
|
|
schoolId = await CommonFind.FindSchoolIds(cosmosClient, "select c.id,c.size from c", "Base");
|
|
|
|
|
|
//查询学校已使用空间大小
|