TableInfo.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef __TABLE_INFO__
  2. #define __TABLE_INFO__
  3. // 订单表;
  4. typedef struct __TB_ORDER__
  5. {
  6. std::string strOrder;
  7. int nMode; // 0=离线模式;1=在线模式;
  8. std::string strDeltaEType;
  9. std::string strDeltaEValue;
  10. std::string strCreateTime;
  11. }TB_ORDER, *LPTB_ORDER;
  12. typedef struct __TB_SN__
  13. {
  14. std::string strOrder;
  15. std::string strSN;
  16. std::string strLine;
  17. std::string strStartTime;
  18. std::string strFinishedTime;
  19. int nElapsed;
  20. int nTestResult;
  21. DOUBLE dDeltaAVGEValue;
  22. std::string strDetails;
  23. }TB_SN, *LPTB_SN;
  24. // 创建表;
  25. #define _CREATE_ORDER_ "CREATE TABLE DebugOrders(\
  26. OrderID TEXT(32) NOT NULL, \
  27. DEType TEXT(8) NOT NULL, \
  28. DEValue REAL NOT NULL, \
  29. Mode INTEGER NOT NULL,\
  30. CreateTime TimeStamp NOT NULL DEFAULT (datetime('now','localtime'))), \
  31. PRIMARY KEY(OrderID));"
  32. #define _CREATE_SN_ "CREATE TABLE DebugSN(\
  33. OrderID TEXT(32) NOT NULL, \
  34. SN TEXT(32) NOT NULL, \
  35. Line TEXT(8) NOT NULL, \
  36. StartTime DATETIME NOT NULL, \
  37. FinishTime DATETIME NOT NULL, \
  38. ElapsedTime INTEGER NOT NULL,\
  39. TestResult INTEGER NOT NULL, \
  40. DEAvgValue REAL NOT NULL, \
  41. Outcome TEXT NOT NULL, \
  42. PRIMARY KEY(SN));"
  43. // 插入记录;
  44. #define _INSERT_ORDER_ "INSERT INTO DebugOrders(OrderID, DEType, DEValue, Mode) VALUES()"
  45. #define _INSERT_SN_ ""
  46. // 更新表;
  47. #define _UPDATE_ORDER_ ""
  48. #define _UPDATE_SN_ ""
  49. // 查询表;
  50. #define _SELECT_ORDER_ "SELECT OrderID, DEType, DEValue, Mode, CreateTime FROM DebugOrders"
  51. #define _SELECT_SN_ "SELECT OrderID, SN,Line,StartTime,FinishTime,ElapsedTime,TestResult,DEAvgValue,Outcome FROM DebugSN"
  52. // 删除记录;
  53. #define _DELETE_ORDER_ ""
  54. #define _DELETE_SN_ ""
  55. #endif