From 6015ba5d522cb55d5bdf796bdafe8c2a0cc11652 Mon Sep 17 00:00:00 2001 From: wubin Date: Sat, 6 Feb 2021 10:56:20 +0800 Subject: [PATCH] update --- ....sql => 城乡专任教师师生比.sql} | 0 .../第二页/专任教师师生比.sql | 1 + .../第二页/城乡专任教师师生比.sql | 66 +++++++++++++++++++ 3 files changed, 67 insertions(+) rename BigDataSql/第一页/{城乡类型按学段师生比.sql => 城乡专任教师师生比.sql} (100%) create mode 100644 BigDataSql/第二页/专任教师师生比.sql create mode 100644 BigDataSql/第二页/城乡专任教师师生比.sql diff --git a/BigDataSql/第一页/城乡类型按学段师生比.sql b/BigDataSql/第一页/城乡专任教师师生比.sql similarity index 100% rename from BigDataSql/第一页/城乡类型按学段师生比.sql rename to 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 diff --git a/BigDataSql/第二页/城乡专任教师师生比.sql b/BigDataSql/第二页/城乡专任教师师生比.sql new file mode 100644 index 00000000..bfdf4b2a --- /dev/null +++ b/BigDataSql/第二页/城乡专任教师师生比.sql @@ -0,0 +1,66 @@ +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 \ No newline at end of file