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
2ab22ee2
Commit
2ab22ee2
authored
Sep 13, 2022
by
胡涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
指标统计sql脚本
parent
da67f973
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
13 deletions
+19
-13
ZB_CK/同步脚本/ZB_CK_KAFKA_ENDOR.sql
ZB_CK/同步脚本/ZB_CK_KAFKA_ENDOR.sql
+7
-3
ZB_CK/同步脚本/ZB_CK_KAFKA_POLICY.sql
ZB_CK/同步脚本/ZB_CK_KAFKA_POLICY.sql
+6
-4
ZB_ODS/ZB_ODS_CBDATA.sql
ZB_ODS/ZB_ODS_CBDATA.sql
+6
-6
No files found.
ZB_CK/同步脚本/ZB_CK_KAFKA_ENDOR.sql
View file @
2ab22ee2
...
...
@@ -12,7 +12,7 @@ select
,
coinsCode
as
coinsCode
,
coinsLinkCode
as
coinsLinkCode
,
JsonGetCoinsRateUDF
(
plcSolution
[
1
].
plcCoins
.
plcLinkBasicInformat
,
'coinsLinkCode'
,
coinsLinkCode
)
as
LinkCoinsRate
,
sonGetCoinsRateUDF
(
plcSolution
[
1
].
plcCoins
.
plcCoinsBasicInformation
,
'coinsCode'
,
coinsCode
)
as
CoinsCoinsRate
,
J
sonGetCoinsRateUDF
(
plcSolution
[
1
].
plcCoins
.
plcCoinsBasicInformation
,
'coinsCode'
,
coinsCode
)
as
CoinsCoinsRate
,
endorseNo
as
endorseNo
-- 批单号
,
newPolicyFlag
as
newPolicyFlag
,
autoTransrenewFlag
as
autoTransrenewFlag
...
...
@@ -23,6 +23,9 @@ select
,
log_time
as
log_time
,
endorsePolicyTime
as
long_endorsePolicyTime
,
endorseTime
as
long_endorseTime
,
plcSolution
[
1
].
plcCoins
as
plcSolution_plcCoins
from
ODS
.
ODS_KAFKA
.
ENDOR
,
ConcatObjUDF
(
'plcLinkBasicInformat:'
,
plcSolution
[
1
].
plcCoins
.
plcLinkBasicInformat
,
',plcCoinsBasicInformation:'
,
plcSolution
[
1
].
plcCoins
.
plcCoinsBasicInformation
)
as
plcSolution_plcCoins
from
ZB_ODS
.
ZB_ODS_KAFKA
.
ENDOR
-- where LongTimeToStringUDF(uwConclueDate,'yyyyMMdd') between '20220831' and '20220902'
\ No newline at end of file
ZB_CK/同步脚本/ZB_CK_KAFKA_POLICY.sql
View file @
2ab22ee2
...
...
@@ -12,7 +12,7 @@ select
,
coinsCode
as
coinsCode
,
coinsLinkCode
as
coinsLinkCode
,
JsonGetCoinsRateUDF
(
plcSolution
[
1
].
plcCoins
.
plcLinkBasicInformat
,
'coinsLinkCode'
,
coinsLinkCode
)
as
LinkCoinsRate
,
sonGetCoinsRateUDF
(
plcSolution
[
1
].
plcCoins
.
plcCoinsBasicInformation
,
'coinsCode'
,
coinsCode
)
as
CoinsCoinsRate
,
J
sonGetCoinsRateUDF
(
plcSolution
[
1
].
plcCoins
.
plcCoinsBasicInformation
,
'coinsCode'
,
coinsCode
)
as
CoinsCoinsRate
,
policyNo
as
policyNo
-- 保单号
,
newPolicyFlag
as
newPolicyFlag
,
autoTransrenewFlag
as
autoTransrenewFlag
...
...
@@ -23,8 +23,10 @@ select
,
log_time
as
log_time
,
signDate
as
long_signDate
,
startTime
as
long_startTime
,
plcSolution
[
1
].
plcCoins
as
plcSolution_plcCoins
from
ODS
.
ODS_KAFKA
.
POLICY
-- 保单业务数据
,
ConcatObjUDF
(
'plcLinkBasicInformat:'
,
plcSolution
[
1
].
plcCoins
.
plcLinkBasicInformat
,
',plcCoinsBasicInformation:'
,
plcSolution
[
1
].
plcCoins
.
plcCoinsBasicInformation
)
as
plcSolution_plcCoins
from
ZB_ODS
.
ZB_ODS_KAFKA
.
POLICY
-- 保单业务数据
;
ZB_ODS/ZB_ODS_CBDATA.sql
View file @
2ab22ee2
...
...
@@ -49,7 +49,7 @@ from (
,
productCode
as
productCode
-- 险种代码
,
businessChannelCode
as
businessChannelCode
-- 业务渠道
,
businessNatureCode
as
businessNatureCode
-- 业务来源
,
cast
(
netPremium
as
decimal
(
18
,
4
))
,
cast
(
cast
(
netPremium
as
decimal
(
18
,
4
))
*
cast
(
sigAndStaExchangeRate
as
decimal
(
18
,
4
))
*
(
case
...
...
@@ -70,7 +70,7 @@ from (
end
)
end
)
as
`cost`
-- 不含税保费
)
as
decimal
(
18
,
4
))
as
`cost`
-- 不含税保费
,
policyNo
as
`no`
-- 保单号
,
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'
...
...
@@ -80,7 +80,7 @@ from (
,
mainSalesmanName
as
`name`
-- 15 归属业务员名称
,
'bd'
as
`flag`
-- 保单或批单标记
,
proctime
as
proctime
from
ODS
.
ODS_KAFKA
.
POLICY
-- 保单业务数据
from
ZB_ODS
.
ZB_
ODS_KAFKA
.
POLICY
-- 保单业务数据
where
LongTimeToStringUDF
(
signDate
,
'yyyyMMdd'
)
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
and
cast
(
netPremium
as
decimal
(
18
,
2
))
<>
0
...
...
@@ -93,7 +93,7 @@ from (
,
productCode
as
productCode
-- 险种代码
,
businessChannelCode
as
businessChannelCode
-- 业务渠道
,
businessNatureCode
as
businessNatureCode
-- 业务来源
,
cast
(
plpEndorse
.
netPremiumVariation
as
decimal
(
18
,
4
))
,
cast
(
cast
(
plpEndorse
.
netPremiumVariation
as
decimal
(
18
,
4
))
*
cast
(
sigAndStaExchangeRate
as
decimal
(
18
,
4
))
*
(
case
...
...
@@ -114,7 +114,7 @@ from (
end
)
end
)
as
`cost`
-- 不含税保费
)
as
decimal
(
18
,
4
))
as
`cost`
-- 不含税保费
,
endorseNo
as
`no`
-- 批单号
,
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'
...
...
@@ -125,7 +125,7 @@ from (
,
'pd'
as
`flag`
-- 保单或批单标记
,
proctime
as
proctime
from
ODS
.
ODS_KAFKA
.
ENDOR
-- 批单业务数据
from
ZB_ODS
.
ZB_
ODS_KAFKA
.
ENDOR
-- 批单业务数据
where
LongTimeToStringUDF
(
endorsePolicyTime
,
'yyyyMMdd'
)
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
and
cast
(
plpEndorse
.
netPremiumVariation
as
decimal
(
18
,
4
))
<>
0
...
...
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