-- 模板树状结构更新脚本
-- 生成时间: 2025-12-09 17:39:51
-- 注意：执行前请备份数据库！

USE finyx;

START TRANSACTION;

-- ===== 层级 0 =====

-- 创建目录节点: 2-初核模版
INSERT INTO f_polic_file_config
  (id, tenant_id, parent_id, name, input_data, file_path, created_time, created_by, updated_time, updated_by, state)
VALUES (1765273080357704, 615873064429507639, NULL, '2-初核模版', NULL, NULL, NOW(), 655162080928945152, NOW(), 655162080928945152, 1);

-- ===== 层级 1 =====

-- 创建目录节点: 1.初核请示
INSERT INTO f_polic_file_config
  (id, tenant_id, parent_id, name, input_data, file_path, created_time, created_by, updated_time, updated_by, state)
VALUES (1765273080719940, 615873064429507639, 1765273080357704, '1.初核请示', NULL, NULL, NOW(), 655162080928945152, NOW(), 655162080928945152, 1);

-- 更新: 2.谈话审批 (parent_id: None -> 1765273080357704)
UPDATE f_polic_file_config
SET parent_id = 1765273080357704, updated_time = NOW(), updated_by = 655162080928945152
WHERE id = 704825582342212610 AND tenant_id = 615873064429507639;

-- 更新: 3.初核结论 (parent_id: None -> 1765273080357704)
UPDATE f_polic_file_config
SET parent_id = 1765273080357704, updated_time = NOW(), updated_by = 655162080928945152
WHERE id = 704825582342212611 AND tenant_id = 615873064429507639;

-- ===== 层级 2 =====

-- 更新: 谈话通知书 (parent_id: None -> 704825582342212610)
UPDATE f_polic_file_config
SET parent_id = 704825582342212610, updated_time = NOW(), updated_by = 655162080928945152
WHERE id = 1764836033451564 AND tenant_id = 615873064429507639;

-- 更新: 走读式谈话审批 (parent_id: None -> 704825582342212610)
UPDATE f_polic_file_config
SET parent_id = 704825582342212610, updated_time = NOW(), updated_by = 655162080928945152
WHERE id = 1764836034070056 AND tenant_id = 615873064429507639;

-- 更新: 走读式谈话流程 (parent_id: None -> 704825582342212610)
UPDATE f_polic_file_config
SET parent_id = 704825582342212610, updated_time = NOW(), updated_by = 655162080928945152
WHERE id = 1764836034052009 AND tenant_id = 615873064429507639;

-- 更新: 1.请示报告卡（XXX） (parent_id: None -> 1765273080719940)
UPDATE f_polic_file_config
SET parent_id = 1765273080719940, updated_time = NOW(), updated_by = 655162080928945152
WHERE id = 1764836033251691 AND tenant_id = 615873064429507639;

-- 更新: 2.初步核实审批表（XXX） (parent_id: None -> 1765273080719940)
UPDATE f_polic_file_config
SET parent_id = 1765273080719940, updated_time = NOW(), updated_by = 655162080928945152
WHERE id = 1764656918061150 AND tenant_id = 615873064429507639;

-- 更新: 3.附件初核方案(XXX) (parent_id: None -> 1765273080719940)
UPDATE f_polic_file_config
SET parent_id = 1765273080719940, updated_time = NOW(), updated_by = 655162080928945152
WHERE id = 1765242273284972 AND tenant_id = 615873064429507639;

-- 更新: 8-1请示报告卡（初核报告结论）  (parent_id: None -> 704825582342212611)
UPDATE f_polic_file_config
SET parent_id = 704825582342212611, updated_time = NOW(), updated_by = 655162080928945152
WHERE id = 1765242278419277 AND tenant_id = 615873064429507639;

-- 更新: 8.XXX初核情况报告 (parent_id: None -> 704825582342212611)
UPDATE f_polic_file_config
SET parent_id = 704825582342212611, updated_time = NOW(), updated_by = 655162080928945152
WHERE id = 1765242278832792 AND tenant_id = 615873064429507639;

-- ===== 层级 3 =====

-- 更新: 谈话通知书第一联 (parent_id: None -> 1764836033451564)
UPDATE f_polic_file_config
SET parent_id = 1764836033451564, updated_time = NOW(), updated_by = 655162080928945152
WHERE id = 1765242274101483 AND tenant_id = 615873064429507639;

-- 更新: 谈话通知书第三联 (parent_id: None -> 1764836033451564)
UPDATE f_polic_file_config
SET parent_id = 1764836033451564, updated_time = NOW(), updated_by = 655162080928945152
WHERE id = 1765242274109904 AND tenant_id = 615873064429507639;

-- 更新: 谈话通知书第二联 (parent_id: None -> 1764836033451564)
UPDATE f_polic_file_config
SET parent_id = 1764836033451564, updated_time = NOW(), updated_by = 655162080928945152
WHERE id = 1765242273898117 AND tenant_id = 615873064429507639;

-- 更新: 1.请示报告卡（初核谈话） (parent_id: None -> 1764836034070056)
UPDATE f_polic_file_config
SET parent_id = 1764836034070056, updated_time = NOW(), updated_by = 655162080928945152
WHERE id = 1765242274961528 AND tenant_id = 615873064429507639;

-- 更新: 2谈话审批表 (parent_id: None -> 1764836034070056)
UPDATE f_polic_file_config
SET parent_id = 1764836034070056, updated_time = NOW(), updated_by = 655162080928945152
WHERE id = 1765242275071133 AND tenant_id = 615873064429507639;

-- 更新: 3.谈话前安全风险评估表 (parent_id: None -> 1764836034070056)
UPDATE f_polic_file_config
SET parent_id = 1764836034070056, updated_time = NOW(), updated_by = 655162080928945152
WHERE id = 1765242275362306 AND tenant_id = 615873064429507639;

-- 更新: 4.谈话方案 (parent_id: None -> 1764836034070056)
UPDATE f_polic_file_config
SET parent_id = 1764836034070056, updated_time = NOW(), updated_by = 655162080928945152
WHERE id = 1765242275716334 AND tenant_id = 615873064429507639;

-- 更新: 5.谈话后安全风险评估表 (parent_id: None -> 1764836034070056)
UPDATE f_polic_file_config
SET parent_id = 1764836034070056, updated_time = NOW(), updated_by = 655162080928945152
WHERE id = 1765242275780395 AND tenant_id = 615873064429507639;

-- 更新: 1.谈话笔录 (parent_id: None -> 1764836034052009)
UPDATE f_polic_file_config
SET parent_id = 1764836034052009, updated_time = NOW(), updated_by = 655162080928945152
WHERE id = 1765242276549299 AND tenant_id = 615873064429507639;

-- 更新: 2.谈话询问对象情况摸底调查30问 (parent_id: None -> 1764836034052009)
UPDATE f_polic_file_config
SET parent_id = 1764836034052009, updated_time = NOW(), updated_by = 655162080928945152
WHERE id = 1765242276522490 AND tenant_id = 615873064429507639;

-- 更新: 3.被谈话人权利义务告知书 (parent_id: None -> 1764836034052009)
UPDATE f_polic_file_config
SET parent_id = 1764836034052009, updated_time = NOW(), updated_by = 655162080928945152
WHERE id = 1765242277165087 AND tenant_id = 615873064429507639;

-- 更新: 4.点对点交接单 (parent_id: None -> 1764836034052009)
UPDATE f_polic_file_config
SET parent_id = 1764836034052009, updated_time = NOW(), updated_by = 655162080928945152
WHERE id = 1765242276709614 AND tenant_id = 615873064429507639;

-- 更新: 5.陪送交接单（新） (parent_id: None -> 1764836034052009)
UPDATE f_polic_file_config
SET parent_id = 1764836034052009, updated_time = NOW(), updated_by = 655162080928945152
WHERE id = 1765242277149374 AND tenant_id = 615873064429507639;

-- 更新: 6.1保密承诺书（谈话对象使用-非中共党员用） (parent_id: None -> 1764836034052009)
UPDATE f_polic_file_config
SET parent_id = 1764836034052009, updated_time = NOW(), updated_by = 655162080928945152
WHERE id = 1765242277776686 AND tenant_id = 615873064429507639;

-- 更新: 6.2保密承诺书（谈话对象使用-中共党员用） (parent_id: None -> 1764836034052009)
UPDATE f_polic_file_config
SET parent_id = 1764836034052009, updated_time = NOW(), updated_by = 655162080928945152
WHERE id = 1765242277897239 AND tenant_id = 615873064429507639;

-- 更新: 7.办案人员-办案安全保密承诺书 (parent_id: None -> 1764836034052009)
UPDATE f_polic_file_config
SET parent_id = 1764836034052009, updated_time = NOW(), updated_by = 655162080928945152
WHERE id = 1765242278111656 AND tenant_id = 615873064429507639;

COMMIT;

-- 更新完成