zhangherong
2025-07-10 3c0a80bda0b0a19e576a56963a719072219579b5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
-- HF编码维护
IF EXISTS (SELECT *
           FROM sys.objects
           WHERE object_id = OBJECT_ID(N'[dbo].[eam_base_hf_code]')
             AND type in (N'U'))
    DROP TABLE [dbo].[eam_base_hf_code];
CREATE TABLE [dbo].[eam_base_hf_code]
(
    id          NVARCHAR(32) NOT NULL,
    create_by   NVARCHAR(50),
    create_time DATETIME2,
    update_by   NVARCHAR(50),
    update_time DATETIME2,
    del_flag    INT,
    hf_code     NVARCHAR(100),
    hf_name     NVARCHAR(255),
    hf_category NVARCHAR(64),
    hf_status   NVARCHAR(64),
    hf_version  NVARCHAR(50),
    PRIMARY KEY (id)
);
 
EXEC sp_addextendedproperty 'MS_Description', '报表HFCode维护', 'SCHEMA', dbo, 'table', eam_base_hf_code, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', eam_base_hf_code, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', eam_base_hf_code, 'column', create_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', eam_base_hf_code, 'column',
     create_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', eam_base_hf_code, 'column', update_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', eam_base_hf_code, 'column',
     update_time;
EXEC sp_addextendedproperty 'MS_Description', '删除标记', 'SCHEMA', dbo, 'table', eam_base_hf_code, 'column', del_flag;
EXEC sp_addextendedproperty 'MS_Description', 'HF编码', 'SCHEMA', dbo, 'table', eam_base_hf_code, 'column', hf_code;
EXEC sp_addextendedproperty 'MS_Description', '模板名称', 'SCHEMA', dbo, 'table', eam_base_hf_code, 'column', hf_name;
EXEC sp_addextendedproperty 'MS_Description', '模板分类', 'SCHEMA', dbo, 'table', eam_base_hf_code, 'column',
     hf_category;
EXEC sp_addextendedproperty 'MS_Description', '状态;启用、禁用', 'SCHEMA', dbo, 'table', eam_base_hf_code, 'column',
     hf_status;
EXEC sp_addextendedproperty 'MS_Description', '版本;V1,V2+', 'SCHEMA', dbo, 'table', eam_base_hf_code, 'column',
     hf_version;
 
--技术鉴定规范
IF EXISTS (SELECT *
           FROM sys.objects
           WHERE object_id = OBJECT_ID(N'[dbo].[eam_technical_status_evaluation_standard]')
             AND type in (N'U'))
    DROP TABLE [dbo].[eam_technical_status_evaluation_standard];
CREATE TABLE [dbo].[eam_technical_status_evaluation_standard]
(
    id                         NVARCHAR(32) NOT NULL,
    create_by                  NVARCHAR(50),
    create_time                DATETIME2,
    update_by                  NVARCHAR(50),
    update_time                DATETIME2,
    del_flag                   INT,
    standard_name              NVARCHAR(255),
    standard_code              NVARCHAR(50),
    evaluation_period          INT,
    equipment_id               NVARCHAR(32),
    standard_status            NVARCHAR(64),
    has_safety_equipment_check NVARCHAR(64),
    has_precision_check        NVARCHAR(64),
    has_other_check            NVARCHAR(64),
    standard_version           NVARCHAR(50),
    remark                     NVARCHAR(255),
    PRIMARY KEY (id)
);
 
EXEC sp_addextendedproperty 'MS_Description', '技术状态鉴定规范', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', eam_technical_status_evaluation_standard,
     'column', id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard, 'column', create_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard, 'column', create_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard, 'column', update_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard, 'column', update_time;
EXEC sp_addextendedproperty 'MS_Description', '删除标记', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard, 'column', del_flag;
EXEC sp_addextendedproperty 'MS_Description', '规范名称', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard, 'column', standard_name;
EXEC sp_addextendedproperty 'MS_Description', '规范编码', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard, 'column', standard_code;
EXEC sp_addextendedproperty 'MS_Description', '鉴定周期', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard, 'column', evaluation_period;
EXEC sp_addextendedproperty 'MS_Description', '设备ID', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard, 'column', equipment_id;
EXEC sp_addextendedproperty 'MS_Description', '规范状态;待提交、启用、作废', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard, 'column', standard_status;
EXEC sp_addextendedproperty 'MS_Description', '是否有安全装置检查;是否', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard, 'column', has_safety_equipment_check;
EXEC sp_addextendedproperty 'MS_Description', '是否有设备精度检查;是否', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard, 'column', has_precision_check;
EXEC sp_addextendedproperty 'MS_Description', '是否有其他检查;是否', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard, 'column', has_other_check;
EXEC sp_addextendedproperty 'MS_Description', '版本;V1,V2+', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard, 'column', standard_version;
EXEC sp_addextendedproperty 'MS_Description', '备注', 'SCHEMA', dbo, 'table', eam_technical_status_evaluation_standard,
     'column', remark;
 
--技术状态鉴定规范明细
IF EXISTS (SELECT *
           FROM sys.objects
           WHERE object_id = OBJECT_ID(N'[dbo].[eam_technical_status_evaluation_standard_detail]')
             AND type in (N'U'))
    DROP TABLE [dbo].[eam_technical_status_evaluation_standard_detail];
CREATE TABLE [dbo].[eam_technical_status_evaluation_standard_detail]
(
    id              NVARCHAR(32) NOT NULL,
    create_by       NVARCHAR(50),
    create_time     DATETIME2,
    update_by       NVARCHAR(50),
    update_time     DATETIME2,
    standard_id     NVARCHAR(32),
    check_category  NVARCHAR(64),
    item_code       INT,
    item_name       NVARCHAR(255),
    tolerance_value NVARCHAR(100),
    sub_item_name   NVARCHAR(255),
    PRIMARY KEY (id)
);
 
EXEC sp_addextendedproperty 'MS_Description', '技术状态鉴定规范明细', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard_detail, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard_detail, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard_detail, 'column', create_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard_detail, 'column', create_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard_detail, 'column', update_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard_detail, 'column', update_time;
EXEC sp_addextendedproperty 'MS_Description', '规范ID', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard_detail, 'column', standard_id;
EXEC sp_addextendedproperty 'MS_Description', '检查分类;精度检查、安全装置检查、其他检查', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard_detail, 'column', check_category;
EXEC sp_addextendedproperty 'MS_Description', '项目序号', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard_detail, 'column', item_code;
EXEC sp_addextendedproperty 'MS_Description', '检查项目', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard_detail, 'column', item_name;
EXEC sp_addextendedproperty 'MS_Description', '允差值;精度检查展示', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard_detail, 'column', tolerance_value;
EXEC sp_addextendedproperty 'MS_Description', '检查子项目;精度检查展示,可以为空', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_standard_detail, 'column', sub_item_name;
 
--技术状态鉴定工单
IF EXISTS (SELECT *
           FROM sys.objects
           WHERE object_id = OBJECT_ID(N'[dbo].[eam_technical_status_evaluation_order]')
             AND type in (N'U'))
    DROP TABLE [dbo].[eam_technical_status_evaluation_order];
CREATE TABLE [dbo].[eam_technical_status_evaluation_order]
(
    id                                NVARCHAR(32) NOT NULL,
    create_by                         NVARCHAR(50),
    create_time                       DATETIME2,
    update_by                         NVARCHAR(50),
    update_time                       DATETIME2,
    del_flag                          INT,
    order_num                         NVARCHAR(50),
    equipment_id                      NVARCHAR(32),
    standard_id                       NVARCHAR(32),
    evaluation_date                   DATETIME2,
    freeze_order_date                 DATETIME2,
    order_expiration_date             DATETIME2,
    actual_start_time                 DATETIME2,
    actual_end_time                   DATETIME2,
    evaluator                         NVARCHAR(50),
    evaluation_status                 NVARCHAR(64),
    creation_method                   NVARCHAR(64),
    safety_equipment_check_result     NVARCHAR(64),
    precision_check_result            NVARCHAR(64),
    functional_check_result           NVARCHAR(64),
    other_check_result                NVARCHAR(64),
    repair_manager_signature          NVARCHAR(50),
    repair_manager_signature_time_1   DATETIME2,
    sample_check_result               NVARCHAR(64),
    process_technician_signature      NVARCHAR(50),
    process_technician_signature_time DATETIME2,
    evaluation_result                 NVARCHAR(64),
    evaluation_reason                 NVARCHAR(64),
    inspector_signature               NVARCHAR(50),
    inspector_signature_time          DATETIME2,
    hf_code_a                         NVARCHAR(100),
    hf_code_b                         NVARCHAR(100),
    hf_code_c                         NVARCHAR(100),
    hf_code_d                         NVARCHAR(100),
    remark                            NVARCHAR(255),
    PRIMARY KEY (id)
);
 
EXEC sp_addextendedproperty 'MS_Description', '技术状态鉴定工单', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', eam_technical_status_evaluation_order,
     'column', id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', eam_technical_status_evaluation_order,
     'column', create_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', eam_technical_status_evaluation_order,
     'column', create_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', eam_technical_status_evaluation_order,
     'column', update_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', eam_technical_status_evaluation_order,
     'column', update_time;
EXEC sp_addextendedproperty 'MS_Description', '删除标记', 'SCHEMA', dbo, 'table', eam_technical_status_evaluation_order,
     'column', del_flag;
EXEC sp_addextendedproperty 'MS_Description', '工单号', 'SCHEMA', dbo, 'table', eam_technical_status_evaluation_order,
     'column', order_num;
EXEC sp_addextendedproperty 'MS_Description', '设备ID', 'SCHEMA', dbo, 'table', eam_technical_status_evaluation_order,
     'column', equipment_id;
EXEC sp_addextendedproperty 'MS_Description', '规范ID', 'SCHEMA', dbo, 'table', eam_technical_status_evaluation_order,
     'column', standard_id;
EXEC sp_addextendedproperty 'MS_Description', '计划鉴定日期;提前70天生成工单', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order, 'column', evaluation_date;
EXEC sp_addextendedproperty 'MS_Description', '锁定工单日期;提前55天锁定工单', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order, 'column', freeze_order_date;
EXEC sp_addextendedproperty 'MS_Description', '工单过期日期;到期未做直接过期,并修改设备技术状态为禁用', 'SCHEMA', dbo,
     'table', eam_technical_status_evaluation_order, 'column', order_expiration_date;
EXEC sp_addextendedproperty 'MS_Description', '实际开始时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order, 'column', actual_start_time;
EXEC sp_addextendedproperty 'MS_Description', '实际结束时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order, 'column', actual_end_time;
EXEC sp_addextendedproperty 'MS_Description', '鉴定人', 'SCHEMA', dbo, 'table', eam_technical_status_evaluation_order,
     'column', evaluator;
EXEC sp_addextendedproperty 'MS_Description',
     '鉴定状态;待鉴定、鉴定中、维修室主任签字、工艺人员签字、技术主管签字、设备检验员签字、已完成、已锁定、变更中、已过期',
     'SCHEMA', dbo, 'table', eam_technical_status_evaluation_order, 'column', evaluation_status;
EXEC sp_addextendedproperty 'MS_Description', '创建方式', 'SCHEMA', dbo, 'table', eam_technical_status_evaluation_order,
     'column', creation_method;
EXEC sp_addextendedproperty 'MS_Description', '安全装置检查结果;是、否', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order, 'column', safety_equipment_check_result;
EXEC sp_addextendedproperty 'MS_Description', '精度参数检查结果;是、否、无', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order, 'column', precision_check_result;
EXEC sp_addextendedproperty 'MS_Description', '功能状态检查结果;是、否', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order, 'column', functional_check_result;
EXEC sp_addextendedproperty 'MS_Description', '其他检查结果;是、否、无', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order, 'column', other_check_result;
EXEC sp_addextendedproperty 'MS_Description', '维修室主任签字', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order, 'column', repair_manager_signature;
EXEC sp_addextendedproperty 'MS_Description', '维修室主任签字时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order, 'column', repair_manager_signature_time_1;
EXEC sp_addextendedproperty 'MS_Description', '试件检查结果;合格、不合格', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order, 'column', sample_check_result;
EXEC sp_addextendedproperty 'MS_Description', '工艺员签字', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order, 'column', process_technician_signature;
EXEC sp_addextendedproperty 'MS_Description', '工艺员签字时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order, 'column', process_technician_signature_time;
EXEC sp_addextendedproperty 'MS_Description', '鉴定结果;合格、限用、禁用', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order, 'column', evaluation_result;
EXEC sp_addextendedproperty 'MS_Description', '限\禁用原因(多选);安全装置、设备功能、精度、试件、其他', 'SCHEMA', dbo,
     'table', eam_technical_status_evaluation_order, 'column', evaluation_reason;
EXEC sp_addextendedproperty 'MS_Description', '设备检查人签字', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order, 'column', inspector_signature;
EXEC sp_addextendedproperty 'MS_Description', '设备检查人签字时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order, 'column', inspector_signature_time;
EXEC sp_addextendedproperty 'MS_Description', '附录A HF编码', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order, 'column', hf_code_a;
EXEC sp_addextendedproperty 'MS_Description', '附录B HF编码', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order, 'column', hf_code_b;
EXEC sp_addextendedproperty 'MS_Description', '附录C HF编码', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order, 'column', hf_code_c;
EXEC sp_addextendedproperty 'MS_Description', '附录D HF编码', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order, 'column', hf_code_d;
EXEC sp_addextendedproperty 'MS_Description', '备注', 'SCHEMA', dbo, 'table', eam_technical_status_evaluation_order,
     'column', remark;
 
--技术状态鉴定工单明细
IF EXISTS (SELECT *
           FROM sys.objects
           WHERE object_id = OBJECT_ID(N'[dbo].[eam_technical_status_evaluation_order_detail]')
             AND type in (N'U'))
    DROP TABLE [dbo].[eam_technical_status_evaluation_order_detail];
CREATE TABLE [dbo].[eam_technical_status_evaluation_order_detail]
(
    id                            NVARCHAR(32) NOT NULL,
    create_by                     NVARCHAR(50),
    create_time                   DATETIME2,
    update_by                     NVARCHAR(50),
    update_time                   DATETIME2,
    item_code                     INT,
    check_category                NVARCHAR(64),
    item_name                     NVARCHAR(255),
    tolerance_value               NVARCHAR(100),
    sub_item_name                 NVARCHAR(255),
    safety_equipment_check_result NVARCHAR(64),
    other_check_result            NVARCHAR(255),
    precision_check_result        NUMERIC(24, 4),
    repairman_signature           NVARCHAR(50),
    repairman_signature_time      DATETIME2,
    PRIMARY KEY (id)
);
 
EXEC sp_addextendedproperty 'MS_Description', '技术状态鉴定工单明细', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_detail, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_detail, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_detail, 'column', create_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_detail, 'column', create_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_detail, 'column', update_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_detail, 'column', update_time;
EXEC sp_addextendedproperty 'MS_Description', '序号', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_detail, 'column', item_code;
EXEC sp_addextendedproperty 'MS_Description', '检查分类;精度检查、安全装置检查、其他检查', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_detail, 'column', check_category;
EXEC sp_addextendedproperty 'MS_Description', '检查项目', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_detail, 'column', item_name;
EXEC sp_addextendedproperty 'MS_Description', '允差值;精度检查展示', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_detail, 'column', tolerance_value;
EXEC sp_addextendedproperty 'MS_Description', '检查子项目;精度检查展示,可以为空', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_detail, 'column', sub_item_name;
EXEC sp_addextendedproperty 'MS_Description', '安全装置检查结果;是、否、无', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_detail, 'column', safety_equipment_check_result;
EXEC sp_addextendedproperty 'MS_Description', '其他检查结果', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_detail, 'column', other_check_result;
EXEC sp_addextendedproperty 'MS_Description', '精度检验结果', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_detail, 'column', precision_check_result;
EXEC sp_addextendedproperty 'MS_Description', '维修人/精度检查者签字', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_detail, 'column', repairman_signature;
EXEC sp_addextendedproperty 'MS_Description', '维修人/精度检查者签字时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_detail, 'column', repairman_signature_time;
 
 
--技术状态鉴定工单变更
IF EXISTS (SELECT *
           FROM sys.objects
           WHERE object_id = OBJECT_ID(N'[dbo].[eam_technical_status_evaluation_order_change]')
             AND type in (N'U'))
    DROP TABLE [dbo].[eam_technical_status_evaluation_order_change];
CREATE TABLE [dbo].[eam_technical_status_evaluation_order_change]
(
    id                                NVARCHAR(32) NOT NULL,
    create_by                         NVARCHAR(50),
    create_time                       DATETIME2,
    update_by                         NVARCHAR(50),
    update_time                       DATETIME2,
    del_flag                          INT,
    order_id                          NVARCHAR(32),
    change_order_num                  NVARCHAR(100),
    applicant                         NVARCHAR(50),
    factory_org_code                  NVARCHAR(100),
    apply_date                        DATETIME2,
    change_status                     NVARCHAR(64),
    apply_reason                      NVARCHAR(64),
    deferred_maintenance_date         DATETIME2,
    equipment_manager_signature       NVARCHAR(50),
    equipment_manager_signature_time  DATETIME2,
    depart_manager_signature          NVARCHAR(50),
    depart_manager_signature_time     DATETIME2,
    depart_manager_comment            NVARCHAR(255),
    production_support_signature      NVARCHAR(50),
    production_support_signature_time DATETIME2,
    production_support_comment        NVARCHAR(255),
    hf_code                           NVARCHAR(100),
    PRIMARY KEY (id)
);
 
EXEC sp_addextendedproperty 'MS_Description', '技术状态鉴定工单变更', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_change, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_change, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_change, 'column', create_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_change, 'column', create_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_change, 'column', update_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_change, 'column', update_time;
EXEC sp_addextendedproperty 'MS_Description', '删除标记', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_change, 'column', del_flag;
EXEC sp_addextendedproperty 'MS_Description', '工单ID', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_change, 'column', order_id;
EXEC sp_addextendedproperty 'MS_Description', '变更单号', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_change, 'column', change_order_num;
EXEC sp_addextendedproperty 'MS_Description', '申请人', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_change, 'column', applicant;
EXEC sp_addextendedproperty 'MS_Description', '申请部门', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_change, 'column', factory_org_code;
EXEC sp_addextendedproperty 'MS_Description', '申请日期', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_change, 'column', apply_date;
EXEC sp_addextendedproperty 'MS_Description', '变更状态;待提交、待主管审核、待部门确认、待保障部确认、已作废、已完成',
     'SCHEMA', dbo, 'table', eam_technical_status_evaluation_order_change, 'column', change_status;
EXEC sp_addextendedproperty 'MS_Description',
     '变更原因;生产任务急无法停机、设备故障正处于维修状态、设备已报废、设备大修、搬迁、改造', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_change, 'column', apply_reason;
EXEC sp_addextendedproperty 'MS_Description', '变更鉴定日期', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_change, 'column', deferred_maintenance_date;
EXEC sp_addextendedproperty 'MS_Description', '主管领导签字', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_change, 'column', equipment_manager_signature;
EXEC sp_addextendedproperty 'MS_Description', '主管领导签字时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_change, 'column', equipment_manager_signature_time;
EXEC sp_addextendedproperty 'MS_Description', '部门领导签字;根据变更原因类型区分不同的人审批', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_change, 'column', depart_manager_signature;
EXEC sp_addextendedproperty 'MS_Description', '部门领导签字时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_change, 'column', depart_manager_signature_time;
EXEC sp_addextendedproperty 'MS_Description', '部门领导意见', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_change, 'column', depart_manager_comment;
EXEC sp_addextendedproperty 'MS_Description', '生产保障部领导签字', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_change, 'column', production_support_signature;
EXEC sp_addextendedproperty 'MS_Description', '生产保障部领导签字时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_change, 'column', production_support_signature_time;
EXEC sp_addextendedproperty 'MS_Description', '生产保障部领导意见', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_change, 'column', production_support_comment;
EXEC sp_addextendedproperty 'MS_Description', 'HF编码', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_order_change, 'column', hf_code;
 
 
--技术状态变更申请
IF EXISTS (SELECT *
           FROM sys.objects
           WHERE object_id = OBJECT_ID(N'[dbo].[eam_technical_status_change]')
             AND type in (N'U'))
    DROP TABLE [dbo].[eam_technical_status_change];
CREATE TABLE [dbo].[eam_technical_status_change]
(
    id                              NVARCHAR(32) NOT NULL,
    create_by                       NVARCHAR(50),
    create_time                     DATETIME2,
    update_by                       NVARCHAR(50),
    update_time                     DATETIME2,
    del_flag                        INT,
    change_order_num                NVARCHAR(100),
    change_status                   NVARCHAR(64),
    designer                        NVARCHAR(50),
    designer_time                   DATETIME2,
    depart_header_signature         NVARCHAR(50),
    depart_header_signature_time    DATETIME2,
    depart_header_signature_comment NVARCHAR(255),
    depart_leader_signature         NVARCHAR(50),
    depart_leader_signature_time    DATETIME2,
    depart_leader_signature_comment NVARCHAR(255),
    hf_code                         NVARCHAR(100),
    PRIMARY KEY (id)
);
 
EXEC sp_addextendedproperty 'MS_Description', '技术状态变更申请', 'SCHEMA', dbo, 'table', eam_technical_status_change,
     null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', eam_technical_status_change, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', eam_technical_status_change, 'column',
     create_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', eam_technical_status_change, 'column',
     create_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', eam_technical_status_change, 'column',
     update_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', eam_technical_status_change, 'column',
     update_time;
EXEC sp_addextendedproperty 'MS_Description', '删除标记', 'SCHEMA', dbo, 'table', eam_technical_status_change, 'column',
     del_flag;
EXEC sp_addextendedproperty 'MS_Description', '变更单号', 'SCHEMA', dbo, 'table', eam_technical_status_change, 'column',
     change_order_num;
EXEC sp_addextendedproperty 'MS_Description', '变更单状态', 'SCHEMA', dbo, 'table', eam_technical_status_change,
     'column', change_status;
EXEC sp_addextendedproperty 'MS_Description', '编制人', 'SCHEMA', dbo, 'table', eam_technical_status_change, 'column',
     designer;
EXEC sp_addextendedproperty 'MS_Description', '编制时间', 'SCHEMA', dbo, 'table', eam_technical_status_change, 'column',
     designer_time;
EXEC sp_addextendedproperty 'MS_Description', '使用单位室主管签字', 'SCHEMA', dbo, 'table', eam_technical_status_change,
     'column', depart_header_signature;
EXEC sp_addextendedproperty 'MS_Description', '使用单位室主管签字时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_change, 'column', depart_header_signature_time;
EXEC sp_addextendedproperty 'MS_Description', '使用单位室主管意见', 'SCHEMA', dbo, 'table', eam_technical_status_change,
     'column', depart_header_signature_comment;
EXEC sp_addextendedproperty 'MS_Description', '使用单位部主管签字', 'SCHEMA', dbo, 'table', eam_technical_status_change,
     'column', depart_leader_signature;
EXEC sp_addextendedproperty 'MS_Description', '使用单位部主管签字时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_change, 'column', depart_leader_signature_time;
EXEC sp_addextendedproperty 'MS_Description', '使用单位部主管签字', 'SCHEMA', dbo, 'table', eam_technical_status_change,
     'column', depart_leader_signature_comment;
EXEC sp_addextendedproperty 'MS_Description', 'HF编码', 'SCHEMA', dbo, 'table', eam_technical_status_change, 'column',
     hf_code;
 
 
--技术状态变更申请明细
IF EXISTS (SELECT *
           FROM sys.objects
           WHERE object_id = OBJECT_ID(N'[dbo].[eam_technical_status_change_detail]')
             AND type in (N'U'))
    DROP TABLE [dbo].[eam_technical_status_change_detail];
CREATE TABLE [dbo].[eam_technical_status_change_detail]
(
    id                      NVARCHAR(32) NOT NULL,
    create_by               NVARCHAR(50),
    create_time             DATETIME2,
    update_by               NVARCHAR(50),
    update_time             DATETIME2,
    equipment_id            NVARCHAR(32),
    change_category         NVARCHAR(64),
    change_date             DATETIME2,
    change_technical_status NVARCHAR(64),
    acceptance_checker      NVARCHAR(50),
    acceptance_check_time   DATETIME2,
    acceptance_check_result NVARCHAR(64),
    order_id                NVARCHAR(32),
    PRIMARY KEY (id)
);
 
EXEC sp_addextendedproperty 'MS_Description', '技术状态变更申请明细', 'SCHEMA', dbo, 'table',
     eam_technical_status_change_detail, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', eam_technical_status_change_detail,
     'column', id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', eam_technical_status_change_detail,
     'column', create_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', eam_technical_status_change_detail,
     'column', create_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', eam_technical_status_change_detail,
     'column', update_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', eam_technical_status_change_detail,
     'column', update_time;
EXEC sp_addextendedproperty 'MS_Description', '设备ID', 'SCHEMA', dbo, 'table', eam_technical_status_change_detail,
     'column', equipment_id;
EXEC sp_addextendedproperty 'MS_Description', '变更原因;搬迁、大修、改造、其他', 'SCHEMA', dbo, 'table',
     eam_technical_status_change_detail, 'column', change_category;
EXEC sp_addextendedproperty 'MS_Description', '变更日期', 'SCHEMA', dbo, 'table', eam_technical_status_change_detail,
     'column', change_date;
EXEC sp_addextendedproperty 'MS_Description', '变更后技术状态;变更通过后默认设备技术状态改为禁用', 'SCHEMA', dbo,
     'table', eam_technical_status_change_detail, 'column', change_technical_status;
EXEC sp_addextendedproperty 'MS_Description', '验收检查人', 'SCHEMA', dbo, 'table', eam_technical_status_change_detail,
     'column', acceptance_checker;
EXEC sp_addextendedproperty 'MS_Description', '验收检查时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_change_detail, 'column', acceptance_check_time;
EXEC sp_addextendedproperty 'MS_Description',
     '验收检查结果;大修、改造 需要填写验收结果,搬迁按照技术状态鉴定工单维护,其他暂未使用到,只预留此类型', 'SCHEMA', dbo,
     'table', eam_technical_status_change_detail, 'column', acceptance_check_result;
EXEC sp_addextendedproperty 'MS_Description', '技术状态鉴定工单ID;搬迁使用', 'SCHEMA', dbo, 'table',
     eam_technical_status_change_detail, 'column', order_id;
 
 
--加工设备技术鉴定申请
IF EXISTS (SELECT *
           FROM sys.objects
           WHERE object_id = OBJECT_ID(N'[dbo].[eam_technical_status_evaluation_application]')
             AND type in (N'U'))
    DROP TABLE [dbo].[eam_technical_status_evaluation_application];
CREATE TABLE [dbo].[eam_technical_status_evaluation_application]
(
    id                                NVARCHAR(32) NOT NULL,
    create_by                         NVARCHAR(50),
    create_time                       DATETIME2,
    update_by                         NVARCHAR(50),
    update_time                       DATETIME2,
    del_flag                          INT,
    application_order_num             NVARCHAR(100),
    applicant                         NVARCHAR(50),
    factory_org_code                  NVARCHAR(100),
    apply_date                        DATETIME2,
    application_status                NVARCHAR(64),
    depart_header_signature           NVARCHAR(50),
    depart_header_signature_time      DATETIME2,
    depart_header_comment             NVARCHAR(255),
    production_header_signature       NVARCHAR(50),
    production_header_signature_time  DATETIME2,
    production_header_comment         NVARCHAR(255),
    production_support_signature      NVARCHAR(50),
    production_support_signature_time DATETIME2,
    production_support_comment        NVARCHAR(255),
    hf_code                           NVARCHAR(100),
    PRIMARY KEY (id)
);
 
EXEC sp_addextendedproperty 'MS_Description', '加工设备技术鉴定申请;禁用状态的设备或临时进行技术鉴定时使用', 'SCHEMA',
     dbo, 'table', eam_technical_status_evaluation_application, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_application, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_application, 'column', create_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_application, 'column', create_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_application, 'column', update_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_application, 'column', update_time;
EXEC sp_addextendedproperty 'MS_Description', '删除标记', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_application, 'column', del_flag;
EXEC sp_addextendedproperty 'MS_Description', '申请单号', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_application, 'column', application_order_num;
EXEC sp_addextendedproperty 'MS_Description', '申请人', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_application, 'column', applicant;
EXEC sp_addextendedproperty 'MS_Description', '申请部门', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_application, 'column', factory_org_code;
EXEC sp_addextendedproperty 'MS_Description', '申请日期', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_application, 'column', apply_date;
EXEC sp_addextendedproperty 'MS_Description',
     '申请单状态;待提交、待单位室级领导审核、生产设备管理主管审核、待保障部领导审核、已作废、已完成', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_application, 'column', application_status;
EXEC sp_addextendedproperty 'MS_Description', '申请单位室级领导签字', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_application, 'column', depart_header_signature;
EXEC sp_addextendedproperty 'MS_Description', '申请单位室级领导签字时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_application, 'column', depart_header_signature_time;
EXEC sp_addextendedproperty 'MS_Description', '申请单位室级领导意见', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_application, 'column', depart_header_comment;
EXEC sp_addextendedproperty 'MS_Description', '生产设备管理主管签字', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_application, 'column', production_header_signature;
EXEC sp_addextendedproperty 'MS_Description', '生产设备管理主管签字四件', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_application, 'column', production_header_signature_time;
EXEC sp_addextendedproperty 'MS_Description', '生产设备管理主管意见', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_application, 'column', production_header_comment;
EXEC sp_addextendedproperty 'MS_Description', '生产保障部领导签字', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_application, 'column', production_support_signature;
EXEC sp_addextendedproperty 'MS_Description', '生产保障部领导签字时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_application, 'column', production_support_signature_time;
EXEC sp_addextendedproperty 'MS_Description', '生产保障部领导意见', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_application, 'column', production_support_comment;
EXEC sp_addextendedproperty 'MS_Description', 'HF编码', 'SCHEMA', dbo, 'table',
     eam_technical_status_evaluation_application, 'column', hf_code;
 
--停用加工设备申请单
IF EXISTS (SELECT *
           FROM sys.objects
           WHERE object_id = OBJECT_ID(N'[dbo].[eam_technical_status_deactivate]')
             AND type in (N'U'))
    DROP TABLE [dbo].[eam_technical_status_deactivate];
CREATE TABLE [dbo].[eam_technical_status_deactivate]
(
    id                              NVARCHAR(32) NOT NULL,
    create_by                       NVARCHAR(50),
    create_time                     DATETIME2,
    update_by                       NVARCHAR(50),
    update_time                     DATETIME2,
    del_flag                        INT,
    deactivate_order_num            NVARCHAR(100),
    applicant                       NVARCHAR(50),
    factory_org_code                NVARCHAR(100),
    apply_date                      DATETIME2,
    application_status              NVARCHAR(64),
    depart_header_signature         NVARCHAR(50),
    depart_header_signature_time    DATETIME2,
    depart_header_signature_comment NVARCHAR(255),
    depart_leader_signature         NVARCHAR(50),
    depart_leader_signature_time    DATETIME2,
    depart_leader_signature_comment NVARCHAR(255),
    hf_code                         NVARCHAR(100),
    PRIMARY KEY (id)
);
 
EXEC sp_addextendedproperty 'MS_Description', '停用加工设备申请单;申请单位申请停用设备,审批通过后修改设备状态为禁用',
     'SCHEMA', dbo, 'table', eam_technical_status_deactivate, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', eam_technical_status_deactivate, 'column',
     id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', eam_technical_status_deactivate,
     'column', create_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', eam_technical_status_deactivate,
     'column', create_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', eam_technical_status_deactivate,
     'column', update_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', eam_technical_status_deactivate,
     'column', update_time;
EXEC sp_addextendedproperty 'MS_Description', '删除标记', 'SCHEMA', dbo, 'table', eam_technical_status_deactivate,
     'column', del_flag;
EXEC sp_addextendedproperty 'MS_Description', '停用单号', 'SCHEMA', dbo, 'table', eam_technical_status_deactivate,
     'column', deactivate_order_num;
EXEC sp_addextendedproperty 'MS_Description', '申请人', 'SCHEMA', dbo, 'table', eam_technical_status_deactivate,
     'column', applicant;
EXEC sp_addextendedproperty 'MS_Description', '申请部门', 'SCHEMA', dbo, 'table', eam_technical_status_deactivate,
     'column', factory_org_code;
EXEC sp_addextendedproperty 'MS_Description', '申请日期', 'SCHEMA', dbo, 'table', eam_technical_status_deactivate,
     'column', apply_date;
EXEC sp_addextendedproperty 'MS_Description',
     '申请单状态;待提交、待单位室级领导审核、生产设备管理主管审核、待保障部领导审核、已作废、已完成', 'SCHEMA', dbo, 'table',
     eam_technical_status_deactivate, 'column', application_status;
EXEC sp_addextendedproperty 'MS_Description', '使用单位室主管签字', 'SCHEMA', dbo, 'table',
     eam_technical_status_deactivate, 'column', depart_header_signature;
EXEC sp_addextendedproperty 'MS_Description', '使用单位室主管签字时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_deactivate, 'column', depart_header_signature_time;
EXEC sp_addextendedproperty 'MS_Description', '使用单位室主管意见', 'SCHEMA', dbo, 'table',
     eam_technical_status_deactivate, 'column', depart_header_signature_comment;
EXEC sp_addextendedproperty 'MS_Description', '使用单位部主管签字', 'SCHEMA', dbo, 'table',
     eam_technical_status_deactivate, 'column', depart_leader_signature;
EXEC sp_addextendedproperty 'MS_Description', '使用单位部主管签字时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_deactivate, 'column', depart_leader_signature_time;
EXEC sp_addextendedproperty 'MS_Description', '使用单位部主管签字', 'SCHEMA', dbo, 'table',
     eam_technical_status_deactivate, 'column', depart_leader_signature_comment;
EXEC sp_addextendedproperty 'MS_Description', 'HF编码', 'SCHEMA', dbo, 'table', eam_technical_status_deactivate,
     'column', hf_code;
 
 
--停用加工设备明细
IF EXISTS (SELECT *
           FROM sys.objects
           WHERE object_id = OBJECT_ID(N'[dbo].[eam_technical_status_deactivate_detail]')
             AND type in (N'U'))
    DROP TABLE [dbo].[eam_technical_status_deactivate_detail];
CREATE TABLE [dbo].[eam_technical_status_deactivate_detail]
(
    id                       NVARCHAR(32) NOT NULL,
    create_by                NVARCHAR(50),
    create_time              DATETIME2,
    update_by                NVARCHAR(50),
    update_time              DATETIME2,
    equipment_id             NVARCHAR(32),
    deactivate_reason        NVARCHAR(255),
    deactivate_duration      NUMERIC(24, 4),
    deactivate_duration_unit NVARCHAR(64),
    PRIMARY KEY (id)
);
 
EXEC sp_addextendedproperty 'MS_Description', '停用加工设备明细', 'SCHEMA', dbo, 'table',
     eam_technical_status_deactivate_detail, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', eam_technical_status_deactivate_detail,
     'column', id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', eam_technical_status_deactivate_detail,
     'column', create_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_deactivate_detail, 'column', create_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', eam_technical_status_deactivate_detail,
     'column', update_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table',
     eam_technical_status_deactivate_detail, 'column', update_time;
EXEC sp_addextendedproperty 'MS_Description', '设备ID', 'SCHEMA', dbo, 'table', eam_technical_status_deactivate_detail,
     'column', equipment_id;
EXEC sp_addextendedproperty 'MS_Description', '停用原因', 'SCHEMA', dbo, 'table',
     eam_technical_status_deactivate_detail, 'column', deactivate_reason;
EXEC sp_addextendedproperty 'MS_Description', '停用时长', 'SCHEMA', dbo, 'table',
     eam_technical_status_deactivate_detail, 'column', deactivate_duration;
EXEC sp_addextendedproperty 'MS_Description', '停用时长单位;天、月、年', 'SCHEMA', dbo, 'table',
     eam_technical_status_deactivate_detail, 'column', deactivate_duration_unit;