预警统计添加按年和按月

This commit is contained in:
cjw 2024-05-21 18:00:22 +08:00
parent eebc4f3ca1
commit f12332f282
5 changed files with 16 additions and 15 deletions

View File

@ -50,8 +50,8 @@ public class StatisticController extends BaseController {
* 获取预警情况统计-整体
*/
@GetMapping("/warn/all")
public R<StatisticWarnVo> getWarn4All() {
return R.ok(statisticService.getWarn4All());
public R<StatisticWarnVo> getWarn4All(String select) {
return R.ok(statisticService.getWarn4All(select));
}
/**
@ -106,8 +106,8 @@ public class StatisticController extends BaseController {
* 获取总预警数
*/
@GetMapping("/warn/num")
public R<Integer> getWarnNum(String select) {
return R.ok(statisticService.getWarnNum(select));
public R<Integer> getWarnNum() {
return R.ok(statisticService.getWarnNum());
}
/**

View File

@ -25,11 +25,11 @@ public interface StatisticMapper {
List<StatisticFactorVo> selectStatisticFactor(@Param("batchNo") Long batchNo, @Param("scaleId") Long scaleId);
StatisticWarnVo selectStatisticWarn4All();
StatisticWarnVo selectStatisticWarn4All(@Param("startTime") String startTime);
int selectUserNum();
int selectEvaluationNum();
int selectWarnNum(@Param("startTime") String startTime);
int selectWarnNum();
int selectInterveneNum();
List<StatisticNumVo> selectScalePublishNum();

View File

@ -24,11 +24,11 @@ public interface IStatisticService {
List<StatisticFactorVo> getFactor4Class(BaseQueryBo query);
StatisticWarnVo getWarn4All();
StatisticWarnVo getWarn4All(String select);
int getUserNum();
int getEvaluationNum();
int getWarnNum(String select);
int getWarnNum();
int getInterveneNum();
List<StatisticNumVo> getScalePublishNum();
List<StatisticNumVo> getPublishAndEvaluationNumByGrade(String select);

View File

@ -163,8 +163,9 @@ public class StatisticServiceImpl implements IStatisticService {
}
@Override
public StatisticWarnVo getWarn4All() {
return statisticMapper.selectStatisticWarn4All();
public StatisticWarnVo getWarn4All(String select) {
String startTime = getStartTimeBySelect(select);
return statisticMapper.selectStatisticWarn4All(startTime);
}
@Override
@ -178,9 +179,9 @@ public class StatisticServiceImpl implements IStatisticService {
}
@Override
public int getWarnNum(String select) {
String startTime = getStartTimeBySelect(select);
return statisticMapper.selectWarnNum(startTime);
public int getWarnNum() {
//String startTime = getStartTimeBySelect(select);
return statisticMapper.selectWarnNum();
}
@Override

View File

@ -57,7 +57,8 @@
count(if(sfr.situation = 5, 1, null)) as `majorNum`
from sys_evaluation_conclusion ec
left join sys_scale_factor_range sfr on sfr.range_id = ec.factor_range_id
where ec.status = 1
left join sys_evaluation_record er on er.record_id = ec.record_id
where ec.status = 1 and er.create_time &gt;= #{startTime}
</select>
<select id="selectUserNum" resultType="int">
@ -75,7 +76,6 @@
<select id="selectWarnNum" resultType="int">
select count(*)
from sys_warn_record
where warn_time &gt;= #{startTime}
</select>
<select id="selectInterveneNum" resultType="int">