DataBaseService.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include <afxwin.h>
  3. #include "../sqlite/CppSQLite3.h"
  4. #include <string>
  5. #include <vector>
  6. #include "../SmartEvaluationLogic/ScanDll.h"
  7. using namespace std;
  8. class CDataBaseService
  9. {
  10. public:
  11. CDataBaseService(void);
  12. ~CDataBaseService(void);
  13. bool InsertPapers(const wstring& db_path, vector<string>& list_papers);
  14. bool UpdateIndexPicWrong(int total_cnt, int id);
  15. bool InsertIndex(int total_cnt, int& last_id);
  16. bool InsertIndex(const wstring& strBatchDBPath, const wstring& strWorkPath, const wstring& strZipfileName, int total_cnt, int& last_id);
  17. vector<batch_info> GetFailedBatch();
  18. void GetBatchInfo(batch_info& info);
  19. vector<wstring> GetCashBatch();
  20. void GetBatchPapers(const wstring& db_path, vector<paper_info>& vctPapers);
  21. void GetPaperByID(const wstring& db_path, int id, paper_info& info);
  22. bool DeletePaper(const wstring& db_path, int paper_id);
  23. bool DeletePaperAll(const wstring& db_path, int state);
  24. bool DeleteIndex(int id);
  25. bool UpdatePapersPath(const wstring& db_path, paper_info& info);
  26. private:
  27. bool OpenSQLiteDB(CppSQLite3DB& db, const wstring& strdbpath);
  28. wstring m_strModuleDir;
  29. wstring m_strIndexDbPath;
  30. };