后台统计修改
This commit is contained in:
@ -52,7 +52,7 @@ spring:
|
|||||||
# 国际化资源文件路径
|
# 国际化资源文件路径
|
||||||
basename: i18n/messages
|
basename: i18n/messages
|
||||||
profiles:
|
profiles:
|
||||||
active: test
|
active: dev
|
||||||
# 文件上传
|
# 文件上传
|
||||||
servlet:
|
servlet:
|
||||||
multipart:
|
multipart:
|
||||||
|
@ -51,7 +51,6 @@ public class DwIndexConfigController extends BaseController
|
|||||||
*/
|
*/
|
||||||
@GetMapping("/getBynf/{year}")
|
@GetMapping("/getBynf/{year}")
|
||||||
public AjaxResult getBynf(@PathVariable int year){
|
public AjaxResult getBynf(@PathVariable int year){
|
||||||
//todo: 还没有写完
|
|
||||||
return AjaxResult.success(dwIndexConfigService.getBynf(year));
|
return AjaxResult.success(dwIndexConfigService.getBynf(year));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,9 +58,9 @@ public class DwIndexConfigController extends BaseController
|
|||||||
* 根据生源地进行统计
|
* 根据生源地进行统计
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getSyd")
|
@GetMapping("/getSyd/{year}")
|
||||||
public AjaxResult getSyd(){
|
public AjaxResult getSyd(@PathVariable int year){
|
||||||
return AjaxResult.success(dwIndexConfigService.getSyd());
|
return AjaxResult.success(dwIndexConfigService.getSyd(year));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -84,7 +84,7 @@ public interface DwIndexConfigMapper
|
|||||||
* 根据生源地统计学生数量
|
* 根据生源地统计学生数量
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<SydVo> selectSyd();
|
public List<SydVo> selectSyd(int year);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据单位性质统计
|
* 根据单位性质统计
|
||||||
|
@ -80,7 +80,7 @@ public interface IDwIndexConfigService
|
|||||||
* 根据学生生源地统计
|
* 根据学生生源地统计
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<SydVo> getSyd();
|
public List<SydVo> getSyd(int year);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据单位性质统计
|
* 根据单位性质统计
|
||||||
|
@ -128,8 +128,8 @@ public class DwIndexConfigServiceImpl implements IDwIndexConfigService
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SydVo> getSyd() {
|
public List<SydVo> getSyd(int year ) {
|
||||||
return dwIndexConfigMapper.selectSyd();
|
return dwIndexConfigMapper.selectSyd(year);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -17,6 +17,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="answerCount" column="answer_count" />
|
<result property="answerCount" column="answer_count" />
|
||||||
</resultMap>
|
</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">
|
<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
|
select id, index_name, question_id, info_id, index_type, create_by, create_time, update_by, update_time, remark from dw_index_config
|
||||||
</sql>
|
</sql>
|
||||||
@ -82,8 +97,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
group by answer
|
group by answer
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectBynf" resultType="com.ruoyi.dw.domain.vo.BynfVo" parameterType="int">
|
<select id="selectBynf" resultMap="bynfVo" parameterType="int">
|
||||||
select bynf,count(0) as bubf_count
|
select bynf,count(0) as bynf_count
|
||||||
from cj_student
|
from cj_student
|
||||||
where sfqr = 1
|
where sfqr = 1
|
||||||
and cast(bynf as unsigned)
|
and cast(bynf as unsigned)
|
||||||
@ -91,28 +106,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
group by bynf order by bynf desc
|
group by bynf order by bynf desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectSyd" resultType="com.ruoyi.dw.domain.vo.SydVo">
|
<select id="selectSyd" resultMap="sydVo" parameterType="int">
|
||||||
SELECT
|
SELECT
|
||||||
CASE
|
CASE
|
||||||
WHEN sydsh = '山东省' THEN sydshi
|
WHEN sydsh = '山东' THEN sydshi
|
||||||
ELSE '省外'
|
ELSE '省外'
|
||||||
END AS city,
|
END AS city,
|
||||||
COUNT(*) AS student_count
|
COUNT(*) AS student_count
|
||||||
FROM cj_student
|
FROM cj_student
|
||||||
where sfqr = 1
|
where sfqr = 1
|
||||||
|
and cast(bynf as unsigned)
|
||||||
|
between YEAR(CURRENT_DATE) - #{year} + 1 and YEAR(CURRENT_DATE)
|
||||||
GROUP BY
|
GROUP BY
|
||||||
CASE
|
CASE
|
||||||
WHEN sydsh = '山东省' THEN sydshi
|
WHEN sydsh = '山东' THEN sydshi
|
||||||
ELSE '省外'
|
ELSE '省外'
|
||||||
END
|
END
|
||||||
ORDER BY
|
|
||||||
CASE
|
|
||||||
WHEN syd_sheng = '山东省' THEN sydshi
|
|
||||||
ELSE sydsh
|
|
||||||
END;
|
|
||||||
</select>
|
</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 dwxz,count(0) as dwxz_count from cj_student where sfqr = 1 group by dwxz
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user