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 e10b435f
authored
May 11, 2024
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加记录仪分摊数据处理脚本
1 parent
11e6993e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
记录仪分摊/激活/记录仪分摊数据处理sql.sql
记录仪分摊/激活/记录仪分摊数据处理sql.sql
View file @
e10b435
...
@@ -21,3 +21,17 @@ UPDATE temp_dj_device_details_modify_serins SET active_merchant = '激活客户'
...
@@ -21,3 +21,17 @@ 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
);
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
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