This commit is contained in:
2026-07-21 13:16:10 +08:00
parent f13963f5b8
commit af06f725fa
28 changed files with 406 additions and 135 deletions

View File

@@ -37,7 +37,7 @@ CREATE TABLE `blade_insurance_record` (
-- parent_id 默认挂载至 transport.sql 中的“车/船务管理”2075436235826896898
-- ----------------------------
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES
(2077610000000000001, 2075436235826896898, 'insurance_record', '保险记录', 'insurance_record', '/vehicle/insurance-record', 'iconfont iconicon_doc', 60, 1, 0, 1, '', '', 0),
(2077610000000000001, 2075436235826896898, 'insurance_record', '保险记录(OCR)', 'insurance_record', '/vehicle/insurance-record', 'iconfont iconicon_doc', 60, 1, 0, 1, '', '', 0),
(2077610000000000002, 2077610000000000001, 'insurance_record_add', '新增', 'insurance_record_add', '', '', 1, 2, 0, 1, NULL, '', 0),
(2077610000000000003, 2077610000000000001, 'insurance_record_edit', '编辑', 'insurance_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0),
(2077610000000000004, 2077610000000000001, 'insurance_record_delete', '批量删除', 'insurance_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0),

View File

@@ -29,7 +29,7 @@ CREATE TABLE `blade_mileage_record` (
-- parent_id 默认挂载至 transport.sql 中的“车/船务管理”2075436235826896898
-- ----------------------------
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES
(2077660000000000001, 2075436235826896898, 'mileage_record', '里程记录', 'mileage_record', '/vehicle/mileage-record', 'iconfont iconicon_doc', 110, 1, 0, 1, '', '', 0),
(2077660000000000001, 2075436235826896898, 'mileage_record', '里程记录(无船)', 'mileage_record', '/vehicle/mileage-record', 'iconfont iconicon_doc', 110, 1, 0, 1, '', '', 0),
(2077660000000000002, 2077660000000000001, 'mileage_record_add', '新增', 'mileage_record_add', '', '', 1, 2, 0, 1, NULL, '', 0),
(2077660000000000003, 2077660000000000001, 'mileage_record_edit', '编辑', 'mileage_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0),
(2077660000000000004, 2077660000000000001, 'mileage_record_delete', '批量删除', 'mileage_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0),

View File

@@ -0,0 +1,93 @@
/*
Navicat Premium / MySQL 5.7+
将 blade_region 的中国国家编码统一为 +86。
适用场景:
1. 旧数据使用 code = '00' 作为中国根节点;
2. 旧数据使用 code = '86' 或 parent_code / ancestors = '86'
3. 当前数据没有国家根节点,但省级数据 parent_code 已经是 '86'。
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
START TRANSACTION;
-- 1. 确保新的中国国家节点存在。
INSERT INTO `blade_region` (
`code`,
`parent_code`,
`ancestors`,
`name`,
`province_code`,
`province_name`,
`city_code`,
`city_name`,
`district_code`,
`district_name`,
`town_code`,
`town_name`,
`village_code`,
`village_name`,
`region_level`,
`sort`,
`remark`
)
SELECT
'+86',
'0',
'0',
COALESCE(
(SELECT r.`name` FROM (SELECT `code`, `name` FROM `blade_region`) r WHERE r.`code` IN ('86', '00') ORDER BY FIELD(r.`code`, '86', '00') LIMIT 1),
'中华人民共和国'
),
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
0,
1,
''
FROM DUAL
WHERE NOT EXISTS (
SELECT 1 FROM (SELECT `code` FROM `blade_region` WHERE `code` = '+86') exists_region
);
-- 2. 如果 +86 已存在,仍强制修正它的根节点关系。
UPDATE `blade_region`
SET
`parent_code` = '0',
`ancestors` = '0',
`region_level` = 0
WHERE `code` = '+86';
-- 3. 省级节点统一挂到 +86 下。
UPDATE `blade_region`
SET `parent_code` = '+86'
WHERE `parent_code` IN ('00', '86');
-- 4. ancestors 按逗号分隔 token 精确替换,避免误伤 110086 这类编码。
UPDATE `blade_region`
SET `ancestors` = TRIM(BOTH ',' FROM REPLACE(REPLACE(CONCAT(',', `ancestors`, ','), ',00,', ',+86,'), ',86,', ',+86,'))
WHERE FIND_IN_SET('00', `ancestors`) > 0
OR FIND_IN_SET('86', `ancestors`) > 0;
-- 5. 清理旧中国根节点,避免树上出现多个国家根。
DELETE FROM `blade_region`
WHERE `code` IN ('00', '86')
AND (`region_level` = 0 OR `name` IN ('中华人民共和国', '中国'));
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;
-- 验证:
-- SELECT `code`, `parent_code`, `ancestors`, `name`, `region_level` FROM `blade_region` WHERE `code` = '+86';
-- SELECT `code`, `parent_code`, `ancestors`, `name`, `region_level` FROM `blade_region` WHERE `parent_code` = '+86' ORDER BY `code` LIMIT 20;
-- SELECT `code`, `parent_code`, `ancestors`, `name` FROM `blade_region` WHERE `parent_code` IN ('00', '86') OR FIND_IN_SET('00', `ancestors`) > 0 OR FIND_IN_SET('86', `ancestors`) > 0;

View File

@@ -0,0 +1,12 @@
-- 铁路车站、空港机场补充行政区划与详细地址字段
-- 执行前请先备份数据库;如字段已存在,请跳过对应 ALTER。
ALTER TABLE `blade_railway_station`
ADD COLUMN `region_code` varchar(32) DEFAULT NULL COMMENT '行政区划编码' AFTER `city_name`,
ADD COLUMN `region_name` varchar(128) DEFAULT NULL COMMENT '行政区划' AFTER `region_code`,
ADD COLUMN `detail_address` varchar(255) DEFAULT NULL COMMENT '详细地址' AFTER `region_name`;
ALTER TABLE `blade_airport_master`
ADD COLUMN `region_code` varchar(32) DEFAULT NULL COMMENT '行政区划编码' AFTER `city_name`,
ADD COLUMN `region_name` varchar(128) DEFAULT NULL COMMENT '行政区划' AFTER `region_code`,
ADD COLUMN `detail_address` varchar(255) DEFAULT NULL COMMENT '详细地址' AFTER `region_name`;

View File

@@ -31,7 +31,7 @@ CREATE TABLE `blade_tire_replacement_record` (
-- parent_id 默认挂载至 transport.sql 中的“车/船务管理”2075436235826896898
-- ----------------------------
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES
(2077630000000000001, 2075436235826896898, 'tire_replacement_record', '换胎记录', 'tire_replacement_record', '/vehicle/tire-replacement-record', 'iconfont iconicon_doc', 80, 1, 0, 1, '', '', 0),
(2077630000000000001, 2075436235826896898, 'tire_replacement_record', '换胎记录(无船)', 'tire_replacement_record', '/vehicle/tire-replacement-record', 'iconfont iconicon_doc', 80, 1, 0, 1, '', '', 0),
(2077630000000000002, 2077630000000000001, 'tire_replacement_record_add', '新增', 'tire_replacement_record_add', '', '', 1, 2, 0, 1, NULL, '', 0),
(2077630000000000003, 2077630000000000001, 'tire_replacement_record_edit', '编辑', 'tire_replacement_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0),
(2077630000000000004, 2077630000000000001, 'tire_replacement_record_delete', '批量删除', 'tire_replacement_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0),

View File

@@ -32,6 +32,9 @@ CREATE TABLE `blade_airport_master` (
`province_name` varchar(128) DEFAULT NULL COMMENT '所属省份',
`city_code` varchar(12) DEFAULT NULL COMMENT '所属城市编码',
`city_name` varchar(128) DEFAULT NULL COMMENT '所属城市',
`region_code` varchar(32) DEFAULT NULL COMMENT '行政区划编码',
`region_name` varchar(128) DEFAULT NULL COMMENT '行政区划',
`detail_address` varchar(255) DEFAULT NULL COMMENT '详细地址',
`longitude` decimal(12,6) DEFAULT NULL COMMENT '经度',
`latitude` decimal(12,6) DEFAULT NULL COMMENT '纬度',
`data_source` varchar(20) DEFAULT '手动录入' COMMENT '数据来源',
@@ -1039,7 +1042,7 @@ INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `s
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2075438207636316165, 2075437082342301697, 'maintenance_record_export', '批量导出', 'maintenance_record_export', '', '', 1, 2, 0, 1, NULL, '', 0);
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2075444068651868162, 2075437082342301697, 'maintenance_record_list', '列表', 'maintenance_record_list', '/blade-transport/maintenance-record/list', '', 1, 2, 0, 1, NULL, '', 0);
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2075444261606629377, 2075437237678350338, 'maintenance_plan_list', '列表', 'maintenance_plan_list', '/blade-transport/maintenance-plan/list', '', 1, 2, 0, 1, NULL, '', 0);
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077610000000000001, 2075436235826896898, 'insurance_record', '保险记录', 'insurance_record', '/vehicle/insurance-record', 'iconfont iconicon_doc', 60, 1, 0, 1, '', '', 0);
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077610000000000001, 2075436235826896898, 'insurance_record', '保险记录(OCR)', 'insurance_record', '/vehicle/insurance-record', 'iconfont iconicon_doc', 60, 1, 0, 1, '', '', 0);
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077610000000000002, 2077610000000000001, 'insurance_record_add', '新增', 'insurance_record_add', '', '', 1, 2, 0, 1, NULL, '', 0);
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077610000000000003, 2077610000000000001, 'insurance_record_edit', '编辑', 'insurance_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0);
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077610000000000004, 2077610000000000001, 'insurance_record_delete', '批量删除', 'insurance_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0);
@@ -1058,7 +1061,7 @@ INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `s
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077620000000000007, 2077620000000000001, 'violation_record_template', '下载模板', 'violation_record_template', '', '', 6, 2, 0, 1, NULL, '', 0);
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077620000000000008, 2077620000000000001, 'violation_record_export', '批量导出', 'violation_record_export', '', '', 7, 2, 0, 1, NULL, '', 0);
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077620000000000009, 2077620000000000001, 'violation_record_list', '列表', 'violation_record_list', '/blade-transport/violation-record/list', '', 8, 2, 0, 1, NULL, '', 0);
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077630000000000001, 2075436235826896898, 'tire_replacement_record', '换胎记录', 'tire_replacement_record', '/vehicle/tire-replacement-record', 'iconfont iconicon_doc', 80, 1, 0, 1, '', '', 0);
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077630000000000001, 2075436235826896898, 'tire_replacement_record', '换胎记录(无船)', 'tire_replacement_record', '/vehicle/tire-replacement-record', 'iconfont iconicon_doc', 80, 1, 0, 1, '', '', 0);
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077630000000000002, 2077630000000000001, 'tire_replacement_record_add', '新增', 'tire_replacement_record_add', '', '', 1, 2, 0, 1, NULL, '', 0);
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077630000000000003, 2077630000000000001, 'tire_replacement_record_edit', '编辑', 'tire_replacement_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0);
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077630000000000004, 2077630000000000001, 'tire_replacement_record_delete', '批量删除', 'tire_replacement_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0);
@@ -1085,7 +1088,7 @@ INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `s
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077650000000000007, 2077650000000000001, 'annual_inspection_record_template', '下载模板', 'annual_inspection_record_template', '', '', 6, 2, 0, 1, NULL, '', 0);
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077650000000000008, 2077650000000000001, 'annual_inspection_record_export', '批量导出', 'annual_inspection_record_export', '', '', 7, 2, 0, 1, NULL, '', 0);
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077650000000000009, 2077650000000000001, 'annual_inspection_record_list', '列表', 'annual_inspection_record_list', '/blade-transport/annual-inspection-record/list', '', 8, 2, 0, 1, NULL, '', 0);
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077660000000000001, 2075436235826896898, 'mileage_record', '里程记录', 'mileage_record', '/vehicle/mileage-record', 'iconfont iconicon_doc', 110, 1, 0, 1, '', '', 0);
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077660000000000001, 2075436235826896898, 'mileage_record', '里程记录(无船)', 'mileage_record', '/vehicle/mileage-record', 'iconfont iconicon_doc', 110, 1, 0, 1, '', '', 0);
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077660000000000002, 2077660000000000001, 'mileage_record_add', '新增', 'mileage_record_add', '', '', 1, 2, 0, 1, NULL, '', 0);
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077660000000000003, 2077660000000000001, 'mileage_record_edit', '编辑', 'mileage_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0);
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (2077660000000000004, 2077660000000000001, 'mileage_record_delete', '批量删除', 'mileage_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0);
@@ -1414,6 +1417,9 @@ CREATE TABLE `blade_railway_station` (
`province_name` varchar(128) DEFAULT NULL COMMENT '所属省份',
`city_code` varchar(12) DEFAULT NULL COMMENT '所属城市编码',
`city_name` varchar(128) DEFAULT NULL COMMENT '所属城市',
`region_code` varchar(32) DEFAULT NULL COMMENT '行政区划编码',
`region_name` varchar(128) DEFAULT NULL COMMENT '行政区划',
`detail_address` varchar(255) DEFAULT NULL COMMENT '详细地址',
`longitude` decimal(12,6) DEFAULT NULL COMMENT '经度',
`latitude` decimal(12,6) DEFAULT NULL COMMENT '纬度',
`data_source` varchar(20) DEFAULT '手动' COMMENT '数据来源',

View File

@@ -0,0 +1,4 @@
-- 同步已初始化环境中的运输模块菜单标题
UPDATE `blade_menu` SET `name` = '保险记录(OCR)' WHERE `code` = 'insurance_record' AND `is_deleted` = 0;
UPDATE `blade_menu` SET `name` = '里程记录(无船)' WHERE `code` = 'mileage_record' AND `is_deleted` = 0;
UPDATE `blade_menu` SET `name` = '换胎记录(无船)' WHERE `code` = 'tire_replacement_record' AND `is_deleted` = 0;