后台统计修改
This commit is contained in:
@ -51,7 +51,6 @@ public class DwIndexConfigController extends BaseController
|
||||
*/
|
||||
@GetMapping("/getBynf/{year}")
|
||||
public AjaxResult getBynf(@PathVariable int year){
|
||||
//todo: 还没有写完
|
||||
return AjaxResult.success(dwIndexConfigService.getBynf(year));
|
||||
}
|
||||
|
||||
@ -59,9 +58,9 @@ public class DwIndexConfigController extends BaseController
|
||||
* 根据生源地进行统计
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getSyd")
|
||||
public AjaxResult getSyd(){
|
||||
return AjaxResult.success(dwIndexConfigService.getSyd());
|
||||
@GetMapping("/getSyd/{year}")
|
||||
public AjaxResult getSyd(@PathVariable int year){
|
||||
return AjaxResult.success(dwIndexConfigService.getSyd(year));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -84,7 +84,7 @@ public interface DwIndexConfigMapper
|
||||
* 根据生源地统计学生数量
|
||||
* @return
|
||||
*/
|
||||
public List<SydVo> selectSyd();
|
||||
public List<SydVo> selectSyd(int year);
|
||||
|
||||
/**
|
||||
* 根据单位性质统计
|
||||
|
@ -80,7 +80,7 @@ public interface IDwIndexConfigService
|
||||
* 根据学生生源地统计
|
||||
* @return
|
||||
*/
|
||||
public List<SydVo> getSyd();
|
||||
public List<SydVo> getSyd(int year);
|
||||
|
||||
/**
|
||||
* 根据单位性质统计
|
||||
|
@ -128,8 +128,8 @@ public class DwIndexConfigServiceImpl implements IDwIndexConfigService
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SydVo> getSyd() {
|
||||
return dwIndexConfigMapper.selectSyd();
|
||||
public List<SydVo> getSyd(int year ) {
|
||||
return dwIndexConfigMapper.selectSyd(year);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -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>
|
||||
|
||||
|
Reference in New Issue
Block a user