DatabaseTable.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. using Aitex.Core.RT.DBCore;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace MECF.Framework.Common.DBCore
  8. {
  9. internal class DatabaseTable
  10. {
  11. public static void UpgradeDataTable()
  12. {
  13. var lot_data = new Dictionary<string, Type>()
  14. {
  15. {"guid", typeof(string)},
  16. {"start_time", typeof(DateTime)},
  17. {"end_time", typeof(DateTime)},
  18. {"carrier_data_guid", typeof(string)},
  19. {"cj_data_guid", typeof(string)},
  20. {"name", typeof(string)},
  21. {"input_port", typeof(string)},
  22. {"output_port", typeof(string)},
  23. {"total_wafer_count", typeof(int)},
  24. {"abort_wafer_count", typeof(int)},
  25. {"unprocessed_wafer_count", typeof(int)}
  26. };
  27. DB.CreateTableIfNotExisted("lot_data", lot_data, false, "guid");
  28. DB.CreateTableColumn("lot_data", lot_data);
  29. var recipe_step_data = new Dictionary<string, Type>()
  30. {
  31. {"guid", typeof(string)},
  32. {"step_begin_time", typeof(DateTime)},
  33. {"step_end_time", typeof(DateTime)},
  34. {"step_name", typeof(string)},
  35. {"step_time", typeof(float)},
  36. {"process_data_guid", typeof(string)},
  37. {"step_number", typeof(int)},
  38. };
  39. DB.CreateTableIfNotExisted("recipe_step_data", recipe_step_data, false, "guid");
  40. DB.CreateTableIndexIfNotExisted("recipe_step_data", "recipe_step_data_idx1", "CREATE INDEX recipe_step_data_idx1 ON public.recipe_step_data USING btree" +
  41. "(\"process_data_guid\", \"step_number\");");
  42. DB.CreateTableColumn("recipe_step_data", recipe_step_data);
  43. var step_fdc_data = new Dictionary<string, Type>()
  44. {
  45. {"process_data_guid", typeof(string)},
  46. {"step_number", typeof(int)},
  47. {"create_time", typeof(DateTime)},
  48. {"parameter_name", typeof(string)},
  49. {"sample_count", typeof(int)},
  50. {"min_value", typeof(float)},
  51. {"max_value", typeof(float)},
  52. {"setpoint", typeof(float)},
  53. {"std_value", typeof(float)},
  54. {"mean_value", typeof(float)},
  55. };
  56. DB.CreateTableIfNotExisted("step_fdc_data", step_fdc_data, false, "");
  57. DB.CreateTableIndexIfNotExisted("step_fdc_data", "step_fdc_data_idx1", "CREATE INDEX step_fdc_data_idx1 ON public.step_fdc_data USING btree" +
  58. "(\"process_data_guid\", \"step_number\");");
  59. DB.CreateTableColumn("step_fdc_data", step_fdc_data);
  60. var lot_wafer_data = new Dictionary<string, Type>()
  61. {
  62. {"guid", typeof(string)},
  63. {"create_time", typeof(DateTime)},
  64. {"lot_data_guid", typeof(string)},
  65. {"wafer_data_guid", typeof(string)},
  66. {"carrier_id", typeof(string)},
  67. };
  68. DB.CreateTableIfNotExisted("lot_wafer_data", lot_wafer_data, false, "guid");
  69. DB.CreateTableIndexIfNotExisted("lot_wafer_data", "lot_wafer_data_idx1", "CREATE INDEX lot_wafer_data_idx1 ON public.lot_wafer_data USING btree" +
  70. "(lot_data_guid COLLATE pg_catalog.\"default\", wafer_data_guid COLLATE pg_catalog.\"default\");");
  71. DB.CreateTableColumn("lot_wafer_data", lot_wafer_data);
  72. DB.CreateTableColumn("wafer_data", new Dictionary<string, Type>()
  73. {
  74. {"lot_id", typeof(string) },
  75. {"notch_angle", typeof(float) },
  76. {"sequence_name", typeof(string) },
  77. {"process_status", typeof(string) },
  78. {"carrier_id", typeof(string)},
  79. });
  80. DB.CreateTableColumn("cj_data", new Dictionary<string, Type>()
  81. {
  82. {"total_wafer_count", typeof(int) },
  83. {"abort_wafer_count", typeof(int) },
  84. {"unprocessed_wafer_count", typeof(int) },
  85. });
  86. DB.CreateTableColumn("leak_check_data", new Dictionary<string, Type>()
  87. {
  88. {"module_name", typeof(string) },
  89. {"gasline_selection", typeof(string) },
  90. });
  91. DB.CreateTableColumn("kepler_leak_check_data", new Dictionary<string, Type>()
  92. {
  93. {"module_name", typeof(string) },
  94. {"gasline_selection", typeof(string) },
  95. });
  96. DB.CreateTableColumn("process_data", new Dictionary<string, Type>()
  97. {
  98. {"recipe_setting_time", typeof(float) },
  99. {"lot_id", typeof(string) },
  100. {"slot_id", typeof(string) },
  101. {"carrier_id", typeof(string)},
  102. {"lot_type", typeof(string)},
  103. });
  104. }
  105. }
  106. }