DBServiceSet.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. #ifndef DBSERVICESET_H
  2. #define DBSERVICESET_H
  3. #include "ClassSet.h"
  4. class DBServiceSet
  5. {
  6. public:
  7. explicit DBServiceSet(QObject *parent = nullptr);
  8. //////////////////////common-start////////////////////
  9. int getNextId(QString tableName);
  10. //////////////////////common-start////////////////////
  11. //////////////////////节点权重值持久化-start////////////////////
  12. /*单个节点信息新增*/
  13. //添加信息
  14. bool AddNodeWeightInfo(const DemandWeight &demandWeight);
  15. /*批量节点信息新增*/
  16. bool AddNodeWeightInfoList(const QList<DemandWeight *> &demandWeightList);
  17. /*修改节点值*/
  18. bool UpdateNodeValue(const DemandWeight &demandWeight);
  19. /*批量修改节点值*/
  20. bool UpdateNodeValueList(const QList<DemandWeight *> demandWeightList);
  21. bool QueryByTableIndexAndTableMsg(int expertId, int engineerId, int tableIndex, QString tableMsg);
  22. bool QueryByTableIndexAndTableMsg(QString expertId, int engineerId, int tableIndex, QString tableMsg);
  23. bool QueryByTableIndexAndTableMsgAndPage(QString expertId, int engineerId, int tableIndex, QString tableMsg,
  24. int page);
  25. bool QueryByTableIndexAndTableMsg(QList<DemandWeight *> *demandWeightList, int expertId, int engineerId,
  26. int tableIndex, QString tableMsg);
  27. bool QueryByTableIndexAndTableMsg(QList<DemandWeight *> *demandWeightList, QString expertId, int engineerId,
  28. int tableIndex, QString tableMsg);
  29. bool QueryByPageIndexAndTableMsg(QList<DemandWeight *> *demandWeightList, QString expertId, int engineerId,
  30. int pageIndex, QString tableMsg);
  31. bool updateValidByExperIdAndEngineerId(int expertId, int engineerId);
  32. bool QuerySecondDemandWeightByEngineerId(QList<DemandWeight *> *demandWeightList, int expertId, int engineerId,
  33. QString tableMsg);
  34. bool QuerySecondDemandWeightByEngineerIdAndMaxPage(QList<DemandWeight *> *demandWeightList, int expertId,
  35. int engineerId, QString tableMsg);
  36. bool QuerySecondDemandWeightByEngineerId(QList<DemandWeight *> *demandWeightList, QString expertIds, int engineerId,
  37. QString tableMsg);
  38. // bool QueryFirstDemandWeightByEngineerId(QList<DemandWeight *> *demandWeightList, int expertId, int engineerId,
  39. // QString tableMsg);
  40. bool QueryFirstDemandWeightByEngineerId(QList<DemandWeight *> *demandWeightList, int expertId, int engineerId,
  41. QString tableMsg);
  42. bool QueryLastDemandWeightByEngineerId(QList<DemandWeight *> *demandWeightList, int expertId, int engineerId,
  43. QString tableMsg, int tableIndex);
  44. bool QueryFirstDemandWeightByEngineerId(QList<DemandWeight *> *demandWeightList, QString expertIds, int engineerId,
  45. QString tableMsg);
  46. bool QueryLastPageDemandWeightByEngineerId(QList<DemandWeight *> *demandWeightList, QString expertIds,
  47. int engineerId, QString tableMsg, int page);
  48. //////////////////////common-start////////////////////
  49. ////////////////////方案持久化-start////////////////////
  50. bool AddSchemeInfoList(const QList<SchemaEval *> &schemaEvalList);
  51. bool DeleteSchemeByEngineerId(int engineerId);
  52. bool QuerySchemeInfoByEngineerId(QList<SchemaEval *> *schemeList, int engineerId);
  53. //////////////////////common-start////////////////////
  54. //////////////////////技术重要度持久化-start////////////////////
  55. //添加信息
  56. bool AddTechnicalImportInfo(const TechnicalImport &technicalImport);
  57. bool AddTechnicalImportInfoList(const QList<TechnicalImport *> &technicalImportList);
  58. /*批量修改节点值*/
  59. bool UpdateTechnicalImportInfoList(const QList<TechnicalImport *> technicalImportList);
  60. bool QueryTechnicalImportInfoByEngineerId(QList<TechnicalImport *> *technicalImportList, int expertId,
  61. int engineerId);
  62. bool QueryTechnicalImportInfoByEngineerId(int expertId, int engineerId);
  63. //////////////////////common-start////////////////////
  64. //////////////////////节点矩阵信息表-start////////////////////
  65. /*单个节点信息新增*/
  66. //添加信息
  67. bool AddNodeMatrixInfo(const NodeMatrixInfo &nodeMatrixInfo);
  68. /*批量节点信息新增*/
  69. bool AddNodeMatrixInfoList(const QList<NodeMatrixInfo *> &jbInfoList);
  70. /*批量节点信息新增----专家端*/
  71. bool AddNodeMatrixInfoList2(const QList<NodeMatrixInfo *> &jbInfoList);
  72. /*修改节点值*/
  73. bool UpdateNodeMatrixNodeValue(const NodeMatrixInfo &nodeMatrixInfo);
  74. /*批量修改节点值*/
  75. bool UpdateNodeMatrixNodeValueList(const QList<NodeMatrixInfo *> jbInfoList);
  76. /*批量修改节点值--专家端*/
  77. bool UpdateNodeMatrixNodeValueList2(const QList<NodeMatrixInfo *> jbInfoList);
  78. /*根据专家姓名查询对应的节点信息*/
  79. bool QueryNodeMatrixListByExpertName(QList<NodeMatrixInfo *> *nodeMatrixInfoList, QString expertName);
  80. bool QueryNodeMatrixListByExpertNameAndEngineerId(QString expertName, int engineerId, QString tableMsg,
  81. QString mark);
  82. /*根据专家id查询对应的节点信息*/
  83. bool QueryNodeMatrixListByExpertIdAndEngineerId(QString expertId, int engineerId, QString tableMsg);
  84. /*根据专家名称和工程ID查询对应的节点信息*/
  85. bool QueryNodeMatrixListByExpertNameAndEngineerId(QList<NodeMatrixInfo *> *nodeMatrixInfoList, QString expertName,
  86. int engineerId);
  87. /*根据专家名称和工程ID查询对应的节点信息--专家端*/
  88. bool QueryNodeMatrixListByExpertNameAndEngineerId2(QString expertName, int engineerId, QString tableMsg,
  89. QString mark, int tabIndex);
  90. bool QueryNodesByExpertNameAndEngineerId2(QList<NodeMatrixInfo *> *nodeMatrixInfoList, QString expertName,
  91. int engineerId, QString tableMsg, QString mark, int tabIndex);
  92. /*根据专家id和工程ID查询对应的节点信息*/
  93. bool QueryNodeMatrixListByExpertIdAndEngineerId(QList<NodeMatrixInfo *> *nodeMatrixInfoList, int expertId,
  94. int engineerId, QString tableMsg);
  95. /*判断专家是否已录入数据*/
  96. bool QueryNodeValueByUserIdAndEngineerId(int experId, int engineerId);
  97. /*根据专家id和工程ID查询对应的节点信息 ---专家端*/
  98. bool QueryNodeMatrixListByExpertIdAndEngineerId2(QList<NodeMatrixInfo *> *nodeMatrixInfoList, int expertId,
  99. int engineerId, QString tableMsg);
  100. /*根据专家编号查询对应的节点信息*/
  101. bool QueryNodeMatrixListByExpertId(QList<NodeMatrixInfo *> *nodeMatrixInfoList, int expertId);
  102. /*根据工程编号查询节点矩阵信息*/
  103. bool QueryNodeMatrixListByEngineerId(QList<NodeMatrixInfo *> *nodeMatrixInfoList, int engineerId);
  104. /*根据工程编号删除节点信息*/
  105. bool DeleteNodeMatrixListByEngineerId(int engineerId);
  106. /*根据专家姓名删除节点信息*/
  107. bool DeleteNodeMatrixListByExpertName(QString expertName);
  108. /*根据专家编号删除节点信息*/
  109. bool DeleteNodeMatrixListByExpertId(int expertId);
  110. //////////////////////节点矩阵信息表-end/////////////////////
  111. //////////////////////工程信息表-start////////////////////
  112. //添加信息
  113. bool AddEngineerInfo(const EngineerInfo &engineerInfo);
  114. int AddEngineerInfoReturnId(const EngineerInfo &engineerInfo);
  115. /*修改节点值*/
  116. bool UpdateEngineerInfo(const EngineerInfo &engineerInfo);
  117. bool UpdateEngineerIndex(int enjId, int indexId);
  118. bool UpdateEngineerMessaure(int enjId, int messaureId);
  119. bool UpdateEngineerSchema(int enjId, int schemaId);
  120. bool UpdateNameById(QString name, int id);
  121. /*根据指标体系id查询工程信息*/
  122. bool QueryEngineerByEngineerId(EngineerInfo *engineerInfo, int engineerId);
  123. /*根据指标体系名查询工程信息*/
  124. bool QueryEngineerByEngineerName(EngineerInfo *engineerInfo, QString engineerName);
  125. /*根据指标体系id查询工程信息*/
  126. bool QueryEngineerList(QList<EngineerInfo *> *engineerInfoList);
  127. bool QueryEngineerListByName(QList<EngineerInfo *> *engineerInfoList, QString engineerName);
  128. /*根据指标体系id查询工程信息*/
  129. bool QueryEngineerListByIndexSetId(QList<EngineerInfo *> *engineerInfoList, int indexSetId);
  130. /*根据测量方法ig查询对应的工程信息*/
  131. bool QueryEngineerListByMeasureFunctionId(QList<EngineerInfo *> *engineerInfoList, int measureFunctionId);
  132. /*根据工程编号删除工程信息*/
  133. bool DeleteEngineerByEngineerId(int engineerId);
  134. /*根据指标体系编号删除工程信息*/
  135. bool DeleteEngineerByIndexSetId(int indexSetId);
  136. /*根据测量方法编号删除工程信息*/
  137. bool DeleteEngineerByMeasureFunctionId(int measureFunctionId);
  138. /*删除所有工程*/
  139. bool DeleteEngineers();
  140. //删除其他工程id
  141. bool DeleteEngineerNotInId(int id, QString dbPath);
  142. bool QueryChlidNodeByPId(int pid, QString dbName, QString mindPath);
  143. //////////////////////工程信息表-end////////////////////
  144. //////////////////////用户信息表-start////////////////////
  145. //添加信息
  146. int AddUserInfo(const UserInfo &userInfo);
  147. /*修改用户信息*/
  148. bool UpdateUserInfo(const UserInfo &userInfo);
  149. bool UpdateUserPassword(QString userNo, QString password);
  150. bool UpdateUserById(QString userNo, QString password, int id);
  151. /*根据用户id查询用户信息*/
  152. bool QueryUserInfoById(UserInfo *userInfo, int userId);
  153. bool QueryUserInfoByUnserInfo(const UserInfo &paramInfo, UserInfo &queryInfo);
  154. // int QueryUserInfoByUserNoAndPhone(QString);
  155. /*根据列名称和列值模糊查询用户信息,列名称为实体类中的属性名称*/
  156. bool QueryUserListByColumnAndColumnValue(QList<UserInfo *> *userInfoList, QString columnName, QString columnValue);
  157. bool QueryUserList(QList<UserInfo *> *userInfoList);
  158. bool QueryUserListNotAdmin(QList<UserInfo *> *userInfoList);
  159. /*根据用户编号删除用户信息*/
  160. bool DeleteUserById(int Id);
  161. bool QueryUserByNoAndPassword(UserInfo *userInfo, QString userNo, QString password);
  162. bool QueryUserByNo(UserInfo *userInfo, QString userNo);
  163. /*获取工程用户列表*/
  164. bool QueryUserListByEngineerId(QList<UserInfo *> *userInfoList, int engineerId);
  165. //删除除管理管外的所有用户
  166. bool DeleteUserByRole(int roleType);
  167. //专家本地库查询信息
  168. bool QueryUserInfoById2(UserInfo *userInfo, int userId);
  169. bool UpdateUserInfo2(const UserInfo &userInfo);
  170. int AddUserInfo2(const UserInfo &userInfo);
  171. //////////////////////用户信息表-end////////////////////
  172. //////////////////////评估方案表-start////////////////////
  173. //添加信息
  174. bool AddPlanInfo(const PlanInfo &planInfo);
  175. /*修改评估方案信息*/
  176. bool UpdatePlanInfo(const PlanInfo &planInfo);
  177. /*根据评估方案id查询评估方案信息*/
  178. bool QueryPlanInfoById(PlanInfo *planInfo, int planId);
  179. /*根据列名称和列值模糊查询评估方案信息,列名称为实体类中的属性名称*/
  180. bool QueryPlanListByColumnAndColumnValue(QList<PlanInfo *> *planInfoList, QString columnName, QString columnValue);
  181. bool QueryPlanList(QList<PlanInfo *> *planInfoList);
  182. /*根据评估方案编号删除评估方案信息*/
  183. bool DeletePlanById(int planId);
  184. //////////////////////评估方案表-end////////////////////
  185. //////////////////////评估方案指标体系关系表-start////////////////////
  186. //添加信息
  187. // bool AddIndexSetPlanInfo(const IndexSetPlanInfo &planInfo);
  188. bool AddIndexSetPlanInfoList(const QList<IndexSetPlanInfo *> planInfoList);
  189. /*修改信息*/
  190. bool UpdateIndexSetPlanInfo(const IndexSetPlanInfo &planInfo);
  191. bool UpdateIndexSetPlanInfoList(const QList<IndexSetPlanInfo *> planInfoList);
  192. /*根据id查询信息*/
  193. bool QueryIndexSetPlanInfo(IndexSetPlanInfo *planInfo, int Id);
  194. /*根据列名称和列值模糊查询信息,列名称为实体类中的属性名称*/
  195. bool QueryIndexSetPlanListByColumnAndColumnValue(QList<IndexSetPlanInfo *> *planInfoList, QString columnName,
  196. QString columnValue);
  197. /*根据编号删除关联信息*/
  198. bool DeleteIndexSetPlanById(int Id);
  199. bool DeleteIndexSetPlanByPlanId(int planId);
  200. bool DeleteIndexSetPlanByIndexSetId(int indexSetId);
  201. //////////////////////评估方案指标体系关系表-end////////////////////
  202. //////////////////////用户工程配置-start////////////////////
  203. //添加信息
  204. int AddUserConfig(const UserConfig &cfg);
  205. //添加配置列表
  206. bool AddUserConfigList(QList<UserConfig *> cfgList);
  207. /*修改用户工程配置*/
  208. bool UpdateUserConfig(const UserConfig &cfg);
  209. /*修改用户工程配置为无效状态*/
  210. bool UpdateUserValid(int userId, int flag);
  211. /*查询该工程用户权重和*/
  212. int QueryUserWeightSum(int engineerId);
  213. int QueryUserWeightSum(int engineerId, int userId);
  214. /*根据用户工程配置id查询用户工程配置*/
  215. bool QueryUserConfigInfoById(UserConfig *cfg, int cfgId);
  216. bool QueryUserConfigListInfoByUserId(QList<UserConfig *> *userCfgList, int userId);
  217. bool QueryUserConfigListInfoByUserIdAndEngineerId(UserConfig *userCfg, int userId, int engineerId);
  218. bool QueryUserConfigListInfoByEngineerId(QList<UserConfig *> *userCfgList, int engineerId);
  219. bool QueryAllUserConfig(QList<UserConfig *> *userCfgList);
  220. /*根据用户工程配置id删除用户工程配置*/
  221. bool DeleteUserConfigById(int cfgId);
  222. bool DeleteUserConfigByEngineerId(int enjId);
  223. bool DeleteUserConfigByUserId(int userId);
  224. //////////////////////用户工程配置-end////////////////////
  225. };
  226. #endif // DBSERVICESET_H