1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #ifndef MINDWEIGHTSERVICE_H
- #define MINDWEIGHTSERVICE_H
- #include <QObject>
- class MindWeightInfo;
- class MindWeightService : public QObject
- {
- Q_OBJECT
- public:
- explicit MindWeightService(QObject *parent = nullptr);
- /// 保存权重数据
- /// 保存前先查询数据是否已存在, 是则更新数据, 否则新增数据
- /// 数据的唯一性由项目id,指标体系类型,数据来源,算法共同确定
- bool saveUniqueWeightData(int projId, int indexType, int dataSource, int algorithm, const QString &weight);
- ///
- /// \brief queryWeightData 查询权重数据
- /// \param info 存储权重数据
- /// \param projId 项目 id
- /// \param indexType 指标体系类型
- /// \param dataSource 数据来源
- /// \param algorithm 算法
- /// \return 成功 or 失败
- bool queryWeightData(MindWeightInfo *info, int projId, int indexType, int dataSource, int algorithm);
- bool queryWeightData(MindWeightInfo *info, int projId, int indexType);
- ///
- /// \brief updateWeightData 更新权重数据
- /// \param id 主键
- /// \param weight 权重
- /// \return 成功 or 失败
- bool updateWeightData(int id, const QString &weight);
- bool deleteWeightData(int id);
- private:
- /// 保存权重数据
- bool saveWeightData(MindWeightInfo *info);
- signals:
- };
- #endif // MINDWEIGHTSERVICE_H
|