INSERT INTO `product_sys_function_buttons` ( `uuid`, `function_uuid`, `button_name`, `button_title`, `button_description`, `button_type`, `button_icon`, `upload_parameter`, `api_url`, `is_main`, `status_uuid`, `script`, `sequence`, `is_send_email`, `script_method`, `button_category_uuid`, `client_type_uuid`, `version_uuid`, `top_location`, `left_location`, `click_method`, `upload_api_url`, `multiple_choice`, `route_name`, `params`, `is_warn`, `warn_info`, `button_color`, `print_template`, `next_page_keys`, `terminal_type`) VALUES ( '6e1cf9c9-a4b3-4af0-bbcd-f41401094f0f', '2fbcdeca-5266-493c-8af9-1f0c52e78cfc', 'autoLayout', '自动布局', NULL, 2, '', '', NULL, 0, '1', NULL, 1, NULL, NULL, 'custom', 'Web', NULL, '194px', '913px', 'autoLayout', '', '1', '172887454447636WoA1b839', NULL, 0, '', 'rgba(30, 144, 255, 1)', '', '', 1);
INSERT INTO `product_sys_function_buttons` ( `uuid`, `function_uuid`, `button_name`, `button_title`, `button_description`, `button_type`, `button_icon`, `upload_parameter`, `api_url`, `is_main`, `status_uuid`, `script`, `sequence`, `is_send_email`, `script_method`, `button_category_uuid`, `client_type_uuid`, `version_uuid`, `top_location`, `left_location`, `click_method`, `upload_api_url`, `multiple_choice`, `route_name`, `params`, `is_warn`, `warn_info`, `button_color`, `print_template`, `next_page_keys`, `terminal_type`) VALUES ( '2a60f5ee-cd59-4832-9e3a-d926e59fc1a5', '2fbcdeca-5266-493c-8af9-1f0c52e78cfc', 'copy', '参照其他表单', NULL, 2, '', '', NULL, 0, '1', NULL, 1, NULL, NULL, 'custom', 'Web', NULL, '129px', '912px', 'copyFace', '', '1', '172887454446069yV530192', NULL, 0, '', 'rgba(30, 144, 255, 1)', '', '', 1);

INSERT INTO `product_sys_link` (`created_utc_datetime`, `created_by`, `line_from`, `from_type`, `function_uuid`,  `link_type`, `line_to`, `to_type`, `updated_by`, `updated_utc_datetime`, `uuid`, `terminal_type`) VALUES ('2024-10-14 10:55:45', 1, '9bf0c614-a31c-474e-ac20-8af8ae8aa01a', 2, '2fbcdeca-5266-493c-8af9-1f0c52e78cfc',  0, '2a60f5ee-cd59-4832-9e3a-d926e59fc1a5', 1, NULL, NULL, '820fd3b3-14ec-4b08-bb34-23cb0aa69407', 1);
INSERT INTO `product_sys_link` (`created_utc_datetime`, `created_by`, `line_from`, `from_type`, `function_uuid`,  `link_type`, `line_to`, `to_type`, `updated_by`, `updated_utc_datetime`, `uuid`, `terminal_type`) VALUES ('2024-10-14 10:55:45', 1, '9bf0c614-a31c-474e-ac20-8af8ae8aa01a', 2, '2fbcdeca-5266-493c-8af9-1f0c52e78cfc',  0, '6e1cf9c9-a4b3-4af0-bbcd-f41401094f0f', 1, NULL, NULL, '9012029d-7d01-499b-b4c1-ff4e43f9db5a', 1);
INSERT INTO `product_sys_dict` ( `uuid`, `dict_name`, `dict_label`, `dict_value`, `is_used`, `client_type`, `org_level_uuid`, `sequence`, `created_by`, `created_utc_datetime`, `updated_by`, `updated_utc_datetime`, `client_uuid`, `dict_value_color`, `dict_value_img`, `dict_group`) VALUES ( '1d478f8e-85dc-4024-b325-c441ecb888d5', '组织机构控件选择类型', '公司', '1', 1, 'Web', '00000000-0000-0000-0000-000000000000', 1, 1, '2023-04-20 10:56:29', 1, '2023-04-20 10:56:55', NULL, NULL, NULL, NULL);
INSERT INTO `product_sys_dict` ( `uuid`, `dict_name`, `dict_label`, `dict_value`, `is_used`, `client_type`, `org_level_uuid`, `sequence`, `created_by`, `created_utc_datetime`, `updated_by`, `updated_utc_datetime`, `client_uuid`, `dict_value_color`, `dict_value_img`, `dict_group`) VALUES ( 'baa650b6-22d9-484d-9342-10d7dce428c2', '组织机构控件选择类型', '部门', '2', 1, 'Web', '00000000-0000-0000-0000-000000000000', 2, 1, '2023-04-20 10:56:29', 1, '2023-04-20 10:56:55', NULL, NULL, NULL, NULL);
INSERT INTO `product_sys_dict` ( `uuid`, `dict_name`, `dict_label`, `dict_value`, `is_used`, `client_type`, `org_level_uuid`, `sequence`, `created_by`, `created_utc_datetime`, `updated_by`, `updated_utc_datetime`, `client_uuid`, `dict_value_color`, `dict_value_img`, `dict_group`) VALUES ( 'cf1f4d7b-af04-45a7-9b49-06b5e42e88b7', '组织机构控件选择类型', '岗位', '3', 1, 'Web', '00000000-0000-0000-0000-000000000000', 3, 1, '2023-04-20 10:56:29', 1, '2023-04-20 10:56:55', NULL, NULL, NULL, NULL);
INSERT INTO `product_sys_dict` ( `uuid`, `dict_name`, `dict_label`, `dict_value`, `is_used`, `client_type`, `org_level_uuid`, `sequence`, `created_by`, `created_utc_datetime`, `updated_by`, `updated_utc_datetime`, `client_uuid`, `dict_value_color`, `dict_value_img`, `dict_group`) VALUES ( 'e692b2be-f96b-4952-866c-9ddb06e16a7e', '组织机构控件选择类型', '岗位层级下的人员', '4', 1, 'Web', '00000000-0000-0000-0000-000000000000', 4, 1, '2023-04-20 10:56:29', 1, '2023-04-20 10:56:55', NULL, NULL, NULL, NULL);
INSERT INTO `product_sys_dict` ( `uuid`, `dict_name`, `dict_label`, `dict_value`, `is_used`, `client_type`, `org_level_uuid`, `sequence`, `created_by`, `created_utc_datetime`, `updated_by`, `updated_utc_datetime`, `client_uuid`, `dict_value_color`, `dict_value_img`, `dict_group`) VALUES ( '193f0119-0855-4cf9-9769-ffa2f3d224d8', '组织机构控件选择类型', '部门层级下的人员', '5', 1, 'Web', '00000000-0000-0000-0000-000000000000', 5, 1, '2023-04-20 10:56:29', 1, '2023-04-20 10:56:55', NULL, NULL, NULL, NULL);


INSERT INTO `product_sys_datamodel_table` (uuid,created_by,created_utc_datetime,updated_by,updated_utc_datetime,org_level_uuid,table_name,table_description,table_type,table_base_view,view_sql,table_primary_key,sequence,is_international,produce_msg,container_name,view_status) SELECT '0671f9dc-15a4-45cc-bf92-834be5774c75', '1', '2022-07-29 00:00:00', '1', '2022-07-29 00:00:00', NULL, 'product_sys_sent_v', '已发视图', '2', '', 'select *
from (
	select t.uuid,t.title,n.title node_title,send_time,finish_type status,0 type,sender,group_concat(expect_person) wait_deal_person
	from product_sys_flow_task t
	inner join product_sys_flow_node n on t.cur_node_uuid=n.uuid
	left join product_sys_flow_detail d on d.task_uuid=t.uuid and d.node_deal_sign in (0,1,5)
	group by 1,2,3,4,5,6,7
	union all
	select uuid,title,null node_title,start_time,status,1 type,created_by,null
	from product_oa_cooperates
	where status is not null
) t', NULL, '1', NULL, NULL, NULL, NULL from DUAL where not EXISTS (select 1 from product_sys_datamodel_table  where table_name='product_sys_sent_v');
INSERT INTO product_sys_datamodel_field (uuid,table_uuid, field_name, field_type, field_show_name, field_description, field_length, field_unit, is_required, is_unique, is_international, is_filter, field_format, related_table, field_reference, field_relation_table, field_sequence, created_by, created_utc_datetime, updated_by, updated_utc_datetime, is_more_value) SELECT uuid(), '0671f9dc-15a4-45cc-bf92-834be5774c75', 'node_title', 'string', '环节标题', '环节标题', '20', '0', '0', NULL, NULL, '0', NULL, NULL, NULL, NULL, '0', '1', '2024-07-04 09:07:53', NULL, NULL, NULL FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM product_sys_datamodel_field WHERE table_uuid = '0671f9dc-15a4-45cc-bf92-834be5774c75' and field_name='node_title');
INSERT INTO product_sys_datamodel_field (uuid,table_uuid, field_name, field_type, field_show_name, field_description, field_length, field_unit, is_required, is_unique, is_international, is_filter, field_format, related_table, field_reference, field_relation_table, field_sequence, created_by, created_utc_datetime, updated_by, updated_utc_datetime, is_more_value) SELECT uuid(), '0671f9dc-15a4-45cc-bf92-834be5774c75', 'send_time', 'datetime', '发送时间', '发送时间', '20', '0', '0', NULL, NULL, '1', NULL, NULL, NULL, NULL, '0', '1', '2024-07-04 09:07:53', NULL, NULL, NULL FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM product_sys_datamodel_field WHERE table_uuid = '0671f9dc-15a4-45cc-bf92-834be5774c75' and field_name='send_time');
INSERT INTO product_sys_datamodel_field (uuid,table_uuid, field_name, field_type, field_show_name, field_description, field_length, field_unit, is_required, is_unique, is_international, is_filter, field_format, related_table, field_reference, field_relation_table, field_sequence, created_by, created_utc_datetime, updated_by, updated_utc_datetime, is_more_value) SELECT uuid(), '0671f9dc-15a4-45cc-bf92-834be5774c75', 'sender', 'string', '发送人', '发送人', '20', '0', '0', NULL, NULL, '0', NULL, NULL, NULL, NULL, '0', '1', '2024-07-04 09:07:53', NULL, NULL, NULL FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM product_sys_datamodel_field WHERE table_uuid = '0671f9dc-15a4-45cc-bf92-834be5774c75' and field_name='sender');
INSERT INTO product_sys_datamodel_field (uuid,table_uuid, field_name, field_type, field_show_name, field_description, field_length, field_unit, is_required, is_unique, is_international, is_filter, field_format, related_table, field_reference, field_relation_table, field_sequence, created_by, created_utc_datetime, updated_by, updated_utc_datetime, is_more_value) SELECT uuid(), '0671f9dc-15a4-45cc-bf92-834be5774c75', 'status', 'int', '状态', '状态', '20', '0', '0', NULL, NULL, '1', NULL, NULL, '《flow_send_status》', NULL, '0', '1', '2024-07-04 09:07:53', NULL, NULL, NULL FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM product_sys_datamodel_field WHERE table_uuid = '0671f9dc-15a4-45cc-bf92-834be5774c75' and field_name='status');
INSERT INTO product_sys_datamodel_field (uuid,table_uuid, field_name, field_type, field_show_name, field_description, field_length, field_unit, is_required, is_unique, is_international, is_filter, field_format, related_table, field_reference, field_relation_table, field_sequence, created_by, created_utc_datetime, updated_by, updated_utc_datetime, is_more_value) SELECT uuid(), '0671f9dc-15a4-45cc-bf92-834be5774c75', 'title', 'string', '标题', '标题', '20', '0', '0', NULL, NULL, '1', NULL, NULL, NULL, NULL, '0', '1', '2024-07-04 09:07:53', NULL, NULL, NULL FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM product_sys_datamodel_field WHERE table_uuid = '0671f9dc-15a4-45cc-bf92-834be5774c75' and field_name='title');
INSERT INTO product_sys_datamodel_field (uuid,table_uuid, field_name, field_type, field_show_name, field_description, field_length, field_unit, is_required, is_unique, is_international, is_filter, field_format, related_table, field_reference, field_relation_table, field_sequence, created_by, created_utc_datetime, updated_by, updated_utc_datetime, is_more_value) SELECT uuid(), '0671f9dc-15a4-45cc-bf92-834be5774c75', 'type', 'int', '类型', '类型', '20', '0', '0', NULL, NULL, '0', NULL, NULL, NULL, NULL, '0', '1', '2024-07-04 09:07:53', NULL, NULL, NULL FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM product_sys_datamodel_field WHERE table_uuid = '0671f9dc-15a4-45cc-bf92-834be5774c75' and field_name='type');
INSERT INTO product_sys_datamodel_field (uuid,table_uuid, field_name, field_type, field_show_name, field_description, field_length, field_unit, is_required, is_unique, is_international, is_filter, field_format, related_table, field_reference, field_relation_table, field_sequence, created_by, created_utc_datetime, updated_by, updated_utc_datetime, is_more_value) SELECT uuid(), '0671f9dc-15a4-45cc-bf92-834be5774c75', 'uuid', 'string', '明细uuid', '明细uuid', '20', '0', '0', NULL, NULL, '0', NULL, NULL, NULL, NULL, '0', '1', '2024-07-04 09:07:53', NULL, NULL, NULL FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM product_sys_datamodel_field WHERE table_uuid = '0671f9dc-15a4-45cc-bf92-834be5774c75' and field_name='uuid');
INSERT INTO product_sys_datamodel_field (uuid,table_uuid, field_name, field_type, field_show_name, field_description, field_length, field_unit, is_required, is_unique, is_international, is_filter, field_format, related_table, field_reference, field_relation_table, field_sequence, created_by, created_utc_datetime, updated_by, updated_utc_datetime, is_more_value) SELECT uuid(), '0671f9dc-15a4-45cc-bf92-834be5774c75', 'wait_deal_person', 'string', '待处理人员', '待处理人员', '200', '0', '0', NULL, NULL, '0', NULL, NULL, 'user_name_by_user_id', NULL, '0', '1', '2024-07-04 09:07:53', NULL, NULL, NULL FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM product_sys_datamodel_field WHERE table_uuid = '0671f9dc-15a4-45cc-bf92-834be5774c75' and field_name='wait_deal_person');
UPDATE product_sys_datamodel_field SET table_uuid = '0671f9dc-15a4-45cc-bf92-834be5774c75', field_name = 'node_title', field_type = 'string', field_show_name = '环节标题', field_description = '环节标题', field_length = 20, field_unit = '0', is_required = 0, is_unique = NULL, is_international = NULL, is_filter = 0, field_format = NULL, related_table = NULL, field_reference = NULL, field_relation_table = NULL, field_sequence = 0, created_by = '1', created_utc_datetime = '2024-07-04 09:07:53', updated_by = NULL, updated_utc_datetime = now(), is_more_value = NULL WHERE table_uuid = '0671f9dc-15a4-45cc-bf92-834be5774c75' AND field_name = 'node_title';
UPDATE product_sys_datamodel_field SET table_uuid = '0671f9dc-15a4-45cc-bf92-834be5774c75', field_name = 'send_time', field_type = 'datetime', field_show_name = '发送时间', field_description = '发送时间', field_length = 20, field_unit = '0', is_required = 0, is_unique = NULL, is_international = NULL, is_filter = 1, field_format = NULL, related_table = NULL, field_reference = NULL, field_relation_table = NULL, field_sequence = 0, created_by = '1', created_utc_datetime = '2024-07-04 09:07:53', updated_by = NULL, updated_utc_datetime = now(), is_more_value = NULL WHERE table_uuid = '0671f9dc-15a4-45cc-bf92-834be5774c75' AND field_name = 'send_time';
UPDATE product_sys_datamodel_field SET table_uuid = '0671f9dc-15a4-45cc-bf92-834be5774c75', field_name = 'sender', field_type = 'string', field_show_name = '发送人', field_description = '发送人', field_length = 20, field_unit = '0', is_required = 0, is_unique = NULL, is_international = NULL, is_filter = 0, field_format = NULL, related_table = NULL, field_reference = NULL, field_relation_table = NULL, field_sequence = 0, created_by = '1', created_utc_datetime = '2024-07-04 09:07:53', updated_by = NULL, updated_utc_datetime = now(), is_more_value = NULL WHERE table_uuid = '0671f9dc-15a4-45cc-bf92-834be5774c75' AND field_name = 'sender';
UPDATE product_sys_datamodel_field SET table_uuid = '0671f9dc-15a4-45cc-bf92-834be5774c75', field_name = 'status', field_type = 'int', field_show_name = '状态', field_description = '状态', field_length = 20, field_unit = '0', is_required = 0, is_unique = NULL, is_international = NULL, is_filter = 1, field_format = NULL, related_table = NULL, field_reference = '《flow_send_status》', field_relation_table = NULL, field_sequence = 0, created_by = '1', created_utc_datetime = '2024-07-04 09:07:53', updated_by = NULL, updated_utc_datetime = now(), is_more_value = NULL WHERE table_uuid = '0671f9dc-15a4-45cc-bf92-834be5774c75' AND field_name = 'status';
UPDATE product_sys_datamodel_field SET table_uuid = '0671f9dc-15a4-45cc-bf92-834be5774c75', field_name = 'title', field_type = 'string', field_show_name = '标题', field_description = '标题', field_length = 20, field_unit = '0', is_required = 0, is_unique = NULL, is_international = NULL, is_filter = 1, field_format = NULL, related_table = NULL, field_reference = NULL, field_relation_table = NULL, field_sequence = 0, created_by = '1', created_utc_datetime = '2024-07-04 09:07:53', updated_by = NULL, updated_utc_datetime = now(), is_more_value = NULL WHERE table_uuid = '0671f9dc-15a4-45cc-bf92-834be5774c75' AND field_name = 'title';
UPDATE product_sys_datamodel_field SET table_uuid = '0671f9dc-15a4-45cc-bf92-834be5774c75', field_name = 'type', field_type = 'int', field_show_name = '类型', field_description = '类型', field_length = 20, field_unit = '0', is_required = 0, is_unique = NULL, is_international = NULL, is_filter = 0, field_format = NULL, related_table = NULL, field_reference = NULL, field_relation_table = NULL, field_sequence = 0, created_by = '1', created_utc_datetime = '2024-07-04 09:07:53', updated_by = NULL, updated_utc_datetime = now(), is_more_value = NULL WHERE table_uuid = '0671f9dc-15a4-45cc-bf92-834be5774c75' AND field_name = 'type';
UPDATE product_sys_datamodel_field SET table_uuid = '0671f9dc-15a4-45cc-bf92-834be5774c75', field_name = 'uuid', field_type = 'string', field_show_name = '明细uuid', field_description = '明细uuid', field_length = 20, field_unit = '0', is_required = 0, is_unique = NULL, is_international = NULL, is_filter = 0, field_format = NULL, related_table = NULL, field_reference = NULL, field_relation_table = NULL, field_sequence = 0, created_by = '1', created_utc_datetime = '2024-07-04 09:07:53', updated_by = NULL, updated_utc_datetime = now(), is_more_value = NULL WHERE table_uuid = '0671f9dc-15a4-45cc-bf92-834be5774c75' AND field_name = 'uuid';
UPDATE product_sys_datamodel_field SET table_uuid = '0671f9dc-15a4-45cc-bf92-834be5774c75', field_name = 'wait_deal_person', field_type = 'string', field_show_name = '待处理人员', field_description = '待处理人员', field_length = 200, field_unit = '0', is_required = 0, is_unique = NULL, is_international = NULL, is_filter = 0, field_format = NULL, related_table = NULL, field_reference = 'user_name_by_user_id', field_relation_table = NULL, field_sequence = 0, created_by = '1', created_utc_datetime = '2024-07-04 09:07:53', updated_by = NULL, updated_utc_datetime = now(), is_more_value = NULL WHERE table_uuid = '0671f9dc-15a4-45cc-bf92-834be5774c75' AND field_name = 'wait_deal_person';
DELETE FROM `product_sys_datamodel_field` where table_uuid='0671f9dc-15a4-45cc-bf92-834be5774c75' and  DATE_FORMAT(updated_utc_datetime, '%Y-%m-%d') != DATE_FORMAT(CURDATE(), '%Y-%m-%d');
DELETE FROM `product_sys_datamodel_table_index` where table_uuid='0671f9dc-15a4-45cc-bf92-834be5774c75';



ALTER TABLE `product_sys_data_upload_model` ADD COLUMN `start_row_index` int NULL DEFAULT NULL COMMENT '表头行起始下标' AFTER `sheet_order`;


INSERT INTO `product_sys_datamodel_table` (uuid,created_by,created_utc_datetime,updated_by,updated_utc_datetime,org_level_uuid,table_name,table_description,table_type,table_base_view,view_sql,table_primary_key,sequence,is_international,produce_msg,container_name,view_status) SELECT '9a55ffcb-eecd-4e4d-99f8-24c06014f506', '1', '2021-06-29 00:00:00', '1', '2021-06-29 00:00:00', NULL, 'product_sys_data_upload_model', '数据上传模板', '1', NULL, NULL, 'uuid', '210', NULL, NULL, NULL, NULL from DUAL where not EXISTS (select 1 from product_sys_datamodel_table  where table_name='product_sys_data_upload_model');
INSERT INTO product_sys_datamodel_field (uuid,table_uuid, field_name, field_type, field_show_name, field_description, field_length, field_unit, is_required, is_unique, is_international, is_filter, field_format, related_table, field_reference, field_relation_table, field_sequence, created_by, created_utc_datetime, updated_by, updated_utc_datetime, is_more_value) SELECT uuid(), '9a55ffcb-eecd-4e4d-99f8-24c06014f506', 'after_func', 'string', '保存后处理', '保存后处理方法', '200', '0', '0', '0', NULL, '0', NULL, NULL, NULL, NULL, '0', NULL, NULL, '1', '2023-07-03 10:13:09', NULL FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM product_sys_datamodel_field WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' and field_name='after_func');
INSERT INTO product_sys_datamodel_field (uuid,table_uuid, field_name, field_type, field_show_name, field_description, field_length, field_unit, is_required, is_unique, is_international, is_filter, field_format, related_table, field_reference, field_relation_table, field_sequence, created_by, created_utc_datetime, updated_by, updated_utc_datetime, is_more_value) SELECT uuid(), '9a55ffcb-eecd-4e4d-99f8-24c06014f506', 'before_func', 'string', '保存前处理', '保存前处理方法', '200', '0', '0', '0', NULL, '0', NULL, NULL, NULL, NULL, '0', NULL, NULL, '1', '2023-07-03 10:13:09', NULL FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM product_sys_datamodel_field WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' and field_name='before_func');
INSERT INTO product_sys_datamodel_field (uuid,table_uuid, field_name, field_type, field_show_name, field_description, field_length, field_unit, is_required, is_unique, is_international, is_filter, field_format, related_table, field_reference, field_relation_table, field_sequence, created_by, created_utc_datetime, updated_by, updated_utc_datetime, is_more_value) SELECT uuid(), '9a55ffcb-eecd-4e4d-99f8-24c06014f506', 'button_title', 'string', '按钮标题', '对应按钮标题', '200', '0', '0', '0', NULL, '0', NULL, NULL, NULL, NULL, '0', NULL, NULL, '1', '2023-07-03 10:13:09', NULL FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM product_sys_datamodel_field WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' and field_name='button_title');
INSERT INTO product_sys_datamodel_field (uuid,table_uuid, field_name, field_type, field_show_name, field_description, field_length, field_unit, is_required, is_unique, is_international, is_filter, field_format, related_table, field_reference, field_relation_table, field_sequence, created_by, created_utc_datetime, updated_by, updated_utc_datetime, is_more_value) SELECT uuid(), '9a55ffcb-eecd-4e4d-99f8-24c06014f506', 'created_by', 'userid', '创建者', '创建者', '11', '0', '1', NULL, NULL, '0', NULL, NULL, 'user_name_by_user_id', NULL, '0', NULL, NULL, '1', '2023-07-03 10:13:09', NULL FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM product_sys_datamodel_field WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' and field_name='created_by');
INSERT INTO product_sys_datamodel_field (uuid,table_uuid, field_name, field_type, field_show_name, field_description, field_length, field_unit, is_required, is_unique, is_international, is_filter, field_format, related_table, field_reference, field_relation_table, field_sequence, created_by, created_utc_datetime, updated_by, updated_utc_datetime, is_more_value) SELECT uuid(), '9a55ffcb-eecd-4e4d-99f8-24c06014f506', 'created_utc_datetime', 'datetime', '创建时间', '创建时间', '0', '0', '1', NULL, NULL, '0', NULL, NULL, '', NULL, '0', NULL, NULL, '1', '2023-07-03 10:13:09', NULL FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM product_sys_datamodel_field WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' and field_name='created_utc_datetime');
INSERT INTO product_sys_datamodel_field (uuid,table_uuid, field_name, field_type, field_show_name, field_description, field_length, field_unit, is_required, is_unique, is_international, is_filter, field_format, related_table, field_reference, field_relation_table, field_sequence, created_by, created_utc_datetime, updated_by, updated_utc_datetime, is_more_value) SELECT uuid(), '9a55ffcb-eecd-4e4d-99f8-24c06014f506', 'function_uuid', 'string', '功能uuid', '对应功能uuid', '80', '0', '0', '0', NULL, '0', NULL, NULL, NULL, NULL, '0', NULL, NULL, '1', '2023-07-03 10:13:09', NULL FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM product_sys_datamodel_field WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' and field_name='function_uuid');
INSERT INTO product_sys_datamodel_field (uuid,table_uuid, field_name, field_type, field_show_name, field_description, field_length, field_unit, is_required, is_unique, is_international, is_filter, field_format, related_table, field_reference, field_relation_table, field_sequence, created_by, created_utc_datetime, updated_by, updated_utc_datetime, is_more_value) SELECT uuid(), '9a55ffcb-eecd-4e4d-99f8-24c06014f506', 'id', 'pk', '主键', '主键', '11', '0', '0', NULL, NULL, '0', NULL, NULL, NULL, NULL, '0', NULL, NULL, '1', '2023-07-03 10:13:09', NULL FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM product_sys_datamodel_field WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' and field_name='id');
INSERT INTO product_sys_datamodel_field (uuid,table_uuid, field_name, field_type, field_show_name, field_description, field_length, field_unit, is_required, is_unique, is_international, is_filter, field_format, related_table, field_reference, field_relation_table, field_sequence, created_by, created_utc_datetime, updated_by, updated_utc_datetime, is_more_value) SELECT uuid(), '9a55ffcb-eecd-4e4d-99f8-24c06014f506', 'org_level_uuid', 'orgUuid', '组织机构', '组织机构', '80', '0', '1', NULL, NULL, '0', NULL, NULL, 'levels', NULL, '0', NULL, NULL, '1', '2023-07-03 10:13:09', NULL FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM product_sys_datamodel_field WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' and field_name='org_level_uuid');
INSERT INTO product_sys_datamodel_field (uuid,table_uuid, field_name, field_type, field_show_name, field_description, field_length, field_unit, is_required, is_unique, is_international, is_filter, field_format, related_table, field_reference, field_relation_table, field_sequence, created_by, created_utc_datetime, updated_by, updated_utc_datetime, is_more_value) SELECT uuid(), '9a55ffcb-eecd-4e4d-99f8-24c06014f506', 'sheet_order', 'int', 'sheet顺序', 'sheet顺序', '4', '0', '0', '0', NULL, '0', NULL, NULL, NULL, NULL, '0', NULL, NULL, '1', '2023-07-03 10:13:09', NULL FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM product_sys_datamodel_field WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' and field_name='sheet_order');
INSERT INTO product_sys_datamodel_field (uuid,table_uuid, field_name, field_type, field_show_name, field_description, field_length, field_unit, is_required, is_unique, is_international, is_filter, field_format, related_table, field_reference, field_relation_table, field_sequence, created_by, created_utc_datetime, updated_by, updated_utc_datetime, is_more_value) SELECT uuid(), '9a55ffcb-eecd-4e4d-99f8-24c06014f506', 'start_row_index', 'int', '表头行起始下标', '表头行起始下标', '2', '0', '0', NULL, NULL, '0', NULL, NULL, NULL, NULL, '0', '1', '2023-07-03 10:13:09', NULL, NULL, NULL FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM product_sys_datamodel_field WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' and field_name='start_row_index');
INSERT INTO product_sys_datamodel_field (uuid,table_uuid, field_name, field_type, field_show_name, field_description, field_length, field_unit, is_required, is_unique, is_international, is_filter, field_format, related_table, field_reference, field_relation_table, field_sequence, created_by, created_utc_datetime, updated_by, updated_utc_datetime, is_more_value) SELECT uuid(), '9a55ffcb-eecd-4e4d-99f8-24c06014f506', 'table_name', 'string', '对应表名', '对应表名', '100', '0', '1', '0', NULL, '0', NULL, NULL, NULL, NULL, '0', NULL, NULL, '1', '2023-07-03 10:13:09', NULL FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM product_sys_datamodel_field WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' and field_name='table_name');
INSERT INTO product_sys_datamodel_field (uuid,table_uuid, field_name, field_type, field_show_name, field_description, field_length, field_unit, is_required, is_unique, is_international, is_filter, field_format, related_table, field_reference, field_relation_table, field_sequence, created_by, created_utc_datetime, updated_by, updated_utc_datetime, is_more_value) SELECT uuid(), '9a55ffcb-eecd-4e4d-99f8-24c06014f506', 'template_info', 'file', '附件表uuid', '对应附件表uuid', '80', '0', '0', '0', NULL, '0', NULL, NULL, NULL, NULL, '0', NULL, NULL, '1', '2023-07-03 10:13:09', NULL FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM product_sys_datamodel_field WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' and field_name='template_info');
INSERT INTO product_sys_datamodel_field (uuid,table_uuid, field_name, field_type, field_show_name, field_description, field_length, field_unit, is_required, is_unique, is_international, is_filter, field_format, related_table, field_reference, field_relation_table, field_sequence, created_by, created_utc_datetime, updated_by, updated_utc_datetime, is_more_value) SELECT uuid(), '9a55ffcb-eecd-4e4d-99f8-24c06014f506', 'title', 'string', '标题', '标题', '500', '0', '0', '0', NULL, '0', NULL, NULL, NULL, NULL, '0', NULL, NULL, '1', '2023-07-03 10:13:09', NULL FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM product_sys_datamodel_field WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' and field_name='title');
INSERT INTO product_sys_datamodel_field (uuid,table_uuid, field_name, field_type, field_show_name, field_description, field_length, field_unit, is_required, is_unique, is_international, is_filter, field_format, related_table, field_reference, field_relation_table, field_sequence, created_by, created_utc_datetime, updated_by, updated_utc_datetime, is_more_value) SELECT uuid(), '9a55ffcb-eecd-4e4d-99f8-24c06014f506', 'updated_by', 'int', '更新者', '更新者', '11', '0', '0', NULL, NULL, '0', NULL, NULL, 'user_name_by_user_id', NULL, '0', NULL, NULL, '1', '2023-07-03 10:13:09', NULL FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM product_sys_datamodel_field WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' and field_name='updated_by');
INSERT INTO product_sys_datamodel_field (uuid,table_uuid, field_name, field_type, field_show_name, field_description, field_length, field_unit, is_required, is_unique, is_international, is_filter, field_format, related_table, field_reference, field_relation_table, field_sequence, created_by, created_utc_datetime, updated_by, updated_utc_datetime, is_more_value) SELECT uuid(), '9a55ffcb-eecd-4e4d-99f8-24c06014f506', 'updated_utc_datetime', 'datetime', '更新时间', '更新时间', '0', '0', '0', NULL, NULL, '0', NULL, NULL, NULL, NULL, '0', NULL, NULL, '1', '2023-07-03 10:13:09', NULL FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM product_sys_datamodel_field WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' and field_name='updated_utc_datetime');
INSERT INTO product_sys_datamodel_field (uuid,table_uuid, field_name, field_type, field_show_name, field_description, field_length, field_unit, is_required, is_unique, is_international, is_filter, field_format, related_table, field_reference, field_relation_table, field_sequence, created_by, created_utc_datetime, updated_by, updated_utc_datetime, is_more_value) SELECT uuid(), '9a55ffcb-eecd-4e4d-99f8-24c06014f506', 'upload_sign', 'string', '导入唯一标识', '本次导入唯一标识', '80', '0', '1', '0', NULL, '0', NULL, NULL, NULL, NULL, '0', NULL, NULL, '1', '2023-07-03 10:13:09', NULL FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM product_sys_datamodel_field WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' and field_name='upload_sign');
INSERT INTO product_sys_datamodel_field (uuid,table_uuid, field_name, field_type, field_show_name, field_description, field_length, field_unit, is_required, is_unique, is_international, is_filter, field_format, related_table, field_reference, field_relation_table, field_sequence, created_by, created_utc_datetime, updated_by, updated_utc_datetime, is_more_value) SELECT uuid(), '9a55ffcb-eecd-4e4d-99f8-24c06014f506', 'uuid', 'string', '唯一标识', '唯一标识', '80', '0', '1', '1', NULL, '0', NULL, NULL, NULL, NULL, '0', NULL, NULL, '1', '2023-07-03 10:13:09', NULL FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM product_sys_datamodel_field WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' and field_name='uuid');
UPDATE product_sys_datamodel_field SET table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506', field_name = 'after_func', field_type = 'string', field_show_name = '保存后处理', field_description = '保存后处理方法', field_length = 200, field_unit = '0', is_required = 0, is_unique = 0, is_international = NULL, is_filter = 0, field_format = NULL, related_table = NULL, field_reference = NULL, field_relation_table = NULL, field_sequence = 0, created_by = NULL, created_utc_datetime = NULL, updated_by = '1', updated_utc_datetime = now(), is_more_value = NULL WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' AND field_name = 'after_func';
UPDATE product_sys_datamodel_field SET table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506', field_name = 'before_func', field_type = 'string', field_show_name = '保存前处理', field_description = '保存前处理方法', field_length = 200, field_unit = '0', is_required = 0, is_unique = 0, is_international = NULL, is_filter = 0, field_format = NULL, related_table = NULL, field_reference = NULL, field_relation_table = NULL, field_sequence = 0, created_by = NULL, created_utc_datetime = NULL, updated_by = '1', updated_utc_datetime = now(), is_more_value = NULL WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' AND field_name = 'before_func';
UPDATE product_sys_datamodel_field SET table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506', field_name = 'button_title', field_type = 'string', field_show_name = '按钮标题', field_description = '对应按钮标题', field_length = 200, field_unit = '0', is_required = 0, is_unique = 0, is_international = NULL, is_filter = 0, field_format = NULL, related_table = NULL, field_reference = NULL, field_relation_table = NULL, field_sequence = 0, created_by = NULL, created_utc_datetime = NULL, updated_by = '1', updated_utc_datetime = now(), is_more_value = NULL WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' AND field_name = 'button_title';
UPDATE product_sys_datamodel_field SET table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506', field_name = 'created_by', field_type = 'userid', field_show_name = '创建者', field_description = '创建者', field_length = 11, field_unit = '0', is_required = 1, is_unique = NULL, is_international = NULL, is_filter = 0, field_format = NULL, related_table = NULL, field_reference = 'user_name_by_user_id', field_relation_table = NULL, field_sequence = 0, created_by = NULL, created_utc_datetime = NULL, updated_by = '1', updated_utc_datetime = now(), is_more_value = NULL WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' AND field_name = 'created_by';
UPDATE product_sys_datamodel_field SET table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506', field_name = 'created_utc_datetime', field_type = 'datetime', field_show_name = '创建时间', field_description = '创建时间', field_length = 0, field_unit = '0', is_required = 1, is_unique = NULL, is_international = NULL, is_filter = 0, field_format = NULL, related_table = NULL, field_reference = '', field_relation_table = NULL, field_sequence = 0, created_by = NULL, created_utc_datetime = NULL, updated_by = '1', updated_utc_datetime = now(), is_more_value = NULL WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' AND field_name = 'created_utc_datetime';
UPDATE product_sys_datamodel_field SET table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506', field_name = 'function_uuid', field_type = 'string', field_show_name = '功能uuid', field_description = '对应功能uuid', field_length = 80, field_unit = '0', is_required = 0, is_unique = 0, is_international = NULL, is_filter = 0, field_format = NULL, related_table = NULL, field_reference = NULL, field_relation_table = NULL, field_sequence = 0, created_by = NULL, created_utc_datetime = NULL, updated_by = '1', updated_utc_datetime = now(), is_more_value = NULL WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' AND field_name = 'function_uuid';
UPDATE product_sys_datamodel_field SET table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506', field_name = 'id', field_type = 'pk', field_show_name = '主键', field_description = '主键', field_length = 11, field_unit = '0', is_required = 0, is_unique = NULL, is_international = NULL, is_filter = 0, field_format = NULL, related_table = NULL, field_reference = NULL, field_relation_table = NULL, field_sequence = 0, created_by = NULL, created_utc_datetime = NULL, updated_by = '1', updated_utc_datetime = now(), is_more_value = NULL WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' AND field_name = 'id';
UPDATE product_sys_datamodel_field SET table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506', field_name = 'org_level_uuid', field_type = 'orgUuid', field_show_name = '组织机构', field_description = '组织机构', field_length = 80, field_unit = '0', is_required = 1, is_unique = NULL, is_international = NULL, is_filter = 0, field_format = NULL, related_table = NULL, field_reference = 'levels', field_relation_table = NULL, field_sequence = 0, created_by = NULL, created_utc_datetime = NULL, updated_by = '1', updated_utc_datetime = now(), is_more_value = NULL WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' AND field_name = 'org_level_uuid';
UPDATE product_sys_datamodel_field SET table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506', field_name = 'sheet_order', field_type = 'int', field_show_name = 'sheet顺序', field_description = 'sheet顺序', field_length = 4, field_unit = '0', is_required = 0, is_unique = 0, is_international = NULL, is_filter = 0, field_format = NULL, related_table = NULL, field_reference = NULL, field_relation_table = NULL, field_sequence = 0, created_by = NULL, created_utc_datetime = NULL, updated_by = '1', updated_utc_datetime = now(), is_more_value = NULL WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' AND field_name = 'sheet_order';
UPDATE product_sys_datamodel_field SET table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506', field_name = 'start_row_index', field_type = 'int', field_show_name = '表头行起始下标', field_description = '表头行起始下标', field_length = 2, field_unit = '0', is_required = 0, is_unique = NULL, is_international = NULL, is_filter = 0, field_format = NULL, related_table = NULL, field_reference = NULL, field_relation_table = NULL, field_sequence = 0, created_by = '1', created_utc_datetime = '2023-07-03 10:13:09', updated_by = NULL, updated_utc_datetime = now(), is_more_value = NULL WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' AND field_name = 'start_row_index';
UPDATE product_sys_datamodel_field SET table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506', field_name = 'table_name', field_type = 'string', field_show_name = '对应表名', field_description = '对应表名', field_length = 100, field_unit = '0', is_required = 1, is_unique = 0, is_international = NULL, is_filter = 0, field_format = NULL, related_table = NULL, field_reference = NULL, field_relation_table = NULL, field_sequence = 0, created_by = NULL, created_utc_datetime = NULL, updated_by = '1', updated_utc_datetime = now(), is_more_value = NULL WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' AND field_name = 'table_name';
UPDATE product_sys_datamodel_field SET table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506', field_name = 'template_info', field_type = 'file', field_show_name = '附件表uuid', field_description = '对应附件表uuid', field_length = 80, field_unit = '0', is_required = 0, is_unique = 0, is_international = NULL, is_filter = 0, field_format = NULL, related_table = NULL, field_reference = NULL, field_relation_table = NULL, field_sequence = 0, created_by = NULL, created_utc_datetime = NULL, updated_by = '1', updated_utc_datetime = now(), is_more_value = NULL WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' AND field_name = 'template_info';
UPDATE product_sys_datamodel_field SET table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506', field_name = 'title', field_type = 'string', field_show_name = '标题', field_description = '标题', field_length = 500, field_unit = '0', is_required = 0, is_unique = 0, is_international = NULL, is_filter = 0, field_format = NULL, related_table = NULL, field_reference = NULL, field_relation_table = NULL, field_sequence = 0, created_by = NULL, created_utc_datetime = NULL, updated_by = '1', updated_utc_datetime = now(), is_more_value = NULL WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' AND field_name = 'title';
UPDATE product_sys_datamodel_field SET table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506', field_name = 'updated_by', field_type = 'int', field_show_name = '更新者', field_description = '更新者', field_length = 11, field_unit = '0', is_required = 0, is_unique = NULL, is_international = NULL, is_filter = 0, field_format = NULL, related_table = NULL, field_reference = 'user_name_by_user_id', field_relation_table = NULL, field_sequence = 0, created_by = NULL, created_utc_datetime = NULL, updated_by = '1', updated_utc_datetime = now(), is_more_value = NULL WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' AND field_name = 'updated_by';
UPDATE product_sys_datamodel_field SET table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506', field_name = 'updated_utc_datetime', field_type = 'datetime', field_show_name = '更新时间', field_description = '更新时间', field_length = 0, field_unit = '0', is_required = 0, is_unique = NULL, is_international = NULL, is_filter = 0, field_format = NULL, related_table = NULL, field_reference = NULL, field_relation_table = NULL, field_sequence = 0, created_by = NULL, created_utc_datetime = NULL, updated_by = '1', updated_utc_datetime = now(), is_more_value = NULL WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' AND field_name = 'updated_utc_datetime';
UPDATE product_sys_datamodel_field SET table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506', field_name = 'upload_sign', field_type = 'string', field_show_name = '导入唯一标识', field_description = '本次导入唯一标识', field_length = 80, field_unit = '0', is_required = 1, is_unique = 0, is_international = NULL, is_filter = 0, field_format = NULL, related_table = NULL, field_reference = NULL, field_relation_table = NULL, field_sequence = 0, created_by = NULL, created_utc_datetime = NULL, updated_by = '1', updated_utc_datetime = now(), is_more_value = NULL WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' AND field_name = 'upload_sign';
UPDATE product_sys_datamodel_field SET table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506', field_name = 'uuid', field_type = 'string', field_show_name = '唯一标识', field_description = '唯一标识', field_length = 80, field_unit = '0', is_required = 1, is_unique = 1, is_international = NULL, is_filter = 0, field_format = NULL, related_table = NULL, field_reference = NULL, field_relation_table = NULL, field_sequence = 0, created_by = NULL, created_utc_datetime = NULL, updated_by = '1', updated_utc_datetime = now(), is_more_value = NULL WHERE table_uuid = '9a55ffcb-eecd-4e4d-99f8-24c06014f506' AND field_name = 'uuid';
DELETE FROM `product_sys_datamodel_field` where table_uuid='9a55ffcb-eecd-4e4d-99f8-24c06014f506' and  DATE_FORMAT(updated_utc_datetime, '%Y-%m-%d') != DATE_FORMAT(CURDATE(), '%Y-%m-%d');
DELETE FROM `product_sys_datamodel_table_index` where table_uuid='9a55ffcb-eecd-4e4d-99f8-24c06014f506';
INSERT INTO `product_sys_datamodel_table_index` (`uuid`, `table_uuid`, `index_name`, `index_fields`, `index_type`) values ('b659ecd0-7fad-11ec-a3ed-902b3470f24e','9a55ffcb-eecd-4e4d-99f8-24c06014f506','uuid','uuid','1' );

