|
|
@@ -15,6 +15,7 @@ import com.xjrsoft.module.courseTable.entity.CourseTable;
|
|
|
import com.xjrsoft.module.courseTable.service.ICourseTableService;
|
|
|
import com.xjrsoft.module.databoard.dto.StatisticsDto;
|
|
|
import com.xjrsoft.module.databoard.vo.CourseStatisticsVo;
|
|
|
+import com.xjrsoft.module.databoard.vo.HealthStatisticsVo;
|
|
|
import com.xjrsoft.module.databoard.vo.MeetingStatisticsVo;
|
|
|
import com.xjrsoft.module.databoard.vo.PersonStatisticsVo;
|
|
|
import com.xjrsoft.module.databoard.vo.ProcessStatisticsVo;
|
|
|
@@ -259,4 +260,31 @@ public class DataboardController {
|
|
|
return RT.ok(result);
|
|
|
}
|
|
|
|
|
|
+ @GetMapping(value = "/health-statistics")
|
|
|
+ @ApiOperation(value="学生健康统计")
|
|
|
+ @SaCheckPermission("databoard:detail")
|
|
|
+ public RT<HealthStatisticsVo> healthStatistics(@Valid StatisticsDto dto){
|
|
|
+ String sql = "SELECT gender,COUNT(*) AS a_count FROM student_infection WHERE status = 1 GROUP BY gender";
|
|
|
+ List<Map<String, Object>> list = SqlRunnerAdapter.db().selectList(sql);
|
|
|
+ HealthStatisticsVo result = new HealthStatisticsVo();
|
|
|
+ for (Map<String, Object> objectMap : list) {
|
|
|
+ if(GenderDictionaryEnum.FEMALE.getCode().equals(objectMap.get("gender").toString())){
|
|
|
+ result.setInfectionFemaleCount(Integer.parseInt(objectMap.get("a_count").toString()));
|
|
|
+ }if(GenderDictionaryEnum.MALE.getCode().equals(objectMap.get("gender").toString())){
|
|
|
+ result.setInfectionMaleCount(Integer.parseInt(objectMap.get("a_count").toString()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ sql = "SELECT gender,COUNT(*) AS a_count FROM student_psychological WHERE status = 1 GROUP BY gender";
|
|
|
+ list = SqlRunnerAdapter.db().selectList(sql);
|
|
|
+ for (Map<String, Object> objectMap : list) {
|
|
|
+ if(GenderDictionaryEnum.FEMALE.getCode().equals(objectMap.get("gender").toString())){
|
|
|
+ result.setInfectionFemaleCount(Integer.parseInt(objectMap.get("a_count").toString()));
|
|
|
+ }if(GenderDictionaryEnum.MALE.getCode().equals(objectMap.get("gender").toString())){
|
|
|
+ result.setPsychologicalMaleCount(Integer.parseInt(objectMap.get("a_count").toString()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return RT.ok(result);
|
|
|
+ }
|
|
|
+
|
|
|
}
|