
CREATE TABLE [dbo].[HSSE_Vehicle](
	[VehicleId] [nvarchar](50) NOT NULL,
	[ProjectId] [nvarchar](50) NULL,
	[UnitId] [nvarchar](50) NULL,
	[CarNo] [nvarchar](50) NULL,
	[BeginTime] [date] NULL,
	[EndTime] [date] NULL,
	[VehType] [nvarchar](50) NULL,
	[OperatorName] [nvarchar](50) NULL,
	[Phone] [nvarchar](50) NULL,
	[Remark] [nvarchar](100) NULL,
	[CreateDate] [date] NULL,
	[CompileMan] [nvarchar](50) NULL,
	[ExchangeTime] [datetime] NULL,
 CONSTRAINT [PK_HSSE_Vehicle] PRIMARY KEY CLUSTERED 
(
	[VehicleId] 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

ALTER TABLE [dbo].[HSSE_Vehicle]  WITH CHECK ADD  CONSTRAINT [FK_HSSE_Vehicle_Base_Project] FOREIGN KEY([ProjectId])
REFERENCES [dbo].[Base_Project] ([ProjectId])
GO

ALTER TABLE [dbo].[HSSE_Vehicle] CHECK CONSTRAINT [FK_HSSE_Vehicle_Base_Project]
GO


CREATE TABLE [dbo].[HSSE_VehicleInOut](
	[VehicleInOutId] [nvarchar](50) NOT NULL,
	[VehicleId] [nvarchar](50) NULL,
	[ChangeTime] [datetime] NULL,
	[ProjectId] [nvarchar](50) NULL,
	[IsIn] [bit] NULL,
	[InOutWay] [nvarchar](50) NULL,
 CONSTRAINT [PK_HSSE_VehicleInOut] PRIMARY KEY CLUSTERED 
(
	[VehicleInOutId] 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