Sic.Framework-Nanjing-Baishi/MECF.Framework.Common/MECF/Framework/Common/DBCore/DatabaseTable.cs

342 lines
5.7 KiB
C#

using System;
using System.Collections.Generic;
using Aitex.Core.RT.DBCore;
namespace MECF.Framework.Common.DBCore
{
internal class DatabaseTable
{
public static void UpgradeDataTable()
{
DB.CreateTableIfNotExisted("recipe_data", new Dictionary<string, Type>
{
{
"rootName",
typeof(string)
},
{
"recipeName",
typeof(string)
},
{
"fileDetail",
typeof(byte[])
}
}, addPID: false, "");
DB.CreateTableIfNotExisted("sequence_data", new Dictionary<string, Type>
{
{
"seqName",
typeof(string)
},
{
"fileDetail",
typeof(byte[])
}
}, addPID: false, "");
DB.CreateTableIfNotExisted("process_flow_data", new Dictionary<string, Type>
{
{
"process_guid",
typeof(string)
},
{
"wafer_guid",
typeof(string)
},
{
"process_begin_time",
typeof(DateTime)
},
{
"process_end_time",
typeof(DateTime)
},
{
"h2",
typeof(float)
},
{
"ar",
typeof(float)
},
{
"pn2",
typeof(float)
},
{
"hcl",
typeof(float)
},
{
"sih4",
typeof(float)
},
{
"c3h8",
typeof(float)
},
{
"tcs",
typeof(float)
},
{
"tma",
typeof(float)
}
}, addPID: false, "process_guid");
DB.CreateTableIfNotExisted("lot_data", new Dictionary<string, Type>
{
{
"guid",
typeof(string)
},
{
"start_time",
typeof(DateTime)
},
{
"end_time",
typeof(DateTime)
},
{
"carrier_data_guid",
typeof(string)
},
{
"cj_data_guid",
typeof(string)
},
{
"name",
typeof(string)
},
{
"input_port",
typeof(string)
},
{
"output_port",
typeof(string)
},
{
"total_wafer_count",
typeof(int)
},
{
"abort_wafer_count",
typeof(int)
},
{
"unprocessed_wafer_count",
typeof(int)
}
}, addPID: false, "guid");
DB.CreateTableIfNotExisted("recipe_step_data", new Dictionary<string, Type>
{
{
"guid",
typeof(string)
},
{
"step_begin_time",
typeof(DateTime)
},
{
"step_end_time",
typeof(DateTime)
},
{
"step_name",
typeof(string)
},
{
"step_time",
typeof(float)
},
{
"process_data_guid",
typeof(string)
},
{
"step_number",
typeof(int)
}
}, addPID: false, "guid");
DB.CreateTableIndexIfNotExisted("recipe_step_data", "recipe_step_data_idx1", "CREATE INDEX recipe_step_data_idx1 ON public.recipe_step_data USING btree(\"process_data_guid\", \"step_number\");");
DB.CreateTableIfNotExisted("step_fdc_data", new Dictionary<string, Type>
{
{
"process_data_guid",
typeof(string)
},
{
"step_number",
typeof(int)
},
{
"create_time",
typeof(DateTime)
},
{
"parameter_name",
typeof(string)
},
{
"sample_count",
typeof(int)
},
{
"min_value",
typeof(float)
},
{
"max_value",
typeof(float)
},
{
"setpoint",
typeof(float)
},
{
"std_value",
typeof(float)
},
{
"mean_value",
typeof(float)
}
}, addPID: false, "");
DB.CreateTableIndexIfNotExisted("step_fdc_data", "step_fdc_data_idx1", "CREATE INDEX step_fdc_data_idx1 ON public.step_fdc_data USING btree(\"process_data_guid\", \"step_number\");");
DB.CreateTableIfNotExisted("lot_wafer_data", new Dictionary<string, Type>
{
{
"guid",
typeof(string)
},
{
"create_time",
typeof(DateTime)
},
{
"lot_data_guid",
typeof(string)
},
{
"wafer_data_guid",
typeof(string)
}
}, addPID: false, "guid");
DB.CreateTableIndexIfNotExisted("lot_wafer_data", "lot_wafer_data_idx1", "CREATE INDEX lot_wafer_data_idx1 ON public.lot_wafer_data USING btree(lot_data_guid COLLATE pg_catalog.\"default\", wafer_data_guid COLLATE pg_catalog.\"default\");");
DB.CreateTableIfNotExisted("autojob_data", new Dictionary<string, Type>
{
{
"guid",
typeof(string)
},
{
"wafer_guid",
typeof(string)
},
{
"start_time",
typeof(DateTime)
},
{
"end_time",
typeof(DateTime)
},
{
"recipe_name",
typeof(string)
},
{
"lot_name",
typeof(string)
},
{
"current_position",
typeof(string)
},
{
"status",
typeof(string)
}
}, addPID: false, "guid");
DB.CreateTableIfNotExisted("runtime_data", new Dictionary<string, Type>
{
{
"guid",
typeof(string)
},
{
"device_name",
typeof(string)
},
{
"set_minutes",
typeof(long)
},
{
"elapse_minutes",
typeof(long)
},
{
"ispm",
typeof(bool)
}
}, addPID: false, "guid");
DB.CreateTableColumn("wafer_data", new Dictionary<string, Type>
{
{
"lot_id",
typeof(string)
},
{
"notch_angle",
typeof(float)
},
{
"sequence_name",
typeof(string)
},
{
"process_status",
typeof(string)
}
});
DB.CreateTableColumn("cj_data", new Dictionary<string, Type>
{
{
"total_wafer_count",
typeof(int)
},
{
"abort_wafer_count",
typeof(int)
},
{
"unprocessed_wafer_count",
typeof(int)
}
});
DB.CreateTableColumn("leak_check_data", new Dictionary<string, Type>
{
{
"module_name",
typeof(string)
},
{
"gasline_selection",
typeof(string)
}
});
DB.CreateTableColumn("process_data", new Dictionary<string, Type> {
{
"recipe_setting_time",
typeof(float)
} });
}
}
}