/*
 Navicat Premium Data Transfer

 Source Server         : MESOtherData2
 Source Server Type    : SQL Server
 Source Server Version : 11002100
 Source Host           : 10.126.64.131:1433
 Source Catalog        : MESOtherData
 Source Schema         : dbo

 Target Server Type    : SQL Server
 Target Server Version : 11002100
 File Encoding         : 65001

 Date: 13/08/2021 14:12:44
*/


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

CREATE TABLE [dbo].[AMResult] (
  [TestDate] date  NOT NULL,                                  /* 日期班次 */
  [TestHour] int  NOT NULL,                                   /* 小时 */
  [Line] varchar(30) COLLATE Chinese_PRC_CI_AS  NOT NULL,     /* 线体：UI界面或配置文件提供 */
  [Station] varchar(30) COLLATE Chinese_PRC_CI_AS  NOT NULL,  /* 工站：UI界面或配置文件提供，抄写工具固定为：DataBurning */
  [Model] varchar(30) COLLATE Chinese_PRC_CI_AS  NULL,        /* 机型：HTTP接口获取 */
  [Dimension] varchar(20) COLLATE Chinese_PRC_CI_AS  NULL,    /* 尺寸：HTTP接口获取 */
  [TestTime] varchar(30) COLLATE Chinese_PRC_CI_AS  NULL,     /* 测试时间 */
  [ODF] varchar(20) COLLATE Chinese_PRC_CI_AS  NOT NULL,      /* 批次：HTTP接口获取 */
  [SN] varchar(30) COLLATE Chinese_PRC_CI_AS  NOT NULL,       /* 本次抄写SN */
  [ErrorMsg] varchar(300) COLLATE Chinese_PRC_CI_AS  NULL,    /* 抄写失败描述 */
  [ReDo] varchar(10) COLLATE Chinese_PRC_CI_AS  NOT NULL,     /* 重流标识 */
  [Remark] varchar(100) COLLATE Chinese_PRC_CI_AS  NULL,      /* 备注：一般用于重流标记 */
  [Test01] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,       /* 首次测试结果 */
  [Test02] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,       /* 第二次测试结果 */
  [FinalTest] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,    /* 最终测试结果 */
  [ResultType] varchar(20) COLLATE Chinese_PRC_CI_AS  NULL,   /* 结果类型：OncePass、NTF、FinalPass、TwiceFail、FinalPass、OnceFail、FinalFail */
  [DSN] varchar(20) COLLATE Chinese_PRC_CI_AS  NULL           /* 本次抄写DSN */
)
GO

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


-- ----------------------------
-- Indexes structure for table AMResult
-- ----------------------------
CREATE NONCLUSTERED INDEX [NonClu_AMResult_ODF]
ON [dbo].[AMResult] (
  [ODF] ASC
)
INCLUDE ([SN])
GO

CREATE NONCLUSTERED INDEX [NonClu_AMResult_TestDate]
ON [dbo].[AMResult] (
  [TestDate] ASC
)
INCLUDE ([TestHour])
GO

CREATE NONCLUSTERED INDEX [NonClu_AMResult_Line]
ON [dbo].[AMResult] (
  [Line] ASC
)
GO


-- ----------------------------
-- Primary Key structure for table AMResult
-- ----------------------------
ALTER TABLE [dbo].[AMResult] ADD CONSTRAINT [PK_AMResult] PRIMARY KEY CLUSTERED ([Station], [SN], [ReDo])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO

