Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dataquality_doc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王东
dataquality_doc
Commits
46de46a2
Commit
46de46a2
authored
Aug 26, 2022
by
王东
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
指标计算承保字段调整
parent
578b9177
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
170 additions
and
10 deletions
+170
-10
ZB_DM/承保指标/new今日签单/ZB_DM_今日签单合并_NEW.sql
ZB_DM/承保指标/new今日签单/ZB_DM_今日签单合并_NEW.sql
+1
-0
ZB_DM/承保指标/new团队汇总结果/ZB_DM_团队汇总结果_业务来源.sql
ZB_DM/承保指标/new团队汇总结果/ZB_DM_团队汇总结果_业务来源.sql
+53
-0
ZB_DM/承保指标/new团队汇总结果/ZB_DM_团队汇总结果_渠道.sql
ZB_DM/承保指标/new团队汇总结果/ZB_DM_团队汇总结果_渠道.sql
+53
-0
ZB_DM/承保指标/new团队汇总结果/ZB_DM_团队汇总结果_险种.sql
ZB_DM/承保指标/new团队汇总结果/ZB_DM_团队汇总结果_险种.sql
+8
-8
ZB_DM/承保指标/new团队汇总结果/ZB_DM_团队汇总结果_险类.sql
ZB_DM/承保指标/new团队汇总结果/ZB_DM_团队汇总结果_险类.sql
+53
-0
ZB_DM/承保指标/分渠道/ZB_DM_分渠道保费.sql
ZB_DM/承保指标/分渠道/ZB_DM_分渠道保费.sql
+2
-2
No files found.
ZB_DM/承保指标/new今日签单/ZB_DM_今日签单合并_NEW.sql
View file @
46de46a2
...
...
@@ -54,6 +54,7 @@ select
)
as
`key`
,
sum
(
cast
(
s1
.
`cost`
as
DECIMAL
(
18
,
2
)))
as
`val`
from
VIEW_ZB_DM_JRQDBF_HB_TUANDUI
s1
group
by
s1
.
`uwConclueDate`
;
...
...
ZB_DM/承保指标/new团队汇总结果/ZB_DM_团队汇总结果_业务来源.sql
0 → 100644
View file @
46de46a2
-- ZB_DM_TEAM_BUSINESS ZB_DM_团队汇总结果_业务来源
-- step1:
-- 团队汇总
INSERT
INTO
ZB_DM
.
ZB_DM_MYSQL
.
TEAM_BUSINESS
select
a1
.
`uwConclueDate`
as
`uwConclueDate`
,
a1
.
`LEVEL1COMCODE`
as
`LEVEL1COMCODE`
,
a1
.
`LEVEL2COMCODE`
as
`LEVEL2COMCODE`
,
a1
.
`LEVEL3COMCODE`
as
`LEVEL3COMCODE`
,
a1
.
`LEVEL4COMCODE`
as
`LEVEL4COMCODE`
,
a1
.
`startTime`
as
`startTime`
,
a1
.
`businessNatureCode`
as
`businessNatureCode`
,
cast
(
a1
.
`cost`
+
if
(
t1
.
cost
is
null
,
0
,
cast
(
t1
.
cost
as
decimal
(
18
,
2
)))
as
varchar
)
as
`cost`
,
a1
.
`log_time`
as
`log_time`
from
(
SELECT
s1
.
`uwConclueDate`
as
`uwConclueDate`
,
s1
.
`LEVEL1COMCODE`
as
`LEVEL1COMCODE`
,
s1
.
`LEVEL2COMCODE`
as
`LEVEL2COMCODE`
,
s1
.
`LEVEL3COMCODE`
as
`LEVEL3COMCODE`
,
s1
.
`LEVEL4COMCODE`
as
`LEVEL4COMCODE`
,
s1
.
`startTime`
as
`startTime`
,
s1
.
`businessNatureCode`
as
`businessNatureCode`
,
sum
(
cast
(
s1
.
`cost`
as
DECIMAL
(
18
,
2
)))
as
`cost`
,
cast
(
DateTimeToLongUDF
(
tumble_end
(
s1
.
row_time
,
interval
'1'
hour
)
)
as
varchar
)
as
`log_time`
,
max
(
s1
.
proctime
)
as
proctime
from
ZB_ODS
.
ZB_ODS_KAFKA
.
CBDATA
s1
where
`COMNAME`
is
not
null
and
LEFT
(
`uwConclueDate`
,
8
)
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
group
by
s1
.
`uwConclueDate`
,
s1
.
`LEVEL1COMCODE`
,
s1
.
`LEVEL2COMCODE`
,
s1
.
`LEVEL3COMCODE`
,
s1
.
`LEVEL4COMCODE`
,
s1
.
`startTime`
,
s1
.
`businessNatureCode`
,
tumble
(
s1
.
row_time
,
interval
'1'
hour
)
)
a1
left
join
ZB_DM
.
ZB_DM_MYSQL
.
TEAM_BUSINESS
for
system_time
as
of
a1
.
proctime
as
t1
on
a1
.
`uwConclueDate`
=
t1
.
`uwConclueDate`
and
a1
.
`LEVEL4COMCODE`
=
t1
.
`LEVEL4COMCODE`
and
a1
.
`startTime`
=
t1
.
`startTime`
and
a1
.
`businessNatureCode`
=
t1
.
`businessNatureCode`
;
ZB_DM/承保指标/new团队汇总结果/ZB_DM_团队汇总结果_渠道.sql
0 → 100644
View file @
46de46a2
-- ZB_DM_TEAM_CHNL ZB_DM_团队汇总结果_渠道
-- step1:
-- 团队汇总
INSERT
INTO
ZB_DM
.
ZB_DM_MYSQL
.
TEAM_CHNL
select
a1
.
`uwConclueDate`
as
`uwConclueDate`
,
a1
.
`LEVEL1COMCODE`
as
`LEVEL1COMCODE`
,
a1
.
`LEVEL2COMCODE`
as
`LEVEL2COMCODE`
,
a1
.
`LEVEL3COMCODE`
as
`LEVEL3COMCODE`
,
a1
.
`LEVEL4COMCODE`
as
`LEVEL4COMCODE`
,
a1
.
`startTime`
as
`startTime`
,
a1
.
`chnl`
as
`chnl`
,
cast
(
a1
.
`cost`
+
if
(
t1
.
cost
is
null
,
0
,
cast
(
t1
.
cost
as
decimal
(
18
,
2
)))
as
varchar
)
as
`cost`
,
a1
.
`log_time`
as
`log_time`
from
(
SELECT
s1
.
`uwConclueDate`
as
`uwConclueDate`
,
s1
.
`LEVEL1COMCODE`
as
`LEVEL1COMCODE`
,
s1
.
`LEVEL2COMCODE`
as
`LEVEL2COMCODE`
,
s1
.
`LEVEL3COMCODE`
as
`LEVEL3COMCODE`
,
s1
.
`LEVEL4COMCODE`
as
`LEVEL4COMCODE`
,
s1
.
`startTime`
as
`startTime`
,
s1
.
`chnl`
as
`chnl`
,
sum
(
cast
(
s1
.
`cost`
as
DECIMAL
(
18
,
2
)))
as
`cost`
,
cast
(
DateTimeToLongUDF
(
tumble_end
(
s1
.
row_time
,
interval
'1'
hour
)
)
as
varchar
)
as
`log_time`
,
max
(
s1
.
proctime
)
as
proctime
from
ZB_ODS
.
ZB_ODS_KAFKA
.
CBDATA
s1
where
`COMNAME`
is
not
null
and
LEFT
(
`uwConclueDate`
,
8
)
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
group
by
s1
.
`uwConclueDate`
,
s1
.
`LEVEL1COMCODE`
,
s1
.
`LEVEL2COMCODE`
,
s1
.
`LEVEL3COMCODE`
,
s1
.
`LEVEL4COMCODE`
,
s1
.
`startTime`
,
s1
.
`chnl`
,
tumble
(
s1
.
row_time
,
interval
'1'
hour
)
)
a1
left
join
ZB_DM
.
ZB_DM_MYSQL
.
TEAM_CHNL
for
system_time
as
of
a1
.
proctime
as
t1
on
a1
.
`uwConclueDate`
=
t1
.
`uwConclueDate`
and
a1
.
`LEVEL4COMCODE`
=
t1
.
`LEVEL4COMCODE`
and
a1
.
`startTime`
=
t1
.
`startTime`
and
a1
.
`chnl`
=
t1
.
`chnl`
;
ZB_DM/承保指标/new团队汇总结果/ZB_DM_团队汇总结果_险种.sql
View file @
46de46a2
...
...
@@ -13,7 +13,7 @@ select
,
a1
.
`LEVEL4COMCODE`
as
`LEVEL4COMCODE`
,
a1
.
`startTime`
as
`startTime`
,
a1
.
`risk`
as
`risk`
,
a1
.
`cost`
+
if
(
t1
.
cost
is
null
,
0
,
cast
(
t1
.
cost
as
decimal
(
18
,
2
)))
as
`cost`
,
cast
(
a1
.
`cost`
+
if
(
t1
.
cost
is
null
,
0
,
cast
(
t1
.
cost
as
decimal
(
18
,
2
)))
as
varchar
)
as
`cost`
,
a1
.
`log_time`
as
`log_time`
from
(
...
...
@@ -25,10 +25,10 @@ from (
,
s1
.
`LEVEL4COMCODE`
as
`LEVEL4COMCODE`
,
s1
.
`startTime`
as
`startTime`
,
s1
.
`risk`
as
`risk`
,
cast
(
sum
(
cast
(
s1
.
`cost`
as
DECIMAL
(
18
,
2
)))
as
varchar
)
as
`cost`
,
sum
(
cast
(
s1
.
`cost`
as
DECIMAL
(
18
,
2
)))
as
`cost`
,
cast
(
DateTimeToLongUDF
(
tumble_end
(
s1
.
row_time
,
interval
'1'
hour
)
)
as
varchar
)
as
`log_time`
,
max
(
s1
.
proctime
)
as
proctime
from
ZB_ODS
.
ZB_ODS_KAFKA
.
CBDATA
from
ZB_ODS
.
ZB_ODS_KAFKA
.
CBDATA
s1
where
`COMNAME`
is
not
null
and
LEFT
(
`uwConclueDate`
,
8
)
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
...
...
@@ -42,11 +42,11 @@ from (
,
s1
.
`risk`
,
tumble
(
s1
.
row_time
,
interval
'1'
hour
)
)
a1
left
join
ZB_DM
.
ZB_DM_MYSQL
.
TEAM_RISK
for
system_time
as
of
s
1
.
proctime
as
t1
on
s
1
.
`uwConclueDate`
=
t1
.
`uwConclueDate`
and
s
1
.
`LEVEL4COMCODE`
=
t1
.
`LEVEL4COMCODE`
and
s
1
.
`startTime`
=
t1
.
`startTime`
and
s
1
.
`risk`
=
t1
.
`risk`
left
join
ZB_DM
.
ZB_DM_MYSQL
.
TEAM_RISK
for
system_time
as
of
a
1
.
proctime
as
t1
on
a
1
.
`uwConclueDate`
=
t1
.
`uwConclueDate`
and
a
1
.
`LEVEL4COMCODE`
=
t1
.
`LEVEL4COMCODE`
and
a
1
.
`startTime`
=
t1
.
`startTime`
and
a
1
.
`risk`
=
t1
.
`risk`
;
...
...
ZB_DM/承保指标/new团队汇总结果/ZB_DM_团队汇总结果_险类.sql
0 → 100644
View file @
46de46a2
-- ZB_DM_TEAM_CLASSCODE ZB_DM_团队汇总结果_险类
-- step1:
-- 团队汇总
INSERT
INTO
ZB_DM
.
ZB_DM_MYSQL
.
TEAM_CLASSCODE
select
a1
.
`uwConclueDate`
as
`uwConclueDate`
,
a1
.
`LEVEL1COMCODE`
as
`LEVEL1COMCODE`
,
a1
.
`LEVEL2COMCODE`
as
`LEVEL2COMCODE`
,
a1
.
`LEVEL3COMCODE`
as
`LEVEL3COMCODE`
,
a1
.
`LEVEL4COMCODE`
as
`LEVEL4COMCODE`
,
a1
.
`startTime`
as
`startTime`
,
a1
.
`classcode`
as
`classcode`
,
cast
(
a1
.
`cost`
+
if
(
t1
.
cost
is
null
,
0
,
cast
(
t1
.
cost
as
decimal
(
18
,
2
)))
as
varchar
)
as
`cost`
,
a1
.
`log_time`
as
`log_time`
from
(
SELECT
s1
.
`uwConclueDate`
as
`uwConclueDate`
,
s1
.
`LEVEL1COMCODE`
as
`LEVEL1COMCODE`
,
s1
.
`LEVEL2COMCODE`
as
`LEVEL2COMCODE`
,
s1
.
`LEVEL3COMCODE`
as
`LEVEL3COMCODE`
,
s1
.
`LEVEL4COMCODE`
as
`LEVEL4COMCODE`
,
s1
.
`startTime`
as
`startTime`
,
s1
.
`classcode`
as
`classcode`
,
sum
(
cast
(
s1
.
`cost`
as
DECIMAL
(
18
,
2
)))
as
`cost`
,
cast
(
DateTimeToLongUDF
(
tumble_end
(
s1
.
row_time
,
interval
'1'
hour
)
)
as
varchar
)
as
`log_time`
,
max
(
s1
.
proctime
)
as
proctime
from
ZB_ODS
.
ZB_ODS_KAFKA
.
CBDATA
s1
where
`COMNAME`
is
not
null
and
LEFT
(
`uwConclueDate`
,
8
)
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
group
by
s1
.
`uwConclueDate`
,
s1
.
`LEVEL1COMCODE`
,
s1
.
`LEVEL2COMCODE`
,
s1
.
`LEVEL3COMCODE`
,
s1
.
`LEVEL4COMCODE`
,
s1
.
`startTime`
,
s1
.
`classcode`
,
tumble
(
s1
.
row_time
,
interval
'1'
hour
)
)
a1
left
join
ZB_DM
.
ZB_DM_MYSQL
.
TEAM_CLASSCODE
for
system_time
as
of
a1
.
proctime
as
t1
on
a1
.
`uwConclueDate`
=
t1
.
`uwConclueDate`
and
a1
.
`LEVEL4COMCODE`
=
t1
.
`LEVEL4COMCODE`
and
a1
.
`startTime`
=
t1
.
`startTime`
and
a1
.
`classcode`
=
t1
.
`classcode`
;
ZB_DM/承保指标/分渠道/ZB_DM_分渠道保费.sql
View file @
46de46a2
...
...
@@ -8,12 +8,12 @@
CREATE
TEMPORARY
VIEW
VIEW_ZB_DM_FQDBF_TUANDUI
AS
SELECT
s1
.
`uwConclueDate`
as
`uwConclueDate`
,
s1
.
`chnl`
as
`chnl`
,
s1
.
`LEVEL1COMCODE`
as
`LEVEL1COMCODE`
,
s1
.
`LEVEL2COMCODE`
as
`LEVEL2COMCODE`
,
s1
.
`LEVEL3COMCODE`
as
`LEVEL3COMCODE`
,
s1
.
`LEVEL4COMCODE`
as
`LEVEL4COMCODE`
,
s1
.
`startTime`
as
`startTime`
,
s1
.
`chnl`
as
`chnl`
,
sum
(
cast
(
s1
.
`cost`
as
DECIMAL
(
18
,
2
)))
as
`cost`
from
(
select
...
...
@@ -28,11 +28,11 @@ where s1.rownum = 1
group
by
s1
.
`uwConclueDate`
,
s1
.
`chnl`
,
s1
.
`LEVEL1COMCODE`
,
s1
.
`LEVEL2COMCODE`
,
s1
.
`LEVEL3COMCODE`
,
s1
.
`LEVEL4COMCODE`
,
s1
.
`chnl`
,
s1
.
`startTime`
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment