| | |
| | | static AlarmManager& getInstance(); |
| | | |
| | | /** |
| | | * 设置数据库连接 |
| | | * @param db 数据库连接的指针 |
| | | */ |
| | | void setDatabase(BL::Database* db); |
| | | |
| | | /** |
| | | * 初始化报警表 |
| | | * @return 成功返回true,失败返回false |
| | | */ |
| | |
| | | */ |
| | | std::vector<AlarmData> getAlarms(int startPosition, int count); |
| | | |
| | | /** |
| | | * 获取筛选后的报警数据 |
| | | * @param id 报警ID的筛选条件 |
| | | * @param severityLevel 报警等级筛选条件 |
| | | * @param deviceName 设备名称的筛选条件 |
| | | * @param unitName 单元名称的筛选条件 |
| | | * @param description 报警描述的筛选条件 |
| | | * @param startTime 起始时间筛选条件 |
| | | * @param endTime 结束时间筛选条件 |
| | | * @param pageNumber 页码 |
| | | * @param pageSize 每页的记录数 |
| | | * @return 包含查询结果的报警数据 |
| | | */ |
| | | std::vector<AlarmData> getFilteredAlarms( |
| | | const std::string& id, |
| | | const std::string& severityLevel, |
| | | const std::string& deviceName, |
| | | const std::string& unitName, |
| | | const std::string& description, |
| | | const std::string& startTime, |
| | | const std::string& endTime, |
| | | int pageNumber, |
| | | int pageSize); |
| | | /** |
| | | * 筛选报警数据 |
| | | * @param keyword 关键字筛选条件 |
| | | * @param startTime 起始时间筛选条件 |
| | | * @param endTime 结束时间筛选条件 |
| | | * @param pageNumber 页码 |
| | | * @param pageSize 每页记录数 |
| | | * @return 包含筛选后报警数据的结构体 |
| | | */ |
| | | std::vector<AlarmData> getFilteredAlarms(const std::string& keyword, const std::string& startTime, const std::string& endTime, int pageNumber, int pageSize); |
| | | |
| | | /** |
| | | * 获取符合条件的报警总数 |
| | | * @param id 报警ID的筛选条件 |
| | | * @param severityLevel 报警等级筛选条件 |
| | | * @param deviceName 设备名称的筛选条件 |
| | | * @param unitName 单元名称的筛选条件 |
| | | * @param description 报警描述的筛选条件 |
| | | * @param keyword 关键字筛选条件 |
| | | * @param startTime 起始时间筛选条件 |
| | | * @param endTime 结束时间筛选条件 |
| | | * @return 符合条件的报警总数 |
| | | */ |
| | | int getTotalAlarmCount( |
| | | const std::string& id, |
| | | const std::string& severityLevel, |
| | | const std::string& deviceName, |
| | | const std::string& unitName, |
| | | const std::string& description, |
| | | const std::string& startTime, |
| | | const std::string& endTime); |
| | | int getTotalAlarmCount(const std::string& keyword, const std::string& startTime, const std::string& endTime); |
| | | |
| | | /** |
| | | * 更新报警结束时间 |
| | |
| | | */ |
| | | int getLastInsertId(); |
| | | |
| | | /** |
| | | * 通过事件id解除报警(更新结束时间) |
| | | * @param alarmEventId 事件ID |
| | | * @param endTime 结束时间 |
| | | * @return 成功返回true,失败返回false |
| | | */ |
| | | bool clearAlarmByEventId(int alarmEventId, const std::string& endTime); |
| | | |
| | | /** |
| | | * 通过多个属性查找并解除报警(更新结束时间) |
| | | * @param nId 报警ID |
| | | * @param nSeverityLevel 报警等级 |
| | | * @param nDeviceId 设备ID |
| | | * @param nUnitId 单元ID |
| | | * @param strDescription 描述 |
| | | * @param endTime 结束时间 |
| | | * @return 成功返回true,失败返回false |
| | | */ |
| | | bool clearAlarmByAttributes(int nId, int nDeviceId, int nUnitId, const std::string& endTime); |
| | | |
| | | /** |
| | | * 读取报警文件 |
| | | * @param filename 文件名 |