Commit 0fec1794 by zhouhaibao

feat(sql): 添加预警配置数据

- 插入转化率相关预警规则配置
- 插入渗透率相关预警规则配置
- 配置预警阈值计算SQL查询语句
- 设置预警规则启用状态为开启
- 定义预警规则监控指标和操作符条件
1 parent 1307066a
......@@ -169,7 +169,86 @@ INSERT INTO dj_smartcarlife.pg_warning_metric_dict (id, index_name, business_typ
(44, '生态系数', 2, '3', '车身膜', 'A0156', 'A0156', 2, NULL, 2, 'system', '2026-05-27 11:40:24', NULL, NULL, 'N'),
(45, '生态系数', 2, '3', '精品附件', 'A0158', 'A0158', 2, NULL, 2, 'system', '2026-05-27 11:40:24', NULL, NULL, 'N');
INSERT INTO pg_warning_config
(group_id, warning_type, biz, monitor_target, rule_json, is_enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES(-1, 2, 1, 2, '[{"sortNo":1,"metricId":8,"metricName":"转化率","operator":"<=","threshold":{"type":2,"value":"SELECT
e1.merchant_no as merchant_id4s,
(e1.ew_con_rate + e2.range_value) AS config_value,
e1.ew_con_rate/100 as configValueOld
FROM
early_warning_threshold_config e1
JOIN
(SELECT range_value FROM early_warning_threshold_range_config WHERE warning_type = 1 LIMIT 1) e2;","valueField":"config_value"},"nextLogic":null}]', 1, 'glsadmin', '2026-06-03 19:47:49', NULL, NULL, 'N');
INSERT INTO pg_warning_config
(group_id, warning_type, biz, monitor_target, rule_json, is_enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES(-1, 2, 1, 2, '[{"sortNo":1,"metricId":9,"metricName":"转化率","operator":"<=","threshold":{"type":2,"value":"SELECT
e1.merchant_no as merchant_id4s,
(e1.ew_axb_con_rate + e2.range_value) AS config_value,
e1.ew_axb_con_rate/100 as configValueOld
FROM
early_warning_threshold_config e1
JOIN
(SELECT range_value FROM early_warning_threshold_range_config WHERE warning_type = 1 LIMIT 1) e2;","valueField":"config_value"},"nextLogic":null}]', 1, 'glsadmin', '2026-06-03 19:47:49', NULL, NULL, 'N');
INSERT INTO pg_warning_config
(group_id, warning_type, biz, monitor_target, rule_json, is_enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES(-1, 2, 1, 2, '[{"sortNo":1,"metricId":11,"metricName":"转化率","operator":"<=","threshold":{"type":2,"value":"SELECT
e1.merchant_no as merchant_id4s,
(e1.ew_lt_con_rate + e2.range_value) AS config_value,
e1.ew_lt_con_rate/100 as configValueOld
FROM
early_warning_threshold_config e1
JOIN
(SELECT range_value FROM early_warning_threshold_range_config WHERE warning_type = 1 LIMIT 1) e2;","valueField":"config_value"},"nextLogic":null}]', 1, 'glsadmin', '2026-06-03 19:47:49', NULL, NULL, 'N');
INSERT INTO pg_warning_config
(group_id, warning_type, biz, monitor_target, rule_json, is_enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES(-1, 2, 1, 2, '[{"sortNo":1,"metricId":10,"metricName":"转化率","operator":"<=","threshold":{"type":2,"value":"SELECT
e1.merchant_no as merchant_id4s,
(e1.battery_conversion_rate + e2.range_value) AS config_value,
e1.battery_conversion_rate/100 as configValueOld
FROM
early_warning_threshold_config e1
JOIN
(SELECT range_value FROM early_warning_threshold_range_config WHERE warning_type = 1 LIMIT 1) e2;","valueField":"config_value"},"nextLogic":null}]', 1, 'glsadmin', '2026-06-03 19:47:49', NULL, NULL, 'N');
INSERT INTO pg_warning_config
(group_id, warning_type, biz, monitor_target, rule_json, is_enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES(-1, 2, 1, 2, '[{"sortNo":1,"metricId":3,"metricName":"渗透率","operator":"<=","threshold":{"type":2,"value":"SELECT
e1.merchant_no as merchant_id4s,
(e1.ew_penetration_rate + e2.range_value) AS config_value,
e1.ew_penetration_rate/100 as configValueOld
FROM
early_warning_threshold_config e1
JOIN
(SELECT range_value FROM early_warning_threshold_range_config WHERE warning_type = 1 LIMIT 1) e2;","valueField":"config_value"},"nextLogic":null}]', 1, 'glsadmin', '2026-06-03 19:47:49', NULL, NULL, 'N');
INSERT INTO pg_warning_config
(group_id, warning_type, biz, monitor_target, rule_json, is_enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES(-1, 2, 1, 2, '[{"sortNo":1,"metricId":4,"metricName":"渗透率","operator":"<=","threshold":{"type":2,"value":"SELECT
e1.merchant_no as merchant_id4s,
(e1.ew_axb_penetration_rate + e2.range_value) AS config_value,
e1.ew_axb_penetration_rate/100 as configValueOld
FROM
early_warning_threshold_config e1
JOIN
(SELECT range_value FROM early_warning_threshold_range_config WHERE warning_type = 1 LIMIT 1) e2;","valueField":"config_value"},"nextLogic":null}]', 1, 'glsadmin', '2026-06-03 19:47:49', NULL, NULL, 'N');
INSERT INTO pg_warning_config
(group_id, warning_type, biz, monitor_target, rule_json, is_enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES(-1, 2, 1, 2, '[{"sortNo":1,"metricId":6,"metricName":"渗透率","operator":"<=","threshold":{"type":2,"value":"SELECT
e1.merchant_no as merchant_id4s,
(e1.ew_lt_penetration_rate + e2.range_value) AS config_value,
e1.ew_lt_penetration_rate/100 as configValueOld
FROM
early_warning_threshold_config e1
JOIN
(SELECT range_value FROM early_warning_threshold_range_config WHERE warning_type = 1 LIMIT 1) e2;","valueField":"config_value"},"nextLogic":null}]', 1, 'glsadmin', '2026-06-03 19:47:49', NULL, NULL, 'N');
INSERT INTO pg_warning_config
(group_id, warning_type, biz, monitor_target, rule_json, is_enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES(-1, 2, 1, 2, '[{"sortNo":1,"metricId":5,"metricName":"渗透率","operator":"<=","threshold":{"type":2,"value":"SELECT
e1.merchant_no as merchant_id4s,
(e1.battery_penetration_rate + e2.range_value) AS config_value,
e1.battery_penetration_rate/100 as configValueOld
FROM
early_warning_threshold_config e1
JOIN
(SELECT range_value FROM early_warning_threshold_range_config WHERE warning_type = 1 LIMIT 1) e2;","valueField":"config_value"},"nextLogic":null}]', 1, 'glsadmin', '2026-06-03 19:47:49', NULL, NULL, 'N');
### 林永健 -----------------end-------------------
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!