后台统计修改

This commit is contained in:
2025-07-21 14:50:21 +08:00
parent 424d654f83
commit 2d3cb0845c
6 changed files with 31 additions and 20 deletions

View File

@ -17,6 +17,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="answerCount" column="answer_count" />
</resultMap>
<resultMap type="BynfVo" id="bynfVo">
<result property="bynf" column="bynf" />
<result property="bynfCount" column="bynf_count" />
</resultMap>
<resultMap type="SydVo" id="sydVo">
<result property="city" column="city" />
<result property="studentCount" column="student_count" />
</resultMap>
<resultMap type="DwxzVo" id="dwxzVo">
<result property="dwxz" column="dwxz" />
<result property="dwxzCount" column="dwxz_count" />
</resultMap>
<sql id="selectDwIndexConfigVo">
select id, index_name, question_id, info_id, index_type, create_by, create_time, update_by, update_time, remark from dw_index_config
</sql>
@ -82,8 +97,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
group by answer
</select>
<select id="selectBynf" resultType="com.ruoyi.dw.domain.vo.BynfVo" parameterType="int">
select bynf,count(0) as bubf_count
<select id="selectBynf" resultMap="bynfVo" parameterType="int">
select bynf,count(0) as bynf_count
from cj_student
where sfqr = 1
and cast(bynf as unsigned)
@ -91,28 +106,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
group by bynf order by bynf desc
</select>
<select id="selectSyd" resultType="com.ruoyi.dw.domain.vo.SydVo">
<select id="selectSyd" resultMap="sydVo" parameterType="int">
SELECT
CASE
WHEN sydsh = '山东' THEN sydshi
WHEN sydsh = '山东' THEN sydshi
ELSE '省外'
END AS city,
COUNT(*) AS student_count
FROM cj_student
where sfqr = 1
and cast(bynf as unsigned)
between YEAR(CURRENT_DATE) - #{year} + 1 and YEAR(CURRENT_DATE)
GROUP BY
CASE
WHEN sydsh = '山东' THEN sydshi
WHEN sydsh = '山东' THEN sydshi
ELSE '省外'
END
ORDER BY
CASE
WHEN syd_sheng = '山东省' THEN sydshi
ELSE sydsh
END;
</select>
<select id="selectDwxz" resultType="com.ruoyi.dw.domain.vo.DwxzVo">
<select id="selectDwxz" resultMap="dwxzVo">
select dwxz,count(0) as dwxz_count from cj_student where sfqr = 1 group by dwxz
</select>