UPDATE [dbo].[sys_dict] SET [dict_name] = N'故障报修状态', [dict_code] = N'equipment_report_repair_status', [description] = '', [del_flag] = 0, [create_by] = N'admin', [create_time] = '2023-07-18 10:22:47.0000000', [update_by] = NULL, [update_time] = NULL, [type] = 0 WHERE CONVERT(NVARCHAR(MAX), [id]) = N'1681127343392382977';
UPDATE [dbo].[sys_dict_item] SET [dict_id] = N'1681127343392382977', [item_text] = N'报修', [item_value] = N'1', [description] = '', [sort_order] = 1, [status] = 1, [create_by] = N'admin', [create_time] = '2023-07-18 10:23:14.0000000', [update_by] = N'admin', [update_time] = '2023-11-16 11:21:33.8620000' WHERE CONVERT(NVARCHAR(MAX), [id]) = N'1681127454826651650';
UPDATE [dbo].[sys_dict_item] SET [dict_id] = N'1681127343392382977', [item_text] = N'维修', [item_value] = N'2', [description] = '', [sort_order] = 2, [status] = 1, [create_by] = N'admin', [create_time] = '2023-07-18 10:23:27.0000000', [update_by] = N'admin', [update_time] = '2023-11-16 11:22:41.4540000' WHERE CONVERT(NVARCHAR(MAX), [id]) = N'1681127509327437825';
UPDATE [dbo].[sys_dict_item] SET [dict_id] = N'1681127343392382977', [item_text] = N'大修', [item_value] = N'3', [description] = '', [sort_order] = 3, [status] = 1, [create_by] = N'admin', [create_time] = '2023-07-18 10:23:36.0000000', [update_by] = N'admin', [update_time] = '2023-11-16 11:22:54.6430000' WHERE CONVERT(NVARCHAR(MAX), [id]) = N'1681127549194297346';
UPDATE [dbo].[sys_dict_item] SET [dict_id] = N'1681127343392382977', [item_text] = N'完成', [item_value] = N'4', [description] = '', [sort_order] = 4, [status] = 1, [create_by] = N'admin', [create_time] = '2023-07-18 10:23:48.0000000', [update_by] = N'admin', [update_time] = '2023-11-16 11:22:33.5730000' WHERE CONVERT(NVARCHAR(MAX), [id]) = N'1681127599911821314';
UPDATE [dbo].[sys_dict_item] SET [dict_id] = N'1681127343392382977', [item_text] = N'验收', [item_value] = N'5', [description] = '', [sort_order] = 5, [status] = 1, [create_by] = N'admin', [create_time] = '2023-10-24 18:56:56.0000000', [update_by] = N'admin', [update_time] = '2023-11-16 14:21:48.9800000' WHERE CONVERT(NVARCHAR(MAX), [id]) = N'1716770747655516161';

INSERT INTO [dbo].[sys_dict] ([id], [dict_name], [dict_code], [description], [del_flag], [create_by], [create_time], [update_by], [update_time], [type]) VALUES (N'1725087877949898753', N'维修状态', N'repair_status', '', 0, N'admin', '2023-11-16 17:46:15.3370000', NULL, NULL, NULL);
INSERT INTO [dbo].[sys_dict_item] ([id], [dict_id], [item_text], [item_value], [description], [sort_order], [status], [create_by], [create_time], [update_by], [update_time]) VALUES (N'1725087989132509185', N'1725087877949898753', N'正常维修', N'normal', '', 1, 1, N'admin', '2023-11-16 17:46:41.8490000', NULL, NULL);
INSERT INTO [dbo].[sys_dict_item] ([id], [dict_id], [item_text], [item_value], [description], [sort_order], [status], [create_by], [create_time], [update_by], [update_time]) VALUES (N'1725088326862061570', N'1725087877949898753', N'等待备件', N'needSpare', '', 2, 1, N'admin', '2023-11-16 17:48:02.3790000', NULL, NULL);
INSERT INTO [dbo].[sys_dict_item] ([id], [dict_id], [item_text], [item_value], [description], [sort_order], [status], [create_by], [create_time], [update_by], [update_time]) VALUES (N'1725089103869460481', N'1725087877949898753', N'等待加工件', N'needPart', '', 3, 1, N'admin', '2023-11-16 17:51:07.0000000', N'admin', '2023-11-16 17:51:13.7290000');
INSERT INTO [dbo].[sys_dict_item] ([id], [dict_id], [item_text], [item_value], [description], [sort_order], [status], [create_by], [create_time], [update_by], [update_time]) VALUES (N'1725089375681331201', N'1725087877949898753', N'带故障运行', N'working', '', 4, 1, N'admin', '2023-11-16 17:52:12.0000000', N'admin', '2023-11-16 17:52:18.4560000');

ALTER TABLE [dbo].[mom_eam_equipment_report_repair] ADD [accept_time] datetime2 NULL
    GO

ALTER TABLE [dbo].[mom_eam_equipment_report_repair] ADD [finish_time] datetime2 NULL
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'验收时间',
    'SCHEMA', N'dbo',
    'TABLE', N'mom_eam_equipment_report_repair',
    'COLUMN', N'accept_time'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'完成时间',
    'SCHEMA', N'dbo',
    'TABLE', N'mom_eam_equipment_report_repair',
    'COLUMN', N'finish_time'

INSERT INTO [dbo].[sys_quartz_job] ([id], [create_by], [create_time], [del_flag], [update_by], [update_time], [job_class_name], [cron_expression], [parameter], [description], [status], [job_name]) VALUES (N'1301802672317695720', N'admin', '2023-11-16 18:38:01.0000000', 0, N'admin', '2023-11-16 18:38:11.0000000', N'org.jeecg.modules.eam.job.EquipmentWarrantyEndDateAlertJob', N'0 0 1 * * ? *', NULL, N'故障报修验收', 0, N'维修完成12小时后验收');

INSERT INTO [dbo].[sys_dict] ([id], [dict_name], [dict_code], [description], [del_flag], [create_by], [create_time], [update_by], [update_time], [type]) VALUES (N'1725333574041309186', N'维修工单状态', N'true_repair_status', '', 0, N'admin', '2023-11-17 10:02:33.8500000', NULL, NULL, NULL);

INSERT INTO [dbo].[sys_dict_item] ([id], [dict_id], [item_text], [item_value], [description], [sort_order], [status], [create_by], [create_time], [update_by], [update_time]) VALUES (N'1725334295704866818', N'1725333574041309186', N'未派工', N'2', '', 1, 1, N'admin', '2023-11-17 10:05:25.9110000', NULL, NULL);
INSERT INTO [dbo].[sys_dict_item] ([id], [dict_id], [item_text], [item_value], [description], [sort_order], [status], [create_by], [create_time], [update_by], [update_time]) VALUES (N'1725334447886798850', N'1725333574041309186', N'维修', N'3', '', 2, 1, N'admin', '2023-11-17 10:06:02.1960000', NULL, NULL);
INSERT INTO [dbo].[sys_dict_item] ([id], [dict_id], [item_text], [item_value], [description], [sort_order], [status], [create_by], [create_time], [update_by], [update_time]) VALUES (N'1725334568024248321', N'1725333574041309186', N'完成', N'4', '', 4, 1, N'admin', '2023-11-17 10:06:30.8390000', NULL, NULL);

ALTER TABLE [dbo].[mom_eam_repair_order] DROP CONSTRAINT [DF__mom_eam_r__repai__7822EBA0]
    GO

ALTER TABLE [dbo].[mom_eam_repair_order] DROP CONSTRAINT [DF__mom_eam_r__repai__79170FD9]
    GO

ALTER TABLE [dbo].[mom_eam_repair_order] DROP CONSTRAINT [DF__mom_eam_r__repai__7A0B3412]
    GO

ALTER TABLE [dbo].[mom_eam_repair_order] DROP CONSTRAINT [DF__mom_eam_r__repai__7AFF584B]
    GO

ALTER TABLE [dbo].[mom_eam_repair_order] ALTER COLUMN [repair_order_uda2] datetime2 NULL
    GO

ALTER TABLE [dbo].[mom_eam_repair_order] ALTER COLUMN [repair_order_uda3] datetime2 NULL
    GO

ALTER TABLE [dbo].[mom_eam_repair_order] ALTER COLUMN [repair_order_uda4] datetime2 NULL
    GO

ALTER TABLE [dbo].[mom_eam_repair_order] ALTER COLUMN [repair_order_uda5] datetime2 NULL
    GO

    IF ((SELECT COUNT(*) FROM ::fn_listextendedproperty('MS_Description',
    'SCHEMA', N'dbo',
    'TABLE', N'mom_eam_repair_order',
    'COLUMN', N'repair_order_uda2')) > 0)
    EXEC sp_updateextendedproperty
    'MS_Description', N'等待备件开始时间',
    'SCHEMA', N'dbo',
    'TABLE', N'mom_eam_repair_order',
    'COLUMN', N'repair_order_uda2'
    ELSE
    EXEC sp_addextendedproperty
    'MS_Description', N'等待备件开始时间',
    'SCHEMA', N'dbo',
    'TABLE', N'mom_eam_repair_order',
    'COLUMN', N'repair_order_uda2'
    GO

    IF ((SELECT COUNT(*) FROM ::fn_listextendedproperty('MS_Description',
    'SCHEMA', N'dbo',
    'TABLE', N'mom_eam_repair_order',
    'COLUMN', N'repair_order_uda3')) > 0)
    EXEC sp_updateextendedproperty
    'MS_Description', N'等待备件结束时间',
    'SCHEMA', N'dbo',
    'TABLE', N'mom_eam_repair_order',
    'COLUMN', N'repair_order_uda3'
    ELSE
    EXEC sp_addextendedproperty
    'MS_Description', N'等待备件结束时间',
    'SCHEMA', N'dbo',
    'TABLE', N'mom_eam_repair_order',
    'COLUMN', N'repair_order_uda3'
    GO

    IF ((SELECT COUNT(*) FROM ::fn_listextendedproperty('MS_Description',
    'SCHEMA', N'dbo',
    'TABLE', N'mom_eam_repair_order',
    'COLUMN', N'repair_order_uda4')) > 0)
    EXEC sp_updateextendedproperty
    'MS_Description', N'等待加工件开始时间',
    'SCHEMA', N'dbo',
    'TABLE', N'mom_eam_repair_order',
    'COLUMN', N'repair_order_uda4'
    ELSE
    EXEC sp_addextendedproperty
    'MS_Description', N'等待加工件开始时间',
    'SCHEMA', N'dbo',
    'TABLE', N'mom_eam_repair_order',
    'COLUMN', N'repair_order_uda4'
    GO

    IF ((SELECT COUNT(*) FROM ::fn_listextendedproperty('MS_Description',
    'SCHEMA', N'dbo',
    'TABLE', N'mom_eam_repair_order',
    'COLUMN', N'repair_order_uda5')) > 0)
    EXEC sp_updateextendedproperty
    'MS_Description', N'等待加工件结束时间',
    'SCHEMA', N'dbo',
    'TABLE', N'mom_eam_repair_order',
    'COLUMN', N'repair_order_uda5'
    ELSE
    EXEC sp_addextendedproperty
    'MS_Description', N'等待加工件结束时间',
    'SCHEMA', N'dbo',
    'TABLE', N'mom_eam_repair_order',
    'COLUMN', N'repair_order_uda5'

ALTER TABLE [dbo].[mom_eam_repair_order] ADD [spare_time] decimal NULL
    GO

ALTER TABLE [dbo].[mom_eam_repair_order] ADD [part_time] decimal NULL
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'等待备件总时长',
    'SCHEMA', N'dbo',
    'TABLE', N'mom_eam_repair_order',
    'COLUMN', N'spare_time'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'等待加工件总时长',
    'SCHEMA', N'dbo',
    'TABLE', N'mom_eam_repair_order',
    'COLUMN', N'part_time'

ALTER TABLE [dbo].[mom_eam_equipment_report_repair] ADD [fault_hour] decimal NULL
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'停机时长',
    'SCHEMA', N'dbo',
    'TABLE', N'mom_eam_equipment_report_repair',
    'COLUMN', N'fault_hour'
