/*
 Navicat Premium Data Transfer

 Source Server         : MES
 Source Server Type    : SQL Server
 Source Server Version : 15002000 (15.00.2000)
 Source Host           : 192.168.202.21:1433
 Source Catalog        : lanju_op_xiaolan_ds
 Source Schema         : dbo

 Target Server Type    : SQL Server
 Target Server Version : 15002000 (15.00.2000)
 File Encoding         : 65001

 Date: 29/05/2026 11:59:40
*/


-- ----------------------------
-- Table structure for pro_check_item
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[pro_check_item]') AND type IN ('U'))
	DROP TABLE [dbo].[pro_check_item]
GO

CREATE TABLE [dbo].[pro_check_item] (
  [item_id] int  IDENTITY(1,1) NOT NULL,
  [item_name] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [check_object] varchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
  [sort_order] int DEFAULT 0 NULL,
  [is_del] tinyint DEFAULT 0 NULL
)
GO

ALTER TABLE [dbo].[pro_check_item] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'项目名称',
'SCHEMA', N'dbo',
'TABLE', N'pro_check_item',
'COLUMN', N'item_name'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检查对象 (如：灌装机、照明、温湿度)',
'SCHEMA', N'dbo',
'TABLE', N'pro_check_item',
'COLUMN', N'check_object'
GO

EXEC sp_addextendedproperty
'MS_Description', N'排序',
'SCHEMA', N'dbo',
'TABLE', N'pro_check_item',
'COLUMN', N'sort_order'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否删除',
'SCHEMA', N'dbo',
'TABLE', N'pro_check_item',
'COLUMN', N'is_del'
GO

EXEC sp_addextendedproperty
'MS_Description', N'停工停车-检查项定义表',
'SCHEMA', N'dbo',
'TABLE', N'pro_check_item'
GO


-- ----------------------------
-- Table structure for pro_check_record
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[pro_check_record]') AND type IN ('U'))
	DROP TABLE [dbo].[pro_check_record]
GO

CREATE TABLE [dbo].[pro_check_record] (
  [record_id] int  IDENTITY(1,1) NOT NULL,
  [record_time] datetime  NULL,
  [record_person] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [abno_status] tinyint  NULL
)
GO

ALTER TABLE [dbo].[pro_check_record] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'记录日期',
'SCHEMA', N'dbo',
'TABLE', N'pro_check_record',
'COLUMN', N'record_time'
GO

EXEC sp_addextendedproperty
'MS_Description', N'记录人',
'SCHEMA', N'dbo',
'TABLE', N'pro_check_record',
'COLUMN', N'record_person'
GO

EXEC sp_addextendedproperty
'MS_Description', N'异常状态,0-异常,1-正常',
'SCHEMA', N'dbo',
'TABLE', N'pro_check_record',
'COLUMN', N'abno_status'
GO

EXEC sp_addextendedproperty
'MS_Description', N'停工停车-检查记录',
'SCHEMA', N'dbo',
'TABLE', N'pro_check_record'
GO


-- ----------------------------
-- Table structure for pro_check_record_detail
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[pro_check_record_detail]') AND type IN ('U'))
	DROP TABLE [dbo].[pro_check_record_detail]
GO

CREATE TABLE [dbo].[pro_check_record_detail] (
  [detail_id] int  IDENTITY(1,1) NOT NULL,
  [record_id] int  NULL,
  [item_name] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [check_object] varchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
  [sort_order] int DEFAULT 0 NULL,
  [check_value] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [abno_remark] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[pro_check_record_detail] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'记录id',
'SCHEMA', N'dbo',
'TABLE', N'pro_check_record_detail',
'COLUMN', N'record_id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'项目名称',
'SCHEMA', N'dbo',
'TABLE', N'pro_check_record_detail',
'COLUMN', N'item_name'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检查对象 (如：灌装机、照明、温湿度)',
'SCHEMA', N'dbo',
'TABLE', N'pro_check_record_detail',
'COLUMN', N'check_object'
GO

EXEC sp_addextendedproperty
'MS_Description', N'排序',
'SCHEMA', N'dbo',
'TABLE', N'pro_check_record_detail',
'COLUMN', N'sort_order'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检查值',
'SCHEMA', N'dbo',
'TABLE', N'pro_check_record_detail',
'COLUMN', N'check_value'
GO

EXEC sp_addextendedproperty
'MS_Description', N'异常信息',
'SCHEMA', N'dbo',
'TABLE', N'pro_check_record_detail',
'COLUMN', N'abno_remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'停工停车-检查记录',
'SCHEMA', N'dbo',
'TABLE', N'pro_check_record_detail'
GO


-- ----------------------------
-- Auto increment value for pro_check_item
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[pro_check_item]', RESEED, 20)
GO


-- ----------------------------
-- Primary Key structure for table pro_check_item
-- ----------------------------
ALTER TABLE [dbo].[pro_check_item] ADD CONSTRAINT [PK__pro_chec__52020FDDCD776399] PRIMARY KEY CLUSTERED ([item_id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for pro_check_record
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[pro_check_record]', RESEED, 11)
GO


-- ----------------------------
-- Primary Key structure for table pro_check_record
-- ----------------------------
ALTER TABLE [dbo].[pro_check_record] ADD CONSTRAINT [PK__pro_chec__52020FDDCA2F0C87] PRIMARY KEY CLUSTERED ([record_id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for pro_check_record_detail
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[pro_check_record_detail]', RESEED, 220)
GO


-- ----------------------------
-- Primary Key structure for table pro_check_record_detail
-- ----------------------------
ALTER TABLE [dbo].[pro_check_record_detail] ADD CONSTRAINT [PK__pro_chec__BFCFB4DD89154381] PRIMARY KEY CLUSTERED ([detail_id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO

