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
795380f8
Commit
795380f8
authored
Sep 14, 2022
by
王东
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
指标计算承保字段调整
parent
2ab22ee2
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
19 deletions
+24
-19
ODS/DDL元数据/ENDOR.sql
ODS/DDL元数据/ENDOR.sql
+2
-1
ODS/ODS_ENDOR.sql
ODS/ODS_ENDOR.sql
+2
-1
ZB_CK/同步脚本/ZB_CK_KAFKA_ENDOR.sql
ZB_CK/同步脚本/ZB_CK_KAFKA_ENDOR.sql
+2
-0
ZB_CK/同步脚本/ZB_CK_KAFKA_POLICY.sql
ZB_CK/同步脚本/ZB_CK_KAFKA_POLICY.sql
+1
-0
ZB_ODS/ZB_ODS_CBDATA.sql
ZB_ODS/ZB_ODS_CBDATA.sql
+17
-17
No files found.
ODS/DDL元数据/ENDOR.sql
View file @
795380f8
...
@@ -103,7 +103,8 @@ ENDOR_PLCPUBLICINSURANT
...
@@ -103,7 +103,8 @@ ENDOR_PLCPUBLICINSURANT
mainSalesmanName
String
,
-- 指标新增_归属业务员名称
mainSalesmanName
String
,
-- 指标新增_归属业务员名称
coinsCode
String
,
-- 指标新增_共保标识代码 0 非共保 1,主共,2从共,车险无共保,仅有联保
coinsCode
String
,
-- 指标新增_共保标识代码 0 非共保 1,主共,2从共,车险无共保,仅有联保
coinsLinkCode
String
,
-- 指标新增_联保标志代码 0 非联保 3,主联,4从联
coinsLinkCode
String
,
-- 指标新增_联保标志代码 0 非联保 3,主联,4从联
actualId
String
-- 指标新增_唯一标识需验证
actualId
String
,
-- 指标新增_唯一标识需验证
businessNo
String
-- 业务单号
)
)
...
...
ODS/ODS_ENDOR.sql
View file @
795380f8
...
@@ -39,7 +39,8 @@ select
...
@@ -39,7 +39,8 @@ select
mainSalesmanName
,
-- 指标新增_归属业务员名称
mainSalesmanName
,
-- 指标新增_归属业务员名称
coinsCode
,
-- 指标新增_共保标识代码 0 非共保 1,主共,2从共,车险无共保,仅有联保
coinsCode
,
-- 指标新增_共保标识代码 0 非共保 1,主共,2从共,车险无共保,仅有联保
coinsLinkCode
,
-- 指标新增_联保标志代码 0 非联保 3,主联,4从联
coinsLinkCode
,
-- 指标新增_联保标志代码 0 非联保 3,主联,4从联
actualId
-- 指标新增_唯一标识需验证
actualId
,
-- 指标新增_唯一标识需验证
businessNo
-- 业务单号
from
ODS
.
SOURCE_RMQ_ENDOR_PRD
.
ENDOR
from
ODS
.
SOURCE_RMQ_ENDOR_PRD
.
ENDOR
;
;
...
...
ZB_CK/同步脚本/ZB_CK_KAFKA_ENDOR.sql
View file @
795380f8
...
@@ -27,5 +27,6 @@ select
...
@@ -27,5 +27,6 @@ select
'plcLinkBasicInformat:'
,
plcSolution
[
1
].
plcCoins
.
plcLinkBasicInformat
,
'plcLinkBasicInformat:'
,
plcSolution
[
1
].
plcCoins
.
plcLinkBasicInformat
,
',plcCoinsBasicInformation:'
,
plcSolution
[
1
].
plcCoins
.
plcCoinsBasicInformation
',plcCoinsBasicInformation:'
,
plcSolution
[
1
].
plcCoins
.
plcCoinsBasicInformation
)
as
plcSolution_plcCoins
)
as
plcSolution_plcCoins
,
businessNo
from
ZB_ODS
.
ZB_ODS_KAFKA
.
ENDOR
from
ZB_ODS
.
ZB_ODS_KAFKA
.
ENDOR
-- where LongTimeToStringUDF(uwConclueDate,'yyyyMMdd') between '20220831' and '20220902'
-- where LongTimeToStringUDF(uwConclueDate,'yyyyMMdd') between '20220831' and '20220902'
\ No newline at end of file
ZB_CK/同步脚本/ZB_CK_KAFKA_POLICY.sql
View file @
795380f8
...
@@ -27,6 +27,7 @@ select
...
@@ -27,6 +27,7 @@ select
'plcLinkBasicInformat:'
,
plcSolution
[
1
].
plcCoins
.
plcLinkBasicInformat
,
'plcLinkBasicInformat:'
,
plcSolution
[
1
].
plcCoins
.
plcLinkBasicInformat
,
',plcCoinsBasicInformation:'
,
plcSolution
[
1
].
plcCoins
.
plcCoinsBasicInformation
',plcCoinsBasicInformation:'
,
plcSolution
[
1
].
plcCoins
.
plcCoinsBasicInformation
)
as
plcSolution_plcCoins
)
as
plcSolution_plcCoins
,
businessNo
from
ZB_ODS
.
ZB_ODS_KAFKA
.
POLICY
-- 保单业务数据
from
ZB_ODS
.
ZB_ODS_KAFKA
.
POLICY
-- 保单业务数据
;
;
ZB_ODS/ZB_ODS_CBDATA.sql
View file @
795380f8
...
@@ -49,29 +49,29 @@ from (
...
@@ -49,29 +49,29 @@ from (
,
productCode
as
productCode
-- 险种代码
,
productCode
as
productCode
-- 险种代码
,
businessChannelCode
as
businessChannelCode
-- 业务渠道
,
businessChannelCode
as
businessChannelCode
-- 业务渠道
,
businessNatureCode
as
businessNatureCode
-- 业务来源
,
businessNatureCode
as
businessNatureCode
-- 业务来源
,
cast
(
cast
(
netPremium
as
decimal
(
18
,
4
))
,
cast
(
cast
(
netPremium
as
decimal
(
30
,
4
))
*
cast
(
sigAndStaExchangeRate
as
decimal
(
18
,
4
))
*
cast
(
sigAndStaExchangeRate
as
decimal
(
30
,
4
))
*
(
*
(
case
case
when
coinsCode
=
'0'
then
(
when
coinsCode
=
'0'
then
(
case
case
when
coinsLinkCode
=
'0'
then
1
-- 非共保非联保
when
coinsLinkCode
=
'0'
then
1
-- 非共保非联保
else
cast
(
JsonGetCoinsRateUDF
(
plcSolution
[
1
].
plcCoins
.
plcLinkBasicInformat
,
'coinsLinkCode'
,
coinsLinkCode
)
as
decimal
(
18
,
4
))
/
100
-- 纯联保
else
cast
(
JsonGetCoinsRateUDF
(
plcSolution
[
1
].
plcCoins
.
plcLinkBasicInformat
,
'coinsLinkCode'
,
coinsLinkCode
)
as
decimal
(
30
,
4
))
/
100
-- 纯联保
end
end
)
)
else
(
else
(
case
case
when
coinsLinkCode
=
'0'
then
cast
(
JsonGetCoinsRateUDF
(
plcSolution
[
1
].
plcCoins
.
plcCoinsBasicInformation
,
'coinsCode'
,
coinsCode
)
as
decimal
(
18
,
4
))
/
100
-- 纯共保
when
coinsLinkCode
=
'0'
then
cast
(
JsonGetCoinsRateUDF
(
plcSolution
[
1
].
plcCoins
.
plcCoinsBasicInformation
,
'coinsCode'
,
coinsCode
)
as
decimal
(
30
,
4
))
/
100
-- 纯共保
else
(
else
(
cast
(
JsonGetCoinsRateUDF
(
plcSolution
[
1
].
plcCoins
.
plcCoinsBasicInformation
,
'coinsCode'
,
coinsCode
)
as
decimal
(
18
,
4
))
/
100
cast
(
JsonGetCoinsRateUDF
(
plcSolution
[
1
].
plcCoins
.
plcCoinsBasicInformation
,
'coinsCode'
,
coinsCode
)
as
decimal
(
30
,
4
))
/
100
)
*
(
)
*
(
cast
(
JsonGetCoinsRateUDF
(
plcSolution
[
1
].
plcCoins
.
plcLinkBasicInformat
,
'coinsLinkCode'
,
coinsLinkCode
)
as
decimal
(
18
,
4
))
/
100
cast
(
JsonGetCoinsRateUDF
(
plcSolution
[
1
].
plcCoins
.
plcLinkBasicInformat
,
'coinsLinkCode'
,
coinsLinkCode
)
as
decimal
(
30
,
4
))
/
100
)
-- 即联又共
)
-- 即联又共
end
end
)
)
end
end
)
as
decimal
(
18
,
4
))
as
`cost`
-- 不含税保费
)
as
decimal
(
30
,
4
))
as
`cost`
-- 不含税保费
,
policy
No
as
`no`
-- 保单号
,
business
No
as
`no`
-- 保单号
,
case
,
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
=
'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'
when
LEFT
(
productCode
,
2
)
<>
'05'
and
(
newPolicyFlag
=
'0'
or
autoTransrenewFlag
=
'1'
or
autoTransrenewFlag
=
'4'
or
transferPolicyFlag
=
'2'
or
transrenewFlag
=
'1'
)
then
'1'
...
@@ -93,29 +93,29 @@ from (
...
@@ -93,29 +93,29 @@ from (
,
productCode
as
productCode
-- 险种代码
,
productCode
as
productCode
-- 险种代码
,
businessChannelCode
as
businessChannelCode
-- 业务渠道
,
businessChannelCode
as
businessChannelCode
-- 业务渠道
,
businessNatureCode
as
businessNatureCode
-- 业务来源
,
businessNatureCode
as
businessNatureCode
-- 业务来源
,
cast
(
cast
(
plpEndorse
.
netPremiumVariation
as
decimal
(
18
,
4
))
,
cast
(
cast
(
plpEndorse
.
netPremiumVariation
as
decimal
(
30
,
4
))
*
cast
(
sigAndStaExchangeRate
as
decimal
(
18
,
4
))
*
cast
(
sigAndStaExchangeRate
as
decimal
(
30
,
4
))
*
(
*
(
case
case
when
coinsCode
=
'0'
then
(
when
coinsCode
=
'0'
then
(
case
case
when
coinsLinkCode
=
'0'
then
1
-- 非共保非联保
when
coinsLinkCode
=
'0'
then
1
-- 非共保非联保
else
cast
(
JsonGetCoinsRateUDF
(
plcSolution
[
1
].
plcCoins
.
plcLinkBasicInformat
,
'coinsLinkCode'
,
coinsLinkCode
)
as
decimal
(
18
,
4
))
/
100
-- 纯联保
else
cast
(
JsonGetCoinsRateUDF
(
plcSolution
[
1
].
plcCoins
.
plcLinkBasicInformat
,
'coinsLinkCode'
,
coinsLinkCode
)
as
decimal
(
30
,
4
))
/
100
-- 纯联保
end
end
)
)
else
(
else
(
case
case
when
coinsLinkCode
=
'0'
then
cast
(
JsonGetCoinsRateUDF
(
plcSolution
[
1
].
plcCoins
.
plcCoinsBasicInformation
,
'coinsCode'
,
coinsCode
)
as
decimal
(
18
,
4
))
/
100
-- 纯共保
when
coinsLinkCode
=
'0'
then
cast
(
JsonGetCoinsRateUDF
(
plcSolution
[
1
].
plcCoins
.
plcCoinsBasicInformation
,
'coinsCode'
,
coinsCode
)
as
decimal
(
30
,
4
))
/
100
-- 纯共保
else
(
else
(
cast
(
JsonGetCoinsRateUDF
(
plcSolution
[
1
].
plcCoins
.
plcCoinsBasicInformation
,
'coinsCode'
,
coinsCode
)
as
decimal
(
18
,
4
))
/
100
cast
(
JsonGetCoinsRateUDF
(
plcSolution
[
1
].
plcCoins
.
plcCoinsBasicInformation
,
'coinsCode'
,
coinsCode
)
as
decimal
(
30
,
4
))
/
100
)
*
(
)
*
(
cast
(
JsonGetCoinsRateUDF
(
plcSolution
[
1
].
plcCoins
.
plcLinkBasicInformat
,
'coinsLinkCode'
,
coinsLinkCode
)
as
decimal
(
18
,
4
))
/
100
cast
(
JsonGetCoinsRateUDF
(
plcSolution
[
1
].
plcCoins
.
plcLinkBasicInformat
,
'coinsLinkCode'
,
coinsLinkCode
)
as
decimal
(
30
,
4
))
/
100
)
-- 即联又共
)
-- 即联又共
end
end
)
)
end
end
)
as
decimal
(
18
,
4
))
as
`cost`
-- 不含税保费
)
as
decimal
(
30
,
4
))
as
`cost`
-- 不含税保费
,
endorse
No
as
`no`
-- 批单号
,
business
No
as
`no`
-- 批单号
,
case
,
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
=
'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'
when
LEFT
(
productCode
,
2
)
<>
'05'
and
(
newPolicyFlag
=
'0'
or
autoTransrenewFlag
=
'1'
or
autoTransrenewFlag
=
'4'
or
transferPolicyFlag
=
'2'
or
transrenewFlag
=
'1'
)
then
'1'
...
@@ -127,7 +127,7 @@ from (
...
@@ -127,7 +127,7 @@ from (
from
ZB_ODS
.
ZB_ODS_KAFKA
.
ENDOR
-- 批单业务数据
from
ZB_ODS
.
ZB_ODS_KAFKA
.
ENDOR
-- 批单业务数据
where
LongTimeToStringUDF
(
endorsePolicyTime
,
'yyyyMMdd'
)
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
where
LongTimeToStringUDF
(
endorsePolicyTime
,
'yyyyMMdd'
)
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
and
cast
(
plpEndorse
.
netPremiumVariation
as
decimal
(
18
,
4
))
<>
0
and
cast
(
plpEndorse
.
netPremiumVariation
as
decimal
(
30
,
4
))
<>
0
)
s1
)
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_COM_ALL
for
system_time
as
of
s1
.
proctime
as
t1
on
s1
.
businessOffice
=
t1
.
COMCODE
...
...
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