/*
 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: 20/05/2026 16:36:44
*/


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

CREATE TABLE [dbo].[report_day_dnb] (
  [objid] int IDENTITY(1,1) NOT NULL,
  [dept_id] int  NULL,
  [user_id] int  NULL,
  [monitor_id] varchar(64) COLLATE Chinese_PRC_CI_AS  NULL,
  [collect_time] datetime  NULL,
  [kwh1] decimal(18,2)  NULL,
  [kwh2] decimal(18,2)  NULL,
  [kwh3] decimal(18,2)  NULL,
  [kwh4] decimal(18,2)  NULL,
  [total_kwh] decimal(18,2)  NULL
)
GO

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

EXEC sp_addextendedproperty
'MS_Description', N'自增标识',
'SCHEMA', N'dbo',
'TABLE', N'report_day_dnb',
'COLUMN', N'objid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'权限标识（部门）',
'SCHEMA', N'dbo',
'TABLE', N'report_day_dnb',
'COLUMN', N'dept_id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'权限标识（用户）',
'SCHEMA', N'dbo',
'TABLE', N'report_day_dnb',
'COLUMN', N'user_id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'计量设备编号',
'SCHEMA', N'dbo',
'TABLE', N'report_day_dnb',
'COLUMN', N'monitor_id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'读取日期',
'SCHEMA', N'dbo',
'TABLE', N'report_day_dnb',
'COLUMN', N'collect_time'
GO

EXEC sp_addextendedproperty
'MS_Description', N'已用尖电能量',
'SCHEMA', N'dbo',
'TABLE', N'report_day_dnb',
'COLUMN', N'kwh1'
GO

EXEC sp_addextendedproperty
'MS_Description', N'已用峰电能量',
'SCHEMA', N'dbo',
'TABLE', N'report_day_dnb',
'COLUMN', N'kwh2'
GO

EXEC sp_addextendedproperty
'MS_Description', N'已用平电能量',
'SCHEMA', N'dbo',
'TABLE', N'report_day_dnb',
'COLUMN', N'kwh3'
GO

EXEC sp_addextendedproperty
'MS_Description', N'已用谷电能量',
'SCHEMA', N'dbo',
'TABLE', N'report_day_dnb',
'COLUMN', N'kwh4'
GO

EXEC sp_addextendedproperty
'MS_Description', N'总的已用冻结电量',
'SCHEMA', N'dbo',
'TABLE', N'report_day_dnb',
'COLUMN', N'total_kwh'
GO

EXEC sp_addextendedproperty
'MS_Description', N'电日耗报表',
'SCHEMA', N'dbo',
'TABLE', N'report_day_dnb'
GO


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

