Commit bc703e77 by 杨卫

feat(database): 重构检测模版默认值接口数据库变更

- 重命名库文件从库名_ddl.sql到aus_ddl.sql
- 重命名库文件从库名_dml.sql到aus_dml.sql
- 为vehicle表新增IS_PURCHASED_NEW字段用于新车购买状态检测
- 更新inspection_node表设置默认值节点的node_code、default_type和exists_default_value
- 配置20个新默认值节点通过接口获取数据
- 更新已有nodeCode的历史车况和基础信息节点配置
- 实现检测模版默认值从固定值改为接口获取的数据库结构变更
1 parent 21463e67
......@@ -16,6 +16,22 @@
### 谢海旭 -----------------end---------------------
### 杨卫 -----------------start--------------------
-- ============================================================
-- 检测模版默认值接口重构 - 数据库变更脚本
-- 变更:redesign-inspection-template-default
-- 说明:
-- 1. 为新增默认值节点设置 node_code(接口 Map 的 key)、default_type=2(接口获取)、exists_default_value=1
-- 2. 已有 nodeCode 的检测项无需重新设置 node_code,仅更新 default_type、exists_default_value
-- 3. default_value 仅在固定值(default_type=1)时维护,本次全部为接口获取,不设置
-- 执行顺序:先 DDL(新增列),后 UPDATE(节点配置)
-- ============================================================
-- ----------------------------
-- 4.2 CoreSpecs 新增"是否购买新车"字段 DDL(列可空)
-- ----------------------------
ALTER TABLE `vehicle`
ADD COLUMN `IS_PURCHASED_NEW` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否购买新车:1-是/0-否,收车端 pushCarData 同步,作为检测模版"是否一手车"默认值来源';
### 杨卫 -----------------end----------------------
### 章家宝 -----------------start--------------------
......
......@@ -16,6 +16,44 @@
### 谢海旭 -----------------end---------------------
### 杨卫 -----------------start--------------------
-- ----------------------------
-- 4.1 新增默认值节点:设置 node_code、default_type=2、exists_default_value=1
-- ----------------------------
UPDATE inspection_node SET node_code = 'vehicleLicenseFront', default_type = 2, exists_default_value = '1' WHERE id = 3;
UPDATE inspection_node SET node_code = 'registrationCertificatePage1', default_type = 2, exists_default_value = '1' WHERE id = 17;
UPDATE inspection_node SET node_code = 'registrationCertificatePage2', default_type = 2, exists_default_value = '1' WHERE id = 18;
UPDATE inspection_node SET node_code = 'registrationCertificatePage3', default_type = 2, exists_default_value = '1' WHERE id = 19;
UPDATE inspection_node SET node_code = 'documentExteriorColor', default_type = 2, exists_default_value = '1' WHERE id = 21;
UPDATE inspection_node SET node_code = 'firstHandCar', default_type = 2, exists_default_value = '1' WHERE id = 24;
UPDATE inspection_node SET node_code = 'compulsoryInsurance', default_type = 2, exists_default_value = '1' WHERE id = 30;
UPDATE inspection_node SET node_code = 'commercialInsurance', default_type = 2, exists_default_value = '1' WHERE id = 38;
UPDATE inspection_node SET node_code = 'interiorColor', default_type = 2, exists_default_value = '1' WHERE id = 54;
UPDATE inspection_node SET node_code = 'leftFront45', default_type = 2, exists_default_value = '1' WHERE id = 61;
UPDATE inspection_node SET node_code = 'frontSeat', default_type = 2, exists_default_value = '1' WHERE id = 63;
UPDATE inspection_node SET node_code = 'dashboard', default_type = 2, exists_default_value = '1' WHERE id = 65;
UPDATE inspection_node SET node_code = 'rearPanorama', default_type = 2, exists_default_value = '1' WHERE id = 66;
UPDATE inspection_node SET node_code = 'fullConsolePanorama', default_type = 2, exists_default_value = '1' WHERE id = 67;
UPDATE inspection_node SET node_code = 'rightRear45', default_type = 2, exists_default_value = '1' WHERE id = 69;
UPDATE inspection_node SET node_code = 'nameplate', default_type = 2, exists_default_value = '1' WHERE id = 71;
-- ----------------------------
-- 已有 nodeCode 的检测项:仅更新 default_type、exists_default_value,不重新设置 node_code
-- 1) 历史车况与视频节点(wade/burn/accident/wholeCarAppearanceVideo/engineConditionVideo)
-- ----------------------------
UPDATE inspection_node SET default_type = 2, exists_default_value = '1' WHERE id IN (548, 549, 550, 552, 553);
-- ----------------------------
-- 2) 基础信息类已有 nodeCode 的叶子节点(参考脚本已设置 node_code,来源不变,仅出参结构调整)
-- ----------------------------
UPDATE inspection_node SET default_type = 2, exists_default_value = '1'
WHERE node_code IN (
'vin', 'licensePlate', 'usageType', 'engineNumber', 'seat',
'annualInspectionExpiry', 'handoverAddress', 'productionDate',
'compulsoryInsuranceExpiry', 'carBrand', 'carSeriesName', 'carTypeName',
'displacement', 'exteriorColor', 'keyCount', 'emissionStandard',
'registrationDate', 'mileage'
);
### 杨卫 -----------------end----------------------
### 章家宝 -----------------start--------------------
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!