2024年9月25日 修复问题

This commit is contained in:
bai 2024-09-25 14:04:08 +08:00
parent 400025849e
commit f7d747a421
1 changed files with 26 additions and 20 deletions

View File

@ -1075,38 +1075,44 @@
select
'体育教育' as 'key',a.d1 as '01',b.d2 as '02',c.d3 as '03',d.d4 as '04'
from
(select round(round(sum(EDUSATI_TI2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_TI2 is not null and EDUSATI_TI2 != ''),2))as d1 from bl_stu_answer where main_id = #{id} and nianji = '大一' )a,
(select round(round(sum(EDUSATI_TI2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_TI2 is not null and EDUSATI_TI2 != ''),2))as d2 from bl_stu_answer where main_id = #{id} and nianji = '大二' )b,
(select round(round(sum(EDUSATI_TI2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_TI2 is not null and EDUSATI_TI2 != ''),2))as d3 from bl_stu_answer where main_id = #{id} and nianji = '大三' )c,
(select round(round(sum(EDUSATI_TI2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_TI2 is not null and EDUSATI_TI2 != ''),2))as d4 from bl_stu_answer where main_id = #{id} and nianji = '大四' )d
(select round(round(sum(EDUSATI_TI2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_TI2 is not null and EDUSATI_TI2 != '' and nianji = '大一'),2))as d1 from bl_stu_answer where main_id = #{id} and nianji = '大一' )a,
(select round(round(sum(EDUSATI_TI2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_TI2 is not null and EDUSATI_TI2 != '' and nianji = '大二'),2))as d2 from bl_stu_answer where main_id = #{id} and nianji = '大二' )b,
(select round(round(sum(EDUSATI_TI2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_TI2 is not null and EDUSATI_TI2 != '' and nianji = '大三'),2))as d3 from bl_stu_answer where main_id = #{id} and nianji = '大三' )c,
(select round(round(sum(EDUSATI_TI2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_TI2 is not null and EDUSATI_TI2 != '' and nianji = '大四'),2))as d4 from bl_stu_answer where main_id = #{id} and nianji = '大四' )d
union all
select
'美育教育' as 'key',a.d1 as '01',b.d2 as '02',c.d3 as '03',d.d4 as '04'
from
(select round(round(sum(EDUSATI_MEI2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_MEI2 is not null and EDUSATI_MEI2 != ''),2))as d1 from bl_stu_answer where main_id = #{id} and nianji = '大一' )a,
(select round(round(sum(EDUSATI_MEI2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_MEI2 is not null and EDUSATI_MEI2 != ''),2))as d2 from bl_stu_answer where main_id = #{id} and nianji = '大二' )b,
(select round(round(sum(EDUSATI_MEI2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_MEI2 is not null and EDUSATI_MEI2 != ''),2))as d3 from bl_stu_answer where main_id = #{id} and nianji = '大三' )c,
(select round(round(sum(EDUSATI_MEI2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_MEI2 is not null and EDUSATI_MEI2 != ''),2))as d4 from bl_stu_answer where main_id = #{id} and nianji = '大四' )d
(select round(round(sum(EDUSATI_MEI2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_MEI2 is not null and EDUSATI_MEI2 != '' and nianji = '大一'),2))as d1 from bl_stu_answer where main_id = #{id} and nianji = '大一' )a,
(select round(round(sum(EDUSATI_MEI2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_MEI2 is not null and EDUSATI_MEI2 != '' and nianji = '大二'),2))as d2 from bl_stu_answer where main_id = #{id} and nianji = '大二' )b,
(select round(round(sum(EDUSATI_MEI2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_MEI2 is not null and EDUSATI_MEI2 != '' and nianji = '大三'),2))as d3 from bl_stu_answer where main_id = #{id} and nianji = '大三' )c,
(select round(round(sum(EDUSATI_MEI2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_MEI2 is not null and EDUSATI_MEI2 != '' and nianji = '大四'),2))as d4 from bl_stu_answer where main_id = #{id} and nianji = '大四' )d
union all
select
'劳动教育' as 'key',a.d1 as '01',b.d2 as '02',c.d3 as '03',d.d4 as '04'
from
(select round(round(sum(EDUSATI_LAO2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_LAO2 is not null and EDUSATI_LAO2 != ''),2))as d1 from bl_stu_answer where main_id = #{id} and nianji = '大一' )a,
(select round(round(sum(EDUSATI_LAO2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_LAO2 is not null and EDUSATI_LAO2 != ''),2))as d2 from bl_stu_answer where main_id = #{id} and nianji = '大二' )b,
(select round(round(sum(EDUSATI_LAO2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_LAO2 is not null and EDUSATI_LAO2 != ''),2))as d3 from bl_stu_answer where main_id = #{id} and nianji = '大三' )c,
(select round(round(sum(EDUSATI_LAO2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_LAO2 is not null and EDUSATI_LAO2 != ''),2))as d4 from bl_stu_answer where main_id = #{id} and nianji = '大四' )d
(select round(round(sum(EDUSATI_LAO2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_LAO2 is not null and EDUSATI_LAO2 != '' and nianji = '大一'),2))as d1 from bl_stu_answer where main_id = #{id} and nianji = '大一' )a,
(select round(round(sum(EDUSATI_LAO2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_LAO2 is not null and EDUSATI_LAO2 != '' and nianji = '大二'),2))as d2 from bl_stu_answer where main_id = #{id} and nianji = '大二' )b,
(select round(round(sum(EDUSATI_LAO2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_LAO2 is not null and EDUSATI_LAO2 != '' and nianji = '大三'),2))as d3 from bl_stu_answer where main_id = #{id} and nianji = '大三' )c,
(select round(round(sum(EDUSATI_LAO2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_LAO2 is not null and EDUSATI_LAO2 != '' and nianji = '大四'),2))as d4 from bl_stu_answer where main_id = #{id} and nianji = '大四' )d
</select>
<select id="t2_20" resultType="java.util.LinkedHashMap">
select
major as 'key',
round(sum(EDUSATI_TI2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_TI2 is not null and EDUSATI_TI2 != '')) as '01',
round(sum(EDUSATI_MEI2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_MEI2 is not null and EDUSATI_MEI2 != '')) as '02',
round(sum(EDUSATI_LAO2)/(select count( 'x' ) from bl_stu_answer where main_id = #{id} and EDUSATI_LAO2 is not null and EDUSATI_LAO2 != '')) as '03'
from bl_stu_answer where main_id = #{id}
GROUP BY major
HAVING count(*) > #{minNum}
order by CONVERT(major USING gbk) COLLATE gbk_chinese_ci
a.major AS 'key',
b.val AS '01',
c.val AS '02',
d.val AS '03'
from
bl_stu_answer a
left join (select major, round(sum( EDUSATI_TI2 ) / count( 'x' )) as 'val' from bl_stu_answer where main_id = #{id} AND EDUSATI_TI2 IS NOT NULL AND EDUSATI_TI2 != '' GROUP BY major HAVING count( * ) > #{minNum}) b on a.major = b.major
left join (select major, round(sum( EDUSATI_MEI2 ) / count( 'x' )) as 'val' from bl_stu_answer where main_id = #{id} AND EDUSATI_MEI2 IS NOT NULL AND EDUSATI_MEI2 != '' GROUP BY major HAVING count( * ) > #{minNum}) c on a.major = c.major
left join (select major, round(sum( EDUSATI_LAO2 ) / count( 'x' )) as 'val' from bl_stu_answer where main_id = #{id} AND EDUSATI_LAO2 IS NOT NULL AND EDUSATI_LAO2 != '' GROUP BY major HAVING count( * ) > #{minNum}) d on a.major = d.major
where a.main_id = #{id}
GROUP BY a.major
HAVING count( * ) > #{minNum}
ORDER BY CONVERT ( a.major USING gbk ) COLLATE gbk_chinese_ci
</select>
<select id="b2_6_1" resultType="String">