change - 监控主页的告警统计类别可以自定义,而不是直接和1.2分页的告警类型挂钩

main
wenjy 3 years ago
parent 846a0491a7
commit 9ba9a7d6d5

@ -360,7 +360,7 @@ public class IndexController {
List<Integer> data = new ArrayList<>();
List<BaseAlarmModuleDto> baseAlarmModuleDtos =
baseAlarmModuleService.selectAlarmModuleAmountList(new BaseAlarmModule());
baseAlarmModuleService.selectAlarmCategoryAmountList(new BaseAlarmModule());
if (baseAlarmModuleDtos.size() > 0) {
baseAlarmModuleDtos.forEach(

@ -69,4 +69,13 @@ public interface BaseAlarmModuleMapper
*/
public List<BaseAlarmModuleDto> selectAlarmModuleAmountList(BaseAlarmModule baseAlarmModule);
/**
*
* @author WenJY
* @date 2022/5/3 13:45
* @param baseAlarmModule
* @return java.util.List<com.ruoyi.system.domain.dto.BaseAlarmModuleDto>
*/
public List<BaseAlarmModuleDto> selectAlarmCategoryAmountList(BaseAlarmModule baseAlarmModule);
}

@ -69,4 +69,12 @@ public interface IBaseAlarmModuleService
*/
public List<BaseAlarmModuleDto> selectAlarmModuleAmountList(BaseAlarmModule baseAlarmModule);
/**
*
* @author WenJY
* @date 2022/5/3 13:45
* @param baseAlarmModule
* @return java.util.List<com.ruoyi.system.domain.dto.BaseAlarmModuleDto>
*/
public List<BaseAlarmModuleDto> selectAlarmCategoryAmountList(BaseAlarmModule baseAlarmModule);
}

@ -105,4 +105,9 @@ public class BaseAlarmModuleServiceImpl implements IBaseAlarmModuleService
public List<BaseAlarmModuleDto> selectAlarmModuleAmountList(BaseAlarmModule baseAlarmModule) {
return baseAlarmModuleMapper.selectAlarmModuleAmountList(baseAlarmModule);
}
@Override
public List<BaseAlarmModuleDto> selectAlarmCategoryAmountList(BaseAlarmModule baseAlarmModule) {
return baseAlarmModuleMapper.selectAlarmCategoryAmountList(baseAlarmModule);
}
}

@ -157,4 +157,18 @@
order by t1.Order_Flag
</select>
<select id="selectAlarmCategoryAmountList" parameterType="BaseAlarmModule" resultMap="BaseAlarmModuleDtoResult">
select a.AlarmModule_Text,sum(a.alarmModuleAmount) as alarmModuleAmount
from (select t5.AlarmCategory_Name as AlarmModule_Text,count(t4.Alarm_Value) as alarmModuleAmount
from base_alarm_module t1
left join base_monitorunit_info t2 on t2.MonitorUnit_Type = t1.MonitorUnit_Id
left join base_sensor_info t3 on t2.MonitorUnit_Id = t3.MonitorUnit_Id
left join record_alarm t4 on t3.Sensor_Id = t4.Sensor_Id and t1.AlarmType_Id = t4.AlarmType_Id
left join base_alarm_category t5 on t1.AlarmCategory_Id = t5.AlarmCategory_Id
where t5.AlarmCategory_Id is not null
group by t1.AlarmModule_Text,t1.Order_Flag,t5.AlarmCategory_Name
order by t1.Order_Flag) a
group by a.AlarmModule_Text
</select>
</mapper>
Loading…
Cancel
Save