--cd C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools --SqlMetal /views /server:WQ /database:SGGLDB_WH /code:C:\Model.cs /namespace:Model --菜单新增 delete Sys_Menu where MenuId='5C07E135-C3AB-4CE4-97A2-C79970640272' delete Sys_Menu where MenuId='B4702BFB-8CEB-46AD-BDC0-751D146FE228' delete Sys_Menu where MenuId='34719347-E5EE-4491-9E92-B1270C187C7F' INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Icon,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)VALUES('5C07E135-C3AB-4CE4-97A2-C79970640272','系统划分',null,'TestRun/BeforeTestRun/DeviceRun.aspx',1,'AD6E08B6-5571-4FFB-BDBE-9E6811770BD6','Menu_TestRun',0,1,1) INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Icon,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)VALUES('B4702BFB-8CEB-46AD-BDC0-751D146FE228','工作包设置',null,'TestRun/BeforeTestRun/SetWorkPackage.aspx',2,'AD6E08B6-5571-4FFB-BDBE-9E6811770BD6','Menu_TestRun',0,1,1) go INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Icon,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)VALUES('34719347-E5EE-4491-9E92-B1270C187C7F','工作包裁剪',null,'TestRun/BeforeTestRun/SubSysWorkPackage.aspx',3,'AD6E08B6-5571-4FFB-BDBE-9E6811770BD6','Menu_TestRun',0,1,1) go --==试车装置信息 if object_id(N'PreRun_SysDevice',N'U') is not null drop table dbo.PreRun_SysDevice CREATE TABLE dbo.PreRun_SysDevice( PreRunId varchar(50) NOT NULL,--主键 PreRunCode varchar(50) NULL,--编码 PreRunName varchar(50) NULL,--名称 ProjectId varchar(50) NULL,--项目主键 PreRunLevel int NULL,--类型1:装置 2:工序 3:系统 4:子系统 InstallationId varchar(50) NULL,--装置主键(冗余字段,方便后期关联适用) ProcessesId varchar(50) NULL,--工序主键(冗余字段,方便后期关联适用) SystemId varchar(50) NULL,--系统主键(冗余字段,方便后期关联适用) SubsystemId varchar(50) NULL,--子系统主键(冗余字段,方便后期关联适用) ParentId varchar (50) NULL,--上级主键 Remark nvarchar(150) NULL,--描述 AddUser varchar(50) NULL,--添加人 OperateTime datetime NULL,--操作日期 Sort int NULL,--排序 CONSTRAINT PK_PreRun_SysDevice PRIMARY KEY CLUSTERED ( PreRunId ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO --==工作包设置 if object_id(N'Work_Package',N'U') is not null drop table dbo.Work_Package CREATE TABLE dbo.Work_Package( WorkPackId varchar(50) NOT NULL,--主键 WorkPackCode varchar(50) NULL,--编码 WorkPackName varchar(50) NULL,--名称 Remark nvarchar(150) NULL,--备注 AddUser varchar(50) NULL,--添加人 AddTime datetime NULL,--添加日期 Sort int NULL,--排序 CONSTRAINT PK_Work_Package PRIMARY KEY CLUSTERED ( WorkPackId ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO --预添加数据 delete Work_Package where WorkPackId='1C01150C-977E-499A-9173-95F319BEEF87' delete Work_Package where WorkPackId='641DA0F4-42A7-4DE3-9A57-95A606016655' delete Work_Package where WorkPackId='BEB24AE8-F66D-458B-ADFD-3810405B5EB8' delete Work_Package where WorkPackId='02BC1E1E-E531-4738-B6EC-5CE5BDC47B43' delete Work_Package where WorkPackId='474F94B6-E927-4E9A-A544-F8E1AE63F6FF' delete Work_Package where WorkPackId='3289A3D2-0691-4AD1-BDF3-1FD784564E71' delete Work_Package where WorkPackId='445B915B-3E6D-47BE-BFF4-8762695ADB20' delete Work_Package where WorkPackId='73C7D1D7-6DA3-44DD-A88B-7DF0FF15AA4F' delete Work_Package where WorkPackId='8845C52D-4C56-442E-9237-CE33E8FC66AA' delete Work_Package where WorkPackId='B0D040D4-5867-4335-9258-75504E73987E' delete Work_Package where WorkPackId='84C6DAD6-3ED8-4869-ADB4-2EDA3512DB16' delete Work_Package where WorkPackId='963E658B-CB53-4FEA-BA7D-723C538B2BD5' delete Work_Package where WorkPackId='598A028A-5812-40E3-9D9D-5180A36F4453' delete Work_Package where WorkPackId='6D827784-6ABD-4327-ABB7-FDABAC99853F' INSERT INTO dbo.Work_Package(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) VALUES('1C01150C-977E-499A-9173-95F319BEEF87','WP01','单机试车','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),1) INSERT INTO dbo.Work_Package(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) VALUES('641DA0F4-42A7-4DE3-9A57-95A606016655','WP02','管道冲洗','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),2) INSERT INTO dbo.Work_Package(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) VALUES('BEB24AE8-F66D-458B-ADFD-3810405B5EB8','WP03','管道吹扫','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),3) INSERT INTO dbo.Work_Package(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) VALUES('02BC1E1E-E531-4738-B6EC-5CE5BDC47B43','WP04','蒸汽吹扫','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),4) INSERT INTO dbo.Work_Package(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) VALUES('474F94B6-E927-4E9A-A544-F8E1AE63F6FF','WP05','化学清洗','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),5) INSERT INTO dbo.Work_Package(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) VALUES('3289A3D2-0691-4AD1-BDF3-1FD784564E71','WP06','烘炉','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),6) INSERT INTO dbo.Work_Package(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) VALUES('445B915B-3E6D-47BE-BFF4-8762695ADB20','WP07','催化剂装填','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),7) INSERT INTO dbo.Work_Package(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) VALUES('73C7D1D7-6DA3-44DD-A88B-7DF0FF15AA4F','WP08','分子筛装填','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),8) INSERT INTO dbo.Work_Package(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) VALUES('8845C52D-4C56-442E-9237-CE33E8FC66AA','WP09','电气调试','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),9) INSERT INTO dbo.Work_Package(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) VALUES('B0D040D4-5867-4335-9258-75504E73987E','WP10','仪表调试','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),10) INSERT INTO dbo.Work_Package(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) VALUES('84C6DAD6-3ED8-4869-ADB4-2EDA3512DB16','WP11','汽轮机试车','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),11) INSERT INTO dbo.Work_Package(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) VALUES('963E658B-CB53-4FEA-BA7D-723C538B2BD5','WP12','大机组试车','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),12) INSERT INTO dbo.Work_Package(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) VALUES('598A028A-5812-40E3-9D9D-5180A36F4453','WP13','气密','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),13) INSERT INTO dbo.Work_Package(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) VALUES('6D827784-6ABD-4327-ABB7-FDABAC99853F','WP14','清洁度检查','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),14) go --==子系统工作包管理 if object_id(N'SubSys_WorkPackage',N'U') is not null drop table dbo.SubSys_WorkPackage CREATE TABLE dbo.SubSys_WorkPackage( SubSysId varchar(50) NOT NULL,--主键 SubSystemId varchar(50) NULL,--子系统主键 WorkPackId varchar(50) NULL,--工作包主键 WorkPackCode varchar(50) NULL,--工作包Code Remark nvarchar(150) NULL,--备注 AddUser varchar(50) NULL,--添加人 AddTime datetime NULL,--添加日期 Sort int NULL,--排序 CONSTRAINT PK_SubSys_WorkPackage PRIMARY KEY CLUSTERED ( SubSysId ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO