Commit c7925237 by zhouhaibao

feat(scrm): 更新智能汽车生活数据模型字段映射

- 修改 DELIVERY_DATE 的 date_column 从 delivery_date 到 deliveryDate
- 调整车辆品牌车系字段映射,将 car_brand 和 car_series 替换为 ID 字段
- 新增 carBrandName 和 carSeriesName 字段以保持名称信息
- 更新 carBrand 和 carSeries 消息变量的快照字段映射
- 移除营销活动产品查询中的 is_main_push 筛选条件
- 优化营销活动产品查询逻辑以支持更灵活的产品匹配
- 更新多个记录的更新时间戳以反映最新的修改状态
1 parent f40b3088
......@@ -2,7 +2,6 @@
### 叶立庆 -----------------end---------------------
### 周海宝 -----------------start-------------------
INSERT INTO sop_strategy_meta_condition_variable
(variable_code, variable_name, variable_type, step2_available, step3_available, value_logic, sql_fragment, enum_data_source, rop_api_method, sort_order, status, deleted_flag, created_by, created_date, updated_by, updated_date, rop_api_res_param)
VALUES('triggerDate', '策略实际触发日期', 3, 1, 1, '目标客户当前策略实际触发日期', NULL, NULL, NULL, 1, 1, 'N', NULL, '2026-06-17 09:45:24', NULL, '2026-06-24 21:42:31', NULL);
......@@ -39,12 +38,9 @@ VALUES('finishedProductCategory', '客户成交产品品类', 4, 0, 1, '目标
INSERT INTO sop_strategy_meta_condition_variable
(variable_code, variable_name, variable_type, step2_available, step3_available, value_logic, sql_fragment, enum_data_source, rop_api_method, sort_order, status, deleted_flag, created_by, created_date, updated_by, updated_date, rop_api_res_param)
VALUES('customerCategory', '客户分类', 4, 0, 1, '目标客户的客户画像中被划分的客户分类', 'ci.customer_category', '固定选项', NULL, 12, 1, 'N', NULL, '2026-06-17 09:45:24', NULL, '2026-06-23 15:45:50', NULL);
INSERT INTO sop_strategy_meta_date_variable
(date_code, date_name, date_desc, date_column, sort_order, status, deleted_flag, created_by, created_date, updated_by, updated_date, stage_code)
VALUES('DELIVERY_DATE', '客户新车交付日期', '客户新车交付日期作为触发基准日期', 'delivery_date', 2, 1, 'N', NULL, '2026-06-17 11:28:22', NULL, '2026-06-23 11:16:33', 'AFTER_DELIVERY');
VALUES('DELIVERY_DATE', '客户新车交付日期', '客户新车交付日期作为触发基准日期', 'deliveryDate', 2, 1, 'N', NULL, '2026-06-17 11:28:22', NULL, '2026-06-25 18:57:27', 'AFTER_DELIVERY');
INSERT INTO sop_strategy_meta_enum_value
(variable_code, enum_code, enum_name, enum_value, sort_order, status, deleted_flag, created_by, created_date, updated_by, updated_date)
......@@ -81,8 +77,10 @@ SELECT
ci.advance_user_id AS staffUuid,
ci.advance_user_name AS staffName,
NULL AS customer_category,
ci.car_brand as carBrand,
ci.car_series_name AS carSeries,
ci.car_brand_id as carBrand,
ci.car_series_id AS carSeries,
ci.car_brand as carBrandName,
ci.car_series_name as carSeriesName,
-- 1. 客户车系等级 (INIT_D1)
(SELECT GROUP_CONCAT(DISTINCT enum_code)
......@@ -172,8 +170,7 @@ WHERE ci.id = ? AND ci.deleted_flag = ''N''
', 2, 1, 'N', NULL, '2026-06-21 10:07:43', NULL, '2026-06-24 19:52:24');
', 2, 1, 'N', NULL, '2026-06-21 10:07:43', NULL, '2026-06-29 15:57:28');
INSERT INTO sop_strategy_meta_message_variable
(variable_code, variable_name, data_source, snapshot_field, sql_query, date_format, value_type, default_value, sort_order, status, deleted_flag, created_by, created_date, updated_by, updated_date)
......@@ -195,10 +192,10 @@ INSERT INTO sop_strategy_meta_message_variable
VALUES('customerName', '客户姓名', 'SNAPSHOT', 'customerName', NULL, NULL, 'STRING', '', 6, 1, 'N', NULL, '2026-06-17 16:01:33', NULL, '2026-06-17 16:01:33');
INSERT INTO sop_strategy_meta_message_variable
(variable_code, variable_name, data_source, snapshot_field, sql_query, date_format, value_type, default_value, sort_order, status, deleted_flag, created_by, created_date, updated_by, updated_date)
VALUES('carBrand', '客户新车品牌', 'SNAPSHOT', 'carBrand', NULL, NULL, 'STRING', '', 7, 1, 'N', NULL, '2026-06-17 16:01:33', NULL, '2026-06-17 16:01:33');
VALUES('carBrand', '客户新车品牌', 'SNAPSHOT', 'carBrandName', NULL, NULL, 'STRING', '', 7, 1, 'N', NULL, '2026-06-17 16:01:33', NULL, '2026-06-29 15:59:04');
INSERT INTO sop_strategy_meta_message_variable
(variable_code, variable_name, data_source, snapshot_field, sql_query, date_format, value_type, default_value, sort_order, status, deleted_flag, created_by, created_date, updated_by, updated_date)
VALUES('carSeries', '客户新车车系', 'SNAPSHOT', 'carSeries', NULL, NULL, 'STRING', '', 8, 1, 'N', NULL, '2026-06-17 16:01:33', NULL, '2026-06-17 16:01:33');
VALUES('carSeries', '客户新车车系', 'SNAPSHOT', 'carSeriesName', NULL, NULL, 'STRING', '', 8, 1, 'N', NULL, '2026-06-17 16:01:33', NULL, '2026-06-29 15:59:04');
INSERT INTO sop_strategy_meta_message_variable
(variable_code, variable_name, data_source, snapshot_field, sql_query, date_format, value_type, default_value, sort_order, status, deleted_flag, created_by, created_date, updated_by, updated_date)
VALUES('unfinishedProductCategory', '客户未成交产品分类', 'SNAPSHOT', 'unfinishedProductCategoryNames', NULL, NULL, 'STRING', '', 9, 1, 'N', NULL, '2026-06-17 16:01:33', NULL, '2026-06-23 18:07:48');
......@@ -209,9 +206,9 @@ left join dj_marketing_activity_product p on a.id =p.activity_id
left join dj_marketing_activity_product_item it on p.id =it.activity_product_id
where p.deleted_flag = "N" and a.deleted_flag = "N"
and a.status = 1
and p.is_main_push = 1 and (p.goods_type_name = ${topUnfinishedProductCategoryName} or it.goods_type_name = ${topUnfinishedProductCategoryName})
and (p.goods_type_name = ${topUnfinishedProductCategoryName} or it.goods_type_name = ${topUnfinishedProductCategoryName})
order by a.created_date desc,p.sort_order
limit 1;', NULL, 'STRING', '', 10, 1, 'N', NULL, '2026-06-17 16:01:33', NULL, '2026-06-25 13:19:36');
limit 1;', NULL, 'STRING', '', 10, 1, 'N', NULL, '2026-06-17 16:01:33', NULL, '2026-06-26 09:34:29');
INSERT INTO sop_strategy_meta_message_variable
(variable_code, variable_name, data_source, snapshot_field, sql_query, date_format, value_type, default_value, sort_order, status, deleted_flag, created_by, created_date, updated_by, updated_date)
VALUES('unfinishedProductPackagePrice', '客户未成交产品分类主推套餐/产品优惠价', 'SQL', NULL, 'select p.discount_price from dj_marketing_activity a
......@@ -219,14 +216,16 @@ left join dj_marketing_activity_product p on a.id =p.activity_id
left join dj_marketing_activity_product_item it on p.id =it.activity_product_id
where p.deleted_flag = "N" and a.deleted_flag = "N"
and a.status = 1
and p.is_main_push = 1 and (p.goods_type_name = ${topUnfinishedProductCategoryName} or it.goods_type_name = ${topUnfinishedProductCategoryName})
and (p.goods_type_name = ${topUnfinishedProductCategoryName} or it.goods_type_name = ${topUnfinishedProductCategoryName})
order by a.created_date desc,p.sort_order
limit 1;', NULL, 'STRING', '', 11, 1, 'N', NULL, '2026-06-17 16:01:33', NULL, '2026-06-25 13:16:57');
limit 1;', NULL, 'STRING', '', 11, 1, 'N', NULL, '2026-06-17 16:01:33', NULL, '2026-06-26 09:34:29');
INSERT INTO sop_strategy_meta_trigger
(trigger_code, trigger_name, trigger_desc, sort_order, status, deleted_flag, created_by, created_date, updated_by, updated_date)
VALUES('DATE_TIME', '到达特定日期时间', '到达指定日期时间时触发', 2, 1, 'N', NULL, '2026-06-16 16:38:01', NULL, '2026-06-16 16:38:01');
VALUES('DATE_TIME', '到达特定日期时间时', '到达指定日期时间时触发', 2, 1, 'N', NULL, '2026-06-16 16:38:01', NULL, '2026-06-25 18:32:22');
### 周海宝 -----------------end---------------------
### 范富荣 -----------------start-------------------
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!