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
b7df161c
Commit
b7df161c
authored
Aug 03, 2022
by
胡涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
指标统计sql脚本
parent
70f661eb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
ZB_ODS/ZB_ODS_CBDATA.sql
ZB_ODS/ZB_ODS_CBDATA.sql
+5
-5
No files found.
ZB_ODS/ZB_ODS_CBDATA.sql
View file @
b7df161c
...
...
@@ -45,8 +45,8 @@ from (
,
recordClerkName
as
recordClerkName
-- 15 归属业务员名称
,
'bd'
as
flag
-- 保单或批单标记
,
proctime
as
proctime
,
ROW_NUMBER
()
OVER
(
PARTITION
BY
policyNo
,
businessOffice
,
netPremium
ORDER
BY
uwConclueDate
DESC
)
as
rownum
from
ZB_ODS
.
ZB_SOURCE_RMQ_POLICY_
SI
T
.
POLICY
-- 保单业务数据
--
,ROW_NUMBER() OVER(PARTITION BY policyNo,businessOffice,netPremium ORDER BY uwConclueDate DESC) as rownum
from
ZB_ODS
.
ZB_SOURCE_RMQ_POLICY_
UA
T
.
POLICY
-- 保单业务数据
where
`uwConclueDate`
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
union
all
...
...
@@ -67,8 +67,8 @@ from (
,
recordClerkName
as
recordClerkName
-- 15 归属业务员名称
,
'pd'
as
flag
-- 保单或批单标记
,
proctime
as
proctime
,
ROW_NUMBER
()
OVER
(
PARTITION
BY
endorseNo
,
businessOffice
,
plpEndorse
.
staCurPremiumVariation
ORDER
BY
uwConclueDate
DESC
)
as
rownum
from
ZB_ODS
.
ZB_SOURCE_RMQ_ENDOR_
SI
T
.
ENDOR
-- 批单业务数据
--
,ROW_NUMBER() OVER(PARTITION BY endorseNo,businessOffice,plpEndorse.staCurPremiumVariation ORDER BY uwConclueDate DESC) as rownum
from
ZB_ODS
.
ZB_SOURCE_RMQ_ENDOR_
UA
T
.
ENDOR
-- 批单业务数据
where
`uwConclueDate`
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
)
s1
...
...
@@ -76,7 +76,7 @@ left join ZB_ODS.ZB_ODS_MYSQL.CD_COM_ALL for system_time as of s1.proctime as t1
left
join
ZB_ODS
.
ZB_ODS_MYSQL
.
CD_NEWCHNLTYPE
for
system_time
as
of
s1
.
proctime
as
t2
on
s1
.
businessChannelCode
=
t2
.
NEWCHNLTYPE
left
join
ZB_ODS
.
ZB_ODS_MYSQL
.
CD_REALTIME_RISK
for
system_time
as
of
s1
.
proctime
as
t3
on
s1
.
productCode
=
t3
.
RISKCODE
left
join
ZB_ODS
.
ZB_ODS_MYSQL
.
CD_BUSINESSNATURE
for
system_time
as
of
s1
.
proctime
as
t4
on
s1
.
businessNatureCode
=
t4
.
CODE
where
s1
.
rownum
=
1
--
where s1.rownum = 1
;
...
...
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