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
d3724e4a
Commit
d3724e4a
authored
Aug 01, 2022
by
王东
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整指标计算目标表
parent
27f0539e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
58 deletions
+34
-58
ZB_ODS/DDL元数据/ENDOR.sql
ZB_ODS/DDL元数据/ENDOR.sql
+0
-0
ZB_ODS/DDL元数据/POLICY.sql
ZB_ODS/DDL元数据/POLICY.sql
+0
-0
ZB_ODS/ZB_ODS_CBDATA.sql
ZB_ODS/ZB_ODS_CBDATA.sql
+4
-4
ZB_ODS/ZB_ODS_LPDATA.sql
ZB_ODS/ZB_ODS_LPDATA.sql
+30
-54
数据模型表定义.xlsx
数据模型表定义.xlsx
+0
-0
No files found.
ZB_ODS/DDL元数据/
(test)
ENDOR.sql
→
ZB_ODS/DDL元数据/ENDOR.sql
View file @
d3724e4a
File moved
ZB_ODS/DDL元数据/
(test)
POLICY.sql
→
ZB_ODS/DDL元数据/POLICY.sql
View file @
d3724e4a
File moved
ZB_ODS/ZB_ODS_CBDATA.sql
View file @
d3724e4a
...
...
@@ -37,14 +37,14 @@ from (
,
businessNatureCode
as
businessNatureCode
-- 业务来源
,
netPremium
as
netPremium
-- 不含税保费
,
policyNo
as
policyNo
-- 保单号
,
'bd'
as
flag
-- 保单或批单标记
,
proctime
as
proctime
,
case
when
LEFT
(
productCode
,
2
)
=
'05'
and
(
newPolicyFlag
=
'1'
or
autoTransrenewFlag
=
'1'
or
autoTransrenewFlag
=
'4'
or
transferPolicyFlag
=
'1'
or
transrenewFlag
=
'1'
or
transrenewFlag
=
'4'
)
then
'1'
when
LEFT
(
productCode
,
2
)
<>
'05'
and
(
newPolicyFlag
=
'0'
or
autoTransrenewFlag
=
'1'
or
autoTransrenewFlag
=
'4'
or
transferPolicyFlag
=
'2'
or
transrenewFlag
=
'1'
)
then
'1'
else
'0'
end
as
xxzflag
-- 新续转标记 1是0否
,
recordClerkCode
as
recordClerkCode
-- 14 归属业务员ID
,
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_SIT
.
POLICY
-- 保单业务数据
where
`uwConclueDate`
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
...
...
@@ -59,14 +59,14 @@ from (
,
businessNatureCode
as
businessNatureCode
-- 业务来源
,
plpEndorse
.
staCurPremiumVariation
as
netPremium
-- 不含税保费 ??
,
endorseNo
as
policyNo
-- 批单号
,
'pd'
as
flag
-- 保单或批单标记
,
proctime
as
proctime
,
case
when
LEFT
(
productCode
,
2
)
=
'05'
and
(
newPolicyFlag
=
'1'
or
autoTransrenewFlag
=
'1'
or
autoTransrenewFlag
=
'4'
or
transferPolicyFlag
=
'1'
or
transrenewFlag
=
'1'
or
transrenewFlag
=
'4'
)
then
'1'
when
LEFT
(
productCode
,
2
)
<>
'05'
and
(
newPolicyFlag
=
'0'
or
autoTransrenewFlag
=
'1'
or
autoTransrenewFlag
=
'4'
or
transferPolicyFlag
=
'2'
or
transrenewFlag
=
'1'
)
then
'1'
else
'0'
end
as
xxzflag
-- 新续转标记 1是0否
,
recordClerkCode
as
recordClerkCode
-- 14 归属业务员ID
,
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_SIT
.
ENDOR
-- 批单业务数据
where
`uwConclueDate`
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
...
...
ZB_ODS/ZB_ODS_LPDATA.sql
View file @
d3724e4a
...
...
@@ -2,8 +2,6 @@
insert
into
ZB_ODS
.
ZB_ODS_KAFKA
.
LPDATA
select
,
s1
.
businessOffice
as
`COMCODE`
--
,
t1
.
COMNAME
as
`COMNAME`
--
,
t1
.
LEVEL1COMCODE
as
`LEVEL1COMCODE`
--
...
...
@@ -22,73 +20,51 @@ select
,
t4
.
CODEDESC
as
`businessNatureName`
--
,
s1
.
businessChannelCode
as
`chnl`
-- 业务渠道
,
t2
.
NEWCHNLTYPEDESC
as
`chnlname`
--
,
s1
.
netPremium
as
`cost`
-- 不含税保费
,
s1
.
policyNo
as
`no`
-- 保单号
,
s1
.
xxzflag
as
xxzflag
-- 新续转标记 1是0否
,
s1
.
recordClerkCode
as
`id`
-- 14 归属业务员ID
,
s1
.
recordClerkName
as
`name`
-- 15 归属业务员名称
,
s1
.
cladate
as
`cladate`
-- 立案日期
,
s1
.
setdate
as
`setdate`
-- 结案日期/估损调整日期
,
s1
.
cost
as
`cost`
-- 已决赔款金额/估损提转差
,
s1
.
lossamout
as
`lossamout`
-- 估损金额
,
s1
.
flag
as
`flag`
-- 类型
,
s1
.
claimno
as
`claimno`
-- 赔案号
,
s1
.
no
as
`no`
-- 保单号
from
(
select
机构
险种
业务来源
渠道
立案日期
估损调整日期
估损提转差
估损金额
类型
赔案号
保单号
,
businessOffice
as
businessOffice
-- 保单归属机构代码
,
productCode
as
productCode
-- 险种代码
,
businessChannelCode
as
businessChannelCode
-- 业务渠道
,
businessOffice
as
businessOffice
-- 机构
,
productCode
as
productCode
-- 险种
,
businessNatureCode
as
businessNatureCode
-- 业务来源
,
netPremium
as
netPremium
-- 不含税保费
,
policyNo
as
policyNo
-- 保单号
,
'bd'
as
flag
-- 保单或批单标记
,
businessChannelCode
as
businessChannelCode
-- 渠道
,
cladate
as
cladate
-- 立案日期
,
setdate
as
setdate
-- 结案日期
,
cost
as
cost
-- 已决赔款金额
,
lossamout
as
lossamout
-- 估损金额
,
flag
as
flag
-- 类型
,
claimno
as
claimno
-- 赔案号
,
no
as
no
-- 保单号
,
proctime
as
proctime
,
case
when
LEFT
(
productCode
,
2
)
=
'05'
and
(
newPolicyFlag
=
'1'
or
autoTransrenewFlag
=
'1'
or
autoTransrenewFlag
=
'4'
or
transferPolicyFlag
=
'1'
or
transrenewFlag
=
'1'
or
transrenewFlag
=
'4'
)
then
'1'
when
LEFT
(
productCode
,
2
)
<>
'05'
and
(
newPolicyFlag
=
'0'
or
autoTransrenewFlag
=
'1'
or
autoTransrenewFlag
=
'4'
or
transferPolicyFlag
=
'2'
or
transrenewFlag
=
'1'
)
then
'1'
else
'0'
end
as
xxzflag
-- 新续转标记 1是0否
,
recordClerkCode
as
recordClerkCode
-- 14 归属业务员ID
,
recordClerkName
as
recordClerkName
-- 15 归属业务员名称
,
ROW_NUMBER
()
OVER
(
PARTITION
BY
policyNo
,
businessOffice
,
netPremium
ORDER
BY
uwConclueDate
DESC
)
as
rownum
from
ZB_ODS
.
ZB_SOURCE_RMQ_POLICY_SIT
.
POLICY
-- 保单业务数据
where
`uwConclueDate`
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
from
ZB_ODS
.
ZB_SOURCE_KAFKA_YJPK
.
YJPK
-- 保单业务数据
union
all
select
LongTimeToStringUDF
(
policyCreatDate
,
'yyyyMMdd'
)
as
uwConclueDate
-- 核保通过时间 ??
,
LongTimeToStringUDF
(
endorseEffectiveTime
,
'yyyyMMdd'
)
as
startTime
-- 起保时间
,
businessOffice
as
businessOffice
-- 保单归属机构代码
,
productCode
as
productCode
-- 险种代码
,
businessChannelCode
as
businessChannelCode
-- 业务渠道
,
businessOffice
as
businessOffice
-- 机构
,
productCode
as
productCode
-- 险种
,
businessNatureCode
as
businessNatureCode
-- 业务来源
,
plpEndorse
.
staCurPremiumVariation
as
netPremium
-- 不含税保费 ??
,
endorseNo
as
policyNo
-- 批单号
,
'pd'
as
flag
-- 保单或批单标记
,
businessChannelCode
as
businessChannelCode
-- 渠道
,
cladate
as
cladate
-- 立案日期
,
setdate
as
setdate
-- 估损调整日期
,
cost
as
cost
-- 估损提转差
,
lossamout
as
lossamout
-- 估损金额
,
flag
as
flag
-- 类型
,
claimno
as
claimno
-- 赔案号
,
no
as
no
-- 保单号
,
proctime
as
proctime
,
case
when
LEFT
(
productCode
,
2
)
=
'05'
and
(
newPolicyFlag
=
'1'
or
autoTransrenewFlag
=
'1'
or
autoTransrenewFlag
=
'4'
or
transferPolicyFlag
=
'1'
or
transrenewFlag
=
'1'
or
transrenewFlag
=
'4'
)
then
'1'
when
LEFT
(
productCode
,
2
)
<>
'05'
and
(
newPolicyFlag
=
'0'
or
autoTransrenewFlag
=
'1'
or
autoTransrenewFlag
=
'4'
or
transferPolicyFlag
=
'2'
or
transrenewFlag
=
'1'
)
then
'1'
else
'0'
end
as
xxzflag
-- 新续转标记 1是0否
,
recordClerkCode
as
recordClerkCode
-- 14 归属业务员ID
,
recordClerkName
as
recordClerkName
-- 15 归属业务员名称
,
ROW_NUMBER
()
OVER
(
PARTITION
BY
endorseNo
,
businessOffice
,
plpEndorse
.
staCurPremiumVariation
ORDER
BY
uwConclueDate
DESC
)
as
rownum
from
ZB_ODS
.
ZB_SOURCE_RMQ_ENDOR_SIT
.
ENDOR
-- 批单业务数据
where
`uwConclueDate`
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
from
ZB_ODS
.
ZB_SOURCE_KAFKA_WJPK
.
WJPK
-- 批单业务数据
)
s1
left
join
ZB_ODS
.
ZB_ODS_MYSQL
.
CD_COM_ALL
for
system_time
as
of
s1
.
proctime
as
t1
on
s1
.
businessOffice
=
t1
.
COMCODE
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
;
...
...
数据模型表定义.xlsx
View file @
d3724e4a
No preview for this file type
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