Commit 11e6993e by 杨林龙

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

1 parent 5282dfb5
SELECT * FROM temp_dj_device_details_modify_serins_record_ft;
SELECT * FROM temp_dj_device_details_modify_serins_record_zj;
SELECT * FROM temp_dj_device_details_modify_serins;
-- DROP TABLE temp_dj_device_details_modify_serins;
-- 已微调 (已经核对完)
CREATE TABLE temp_dj_device_details_modify_serins LIKE dj_2021_settle_details;
INSERT INTO temp_dj_device_details_modify_serins SELECT * FROM dj_2021_settle_details;
select count(1) from dj_2021_settle_details;
select count(1) from temp_dj_device_details_modify_serins;
ALTER TABLE temp_dj_device_details_modify_serins ADD COLUMN `fentan_time` datetime DEFAULT NULL COMMENT '分摊时间' AFTER install_cost;
UPDATE temp_dj_device_details_modify_serins SET fentan_time = settle_time WHERE channel <> '渠道';
UPDATE temp_dj_device_details_modify_serins SET fentan_time = active_time WHERE channel = '渠道';
UPDATE temp_dj_device_details_modify_serins SET pk_period = 12 WHERE pk_period = 0 OR pk_period IS NULL;
UPDATE temp_dj_device_details_modify_serins SET pk_price = 0 WHERE pk_price IS NULL;
UPDATE temp_dj_device_details_modify_serins SET active_merchant = '激活客户' WHERE active_merchant IS NULL;
UPDATE temp_dj_device_details_modify_serins SET active_merchant = '激活客户' WHERE active_merchant = '';
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
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!