MindWeightService.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef MINDWEIGHTSERVICE_H
  2. #define MINDWEIGHTSERVICE_H
  3. #include <QObject>
  4. class MindWeightInfo;
  5. class MindWeightService : public QObject
  6. {
  7. Q_OBJECT
  8. public:
  9. explicit MindWeightService(QObject *parent = nullptr);
  10. /// 保存权重数据
  11. /// 保存前先查询数据是否已存在, 是则更新数据, 否则新增数据
  12. /// 数据的唯一性由项目id,指标体系类型,数据来源,算法共同确定
  13. bool saveUniqueWeightData(int projId, int indexType, int dataSource, int algorithm, const QString &weight);
  14. ///
  15. /// \brief queryWeightData 查询权重数据
  16. /// \param info 存储权重数据
  17. /// \param projId 项目 id
  18. /// \param indexType 指标体系类型
  19. /// \param dataSource 数据来源
  20. /// \param algorithm 算法
  21. /// \return 成功 or 失败
  22. bool queryWeightData(MindWeightInfo *info, int projId, int indexType, int dataSource, int algorithm);
  23. bool queryWeightData(MindWeightInfo *info, int projId, int indexType);
  24. ///
  25. /// \brief updateWeightData 更新权重数据
  26. /// \param id 主键
  27. /// \param weight 权重
  28. /// \return 成功 or 失败
  29. bool updateWeightData(int id, const QString &weight);
  30. bool deleteWeightData(int id);
  31. private:
  32. /// 保存权重数据
  33. bool saveWeightData(MindWeightInfo *info);
  34. signals:
  35. };
  36. #endif // MINDWEIGHTSERVICE_H