Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
audit_2021
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 11e6993e
authored
May 11, 2024
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加记录仪分摊数据处理脚本
1 parent
5282dfb5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
记录仪分摊/激活/记录仪分摊数据处理sql.sql
记录仪分摊/激活/记录仪分摊数据处理sql.sql
0 → 100644
View file @
11e6993
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
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment