diff --git a/BigDataSql/第一页/办学条件情况(按城乡类型).sql b/BigDataSql/第一页/办学条件情况(按城乡类型).sql index d9c0711d..0b55af43 100644 --- a/BigDataSql/第一页/办学条件情况(按城乡类型).sql +++ b/BigDataSql/第一页/办学条件情况(按城乡类型).sql @@ -1,242 +1,11 @@ -SELECT - ta.stage, - ta.cityCountryGroup, - ta.xiaosheNo, - tb.studentno, --- tb.teacherno , -- 这个需求不需要教师数 - -- concat ( round( CAST ( ta.xiaosheNo / tb.studentno AS NUMERIC ), 2 ), '%' ) AS bl -- 计算百分比 - round( CAST ( ta.xiaosheNo / tb.studentno AS NUMERIC ), 2 ) AS bl -FROM - ( - SELECT - '小学' AS stage, - sbr.cityCountryGroup, - SUM ( F + G + H + I ) AS xiaosheNo - FROM - schoolBusinessRelation sbr - INNER JOIN instanceTable it ON sbr.organizationNo = it.organizationNo - AND sbr.businesstypeno = it.businesstypeno - INNER JOIN J512 AS j ON j.instanceid = it.instanceid - AND ( - did IN ( 5, 6, 7, 8, 9, 10 ) - OR did IN ( 11 ) - OR did IN ( 14, 16, 17, 18, 19 ) - OR did IN ( 20 ) - ) - INNER JOIN v_areainfo va ON va.region_name = sbr.gatherregionc - WHERE - sbr.gatherRegionB = '长春市' - AND sbr.businessTypeNo IN ( '211', '218' ) - AND sbr.isLastYearCancel = 0 - AND sbr.recordyear = 2019 - AND it.recordyear = 2019 - AND j.recordyear = 2019 - GROUP BY - cityCountryGroup UNION ALL - SELECT - '初中' AS stage, - sbr.cityCountryGroup, - SUM ( F + G + H + I ) AS xiaosheNo - FROM - schoolBusinessRelation sbr - INNER JOIN instanceTable it ON sbr.organizationNo = it.organizationNo - AND sbr.businesstypeno = it.businesstypeno - INNER JOIN J512 AS j ON j.instanceid = it.instanceid - AND ( - did IN ( 5, 6, 7, 8, 9, 10 ) - OR did IN ( 11 ) - OR did IN ( 14, 16, 17, 18, 19 ) - OR did IN ( 20 ) - ) - WHERE - sbr.gatherRegionB = '长春市' - AND sbr.businessTypeNo IN ( '311', '312' ) - AND sbr.isLastYearCancel = 0 - AND sbr.recordyear = 2019 - AND it.recordyear = 2019 - AND j.recordyear = 2019 - GROUP BY - cityCountryGroup UNION ALL - SELECT - '高中' AS stage, - sbr.cityCountryGroup, - SUM ( F + G + H + I ) AS xiaosheNo - FROM - schoolBusinessRelation sbr - INNER JOIN instanceTable it ON sbr.organizationNo = it.organizationNo - AND sbr.businesstypeno = it.businesstypeno - INNER JOIN J512 AS j ON j.instanceid = it.instanceid - AND ( - did IN ( 5, 6, 7, 8, 9, 10 ) - OR did IN ( 11 ) - OR did IN ( 14, 16, 17, 18, 19 ) - OR did IN ( 20 ) - ) - WHERE - sbr.gatherRegionB = '长春市' - AND sbr.businessTypeNo IN ( '341', '342', '345' ) - AND sbr.isLastYearCancel = 0 - AND sbr.recordyear = 2019 - AND it.recordyear = 2019 - AND j.recordyear = 2019 - GROUP BY - cityCountryGroup - ) AS ta - FULL JOIN ( - SELECT - t1.A AS stage, - t1.citycountrygroup, - SUM ( c1 ) AS studentNo, - SUM ( c2 ) AS teacherNo - FROM - ( - SELECT - * - FROM - ( - SELECT - '小学' AS A, - '学生' AS b, - sbr.cityCountryGroup, - SUM ( j + K + l + M + n + o ) AS c1, - 0 AS c2 - FROM - schoolBusinessRelation sbr - INNER JOIN instanceTable it ON sbr.organizationNo = it.organizationNo - AND sbr.businesstypeno = it.businesstypeno - INNER JOIN J312 AS j ON j.instanceid = it.instanceid - AND j.did IN ( 1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47 ) - WHERE - sbr.gatherRegionB = '长春市' - AND sbr.businessTypeNo IN ( '211', '218', '219', '312', '345' ) - AND sbr.recordyear = 2019 - AND it.recordyear = 2019 - AND j.recordyear = 2019 - GROUP BY - sbr.cityCountryGroup UNION ALL - SELECT - '初中' AS A, - '学生' AS b, - sbr.cityCountryGroup, - SUM ( i + j + K + l ) AS c1, - 0 AS c2 - FROM - schoolBusinessRelation sbr - INNER JOIN instanceTable it ON sbr.organizationNo = it.organizationNo - AND sbr.businesstypeno = it.businesstypeno - INNER JOIN J313 AS j ON j.instanceid = it.instanceid - AND j.did IN ( 1, 36, 37, 38, 39, 40, 41, 42, 43, 44 ) - WHERE - sbr.gatherRegionB = '长春市' - AND sbr.businessTypeNo IN ( '311', '312', '319', '341', '345' ) - AND sbr.isLastYearCancel = 0 - AND sbr.recordyear = 2019 - AND it.recordyear = 2019 - AND j.recordyear = 2019 - GROUP BY - sbr.cityCountryGroup UNION ALL - SELECT - '高中' AS A, - '学生' AS b, - sbr.cityCountryGroup, - SUM ( i + j + K ) AS c1, - 0 AS c2 - FROM - schoolBusinessRelation sbr - INNER JOIN instanceTable it ON sbr.organizationNo = it.organizationNo - AND sbr.businesstypeno = it.businesstypeno - INNER JOIN J314 AS j ON j.instanceid = it.instanceid - AND did IN ( 1, 11, 12, 13, 14, 15, 16, 17, 18, 19 ) - INNER JOIN v_areainfo va ON va.region_name = sbr.gatherregionc - WHERE - sbr.gatherRegionB = '长春市' - AND sbr.businessTypeNo IN ( '341', '342', '345', '349' ) - AND sbr.isLastYearCancel = 0 - AND sbr.recordyear = 2019 - AND it.recordyear = 2019 - AND j.recordyear = 2019 - GROUP BY - sbr.cityCountryGroup - ) AS T UNION ALL - SELECT - * - FROM - ( - SELECT - '高中' AS A, - '老师' AS b, - sbr.cityCountryGroup, - 0 AS c1, - SUM ( F + G + H + I + j + K + l + M + N ) AS c2 - FROM - schoolBusinessRelation sbr - INNER JOIN instanceTable it ON sbr.organizationNo = it.organizationNo - AND sbr.businesstypeno = it.businesstypeno - INNER JOIN J422 AS j ON j.instanceid = it.instanceid - AND did IN ( 22, 23, 24, 25, 26, 27 ) - INNER JOIN v_areainfo va ON va.region_name = sbr.gatherregionc - WHERE - sbr.gatherRegionB = '长春市' - AND sbr.businessTypeNo IN ( '341', '342', '345' ) - AND sbr.isLastYearCancel = 0 - AND sbr.recordyear = 2019 - AND it.recordyear = 2019 - AND j.recordyear = 2019 - GROUP BY - sbr.cityCountryGroup UNION ALL - SELECT - '初中' AS A, - '老师' AS b, - sbr.cityCountryGroup, - 0 AS c1, - SUM ( F + G + H + I + j + K + l + M + N ) AS c2 - FROM - schoolBusinessRelation sbr - INNER JOIN instanceTable it ON sbr.organizationNo = it.organizationNo - AND sbr.businesstypeno = it.businesstypeno - INNER JOIN J422 AS j ON j.instanceid = it.instanceid - AND did IN ( 13, 14, 15, 16, 17, 18 ) - INNER JOIN v_areainfo va ON va.region_name = sbr.gatherregionc - WHERE - sbr.gatherRegionB = '长春市' - AND sbr.businessTypeNo IN ( '311', '312', '341', '345' ) - AND sbr.isLastYearCancel = 0 - AND sbr.recordyear = 2019 - AND it.recordyear = 2019 - AND j.recordyear = 2019 - GROUP BY - sbr.cityCountryGroup UNION ALL - SELECT - '小学' AS A, - '老师' AS b, - sbr.cityCountryGroup, - 0 AS c1, - SUM ( F + G + H + I + j + K + l + M + N ) AS c2 - FROM - schoolBusinessRelation sbr - INNER JOIN instanceTable it ON sbr.organizationNo = it.organizationNo - AND sbr.businesstypeno = it.businesstypeno - INNER JOIN J422 AS j ON j.instanceid = it.instanceid - AND did IN ( 4, 5, 6, 7, 8, 9 ) - INNER JOIN v_areainfo va ON va.region_name = sbr.gatherregionc - WHERE - sbr.gatherRegionB = '长春市' - AND sbr.businessTypeNo IN ( '211', '218', '312', '345' ) - AND sbr.isLastYearCancel = 0 - AND sbr.recordyear = 2019 - AND it.recordyear = 2019 - AND j.recordyear = 2019 - GROUP BY - sbr.cityCountryGroup - ) AS T - ) AS t1 - GROUP BY - A, - citycountrygroup - ORDER BY - A, - citycountrygroup - ) AS tb ON ta.stage = tb.stage AND ta.citycountrygroup = tb.citycountrygroup -ORDER BY - ta.stage, - ta.citycountrygroup \ No newline at end of file +select t1.stage,t1.citycountrygroup,zhandimianjino,t2.zaixiaono as studentno from mv_db_base_banxuetiaojian as t1 +inner join mv_db_base_student as t2 on t1.stage=t2.stage and t1.citycountrygroup=t2.citycountrygroup +order by +(case when t1.stage='小学' then 1 + when t1.stage='初中' then 2 + when t1.stage='高中' then 3 + end), + (case when t1.citycountrygroup='城区' then 1 + when t1.citycountrygroup='镇区' then 2 + when t1.citycountrygroup='乡村' then 3 + end) \ No newline at end of file diff --git a/BigDataSql/第一页/城乡专任教师师生比.sql b/BigDataSql/第一页/城乡专任教师师生比.sql index 5709a38a..53b26a4e 100644 --- a/BigDataSql/第一页/城乡专任教师师生比.sql +++ b/BigDataSql/第一页/城乡专任教师师生比.sql @@ -1 +1,10 @@ -select * from mv_dp_cxzrssb \ No newline at end of file +select * from mv_dp_cxzrssb as t1 + order by +(case when t1.stage='Сѧ' then 1 + when t1.stage='' then 2 + when t1.stage='' then 3 + end), + (case when t1.citycountrygroup='' then 1 + when t1.citycountrygroup='' then 2 + when t1.citycountrygroup='' then 3 + end) \ No newline at end of file diff --git a/BigDataSql/第一页/学生情况.sql b/BigDataSql/第一页/学生情况.sql index 9bc0cdc1..3fec972f 100644 --- a/BigDataSql/第一页/学生情况.sql +++ b/BigDataSql/第一页/学生情况.sql @@ -1 +1,5 @@ -select * from mv_db_base_student \ No newline at end of file +select t1.stage,sum(t1.zhaoshengno) as zhaoshengno,sum(t1.biyeno) as biyeno,sum(t1.zaixiaono) as zaixiaono from mv_db_base_student as t1 GROUP BY t1.stage order by +(case when t1.stage='Сѧ' then 1 + when t1.stage='' then 2 + when t1.stage='' then 3 + end) \ No newline at end of file diff --git a/BigDataSql/第一页/班额.sql b/BigDataSql/第一页/班额.sql index db4ece2a..dbe0dd0e 100644 --- a/BigDataSql/第一页/班额.sql +++ b/BigDataSql/第一页/班额.sql @@ -1 +1,21 @@ -select * from mv_dp_bane_chengxiang order by citycountrygroup,d \ No newline at end of file +SELECT stage,d, + (case d when '03' then '25˼' + when '04' then '26-30' + when '05' then '31-35' + when '06' then '36-40' + when '07' then '41-45' + when '08' then '46-50' + when '09' then '51-55' + when '10' then '56-60' + when '11' then '61-65' + when '12' then '66˼' end + ), + sum(sum) AS total + FROM mv_dp_bane_stage_chengxiang + GROUP BY d,stage + + order by +(case when stage='Сѧ' then 1 + when stage='' then 2 + when stage='' then 3 + end),d \ No newline at end of file diff --git a/BigDataSql/第一页/随迁子女性情况.txt b/BigDataSql/第一页/随迁子女性情况.txt deleted file mode 100644 index 21b02690..00000000 --- a/BigDataSql/第一页/随迁子女性情况.txt +++ /dev/null @@ -1,2 +0,0 @@ -select didgroup,sum(zaixiaono) from mv_db_sqznqk GROUP BY didgroup -select sum(zaixiaono) from mv_db_base_student diff --git a/BigDataSql/第一页/随迁子女情况.txt b/BigDataSql/第一页/随迁子女情况.txt new file mode 100644 index 00000000..e5003c86 --- /dev/null +++ b/BigDataSql/第一页/随迁子女情况.txt @@ -0,0 +1,9 @@ + select stage,didgroup,sum(zaixiaono) as total from mv_db_sqznqk GROUP BY didgroup,stage +order by +(case when stage='Сѧ' then 1 + when stage='' then 2 + when stage='' then 3 + end) + + + select sum(zaixiaono) as total from mv_db_base_student \ No newline at end of file