From 03ec1b62d0958701e5895c02b79863fa5f8d8299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com> Date: Fri, 5 Feb 2021 11:23:58 +0800 Subject: [PATCH 1/4] 'commit' --- .../办学条件情况(按城乡类型).sql | 242 ++++++++++++++++++ 1 file changed, 242 insertions(+) create mode 100644 BigDataSql/办学条件情况(按城乡类型).sql diff --git a/BigDataSql/办学条件情况(按城乡类型).sql b/BigDataSql/办学条件情况(按城乡类型).sql new file mode 100644 index 00000000..a05e5586 --- /dev/null +++ b/BigDataSql/办学条件情况(按城乡类型).sql @@ -0,0 +1,242 @@ +SELECT + ta.stage, + ta.cityCountryGroup, + ta.xiaosheNo, + tb.studentno, +-- tb.teacherno , -- 这个需求不需要教师数 + concat ( 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 From ad72cf28557ae54108dfe77c1f15ba8efab05002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com> Date: Fri, 5 Feb 2021 11:30:43 +0800 Subject: [PATCH 2/4] 'commit' --- .../办学条件情况(按城乡类型).sql | 4 +- BigDataSql/办学条件情况.sql | 237 ++++++++++++++++++ 2 files changed, 239 insertions(+), 2 deletions(-) create mode 100644 BigDataSql/办学条件情况.sql diff --git a/BigDataSql/办学条件情况(按城乡类型).sql b/BigDataSql/办学条件情况(按城乡类型).sql index a05e5586..d9c0711d 100644 --- a/BigDataSql/办学条件情况(按城乡类型).sql +++ b/BigDataSql/办学条件情况(按城乡类型).sql @@ -4,8 +4,8 @@ SELECT ta.xiaosheNo, tb.studentno, -- tb.teacherno , -- 这个需求不需要教师数 - concat ( round( CAST ( ta.xiaosheNo / tb.studentno AS NUMERIC ), 2 ), '%' ) AS bl -- 计算百分比 - + -- 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 diff --git a/BigDataSql/办学条件情况.sql b/BigDataSql/办学条件情况.sql new file mode 100644 index 00000000..7e49a119 --- /dev/null +++ b/BigDataSql/办学条件情况.sql @@ -0,0 +1,237 @@ +SELECT + ta.stage,sum(ta.xiaosheNo) as xiaosheNo,sum(tb.studentno) as studentno, +-- tb.teacherno , -- 这个需求不需要教师数 + -- concat ( round( CAST ( ta.xiaosheNo / tb.studentno AS NUMERIC ), 2 ), '%' ) AS bl -- 计算百分比 + round( CAST ( sum(ta.xiaosheNo) / sum(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 +group BY ta.stage \ No newline at end of file From 95830352937f68da1e52790722d62ddc237b75e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com> Date: Sat, 6 Feb 2021 08:05:57 +0800 Subject: [PATCH 3/4] 'commit' --- BigDataSql/班额.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 BigDataSql/班额.sql diff --git a/BigDataSql/班额.sql b/BigDataSql/班额.sql new file mode 100644 index 00000000..db4ece2a --- /dev/null +++ b/BigDataSql/班额.sql @@ -0,0 +1 @@ +select * from mv_dp_bane_chengxiang order by citycountrygroup,d \ No newline at end of file From fd098948ae406e22dd35bf1fb2ec91b247ef1c2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com> Date: Sat, 6 Feb 2021 08:07:17 +0800 Subject: [PATCH 4/4] 'commit' --- BigDataSql/专任教师师生比.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 BigDataSql/专任教师师生比.sql diff --git a/BigDataSql/专任教师师生比.sql b/BigDataSql/专任教师师生比.sql new file mode 100644 index 00000000..bf22cf6b --- /dev/null +++ b/BigDataSql/专任教师师生比.sql @@ -0,0 +1 @@ +select * from mv_dp_zrjsssbl \ No newline at end of file