Commit e10b435f by 杨林龙

添加记录仪分摊数据处理脚本

1 parent 11e6993e
...@@ -20,4 +20,18 @@ UPDATE temp_dj_device_details_modify_serins SET active_merchant = '激活客户' ...@@ -20,4 +20,18 @@ UPDATE temp_dj_device_details_modify_serins SET active_merchant = '激活客户'
SELECT * FROM temp_dj_device_details_modify_serins; SELECT * FROM temp_dj_device_details_modify_serins;
SELECT min(settle_time) FROM temp_dj_device_details_modify_serins WHERE `device_type` IN (6,12501);
\ No newline at end of file \ No newline at end of file
SELECT min(settle_time) FROM temp_dj_device_details_modify_serins WHERE `device_type` IN (6,12501);
统计在线激活客户
set @yearStart = '2022-01-01';
set @yearEnd = '2023-01-01';
SELECT count(DISTINCT active_merchant) from dj_2021_settle_details where active_merchant <> '' and
((active_time < @yearStart and DATE_ADD(active_time,INTERVAL pk_period MONTH) > @yearEnd) or
active_time >= @yearStart and active_time < @yearEnd);
统计在线设备数
SELECT count(1)
FROM dj_2021_settle_details d LEFT JOIN dj_system_merchant dsm ON d.active_merchant =dsm.merchant_name
WHERE active_merchant <> '' AND dsm.`merchant_id` IS NOT NULL AND
((active_time < '2023-01-01 00:00:00' AND DATE_ADD(active_time,INTERVAL pk_period MONTH) > '2023-01-01 00:00:00') OR
(active_time >= '2023-01-01 00:00:00' AND active_time < '2023-01-31 23:59:59'));
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!