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
efe96155
Commit
efe96155
authored
Aug 18, 2022
by
王东
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
指标计算承保字段调整
parent
6e5689cc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
41 deletions
+62
-41
ODS/DDL元数据/ENDOR.sql
ODS/DDL元数据/ENDOR.sql
+8
-7
ODS/DDL元数据/POLICY.sql
ODS/DDL元数据/POLICY.sql
+22
-21
ODS/DDL元数据/POLICY原始数据.sql
ODS/DDL元数据/POLICY原始数据.sql
+0
-0
ZB_ODS/ZB_ODS_CBDATA.sql
ZB_ODS/ZB_ODS_CBDATA.sql
+32
-13
数据模型表定义.xlsx
数据模型表定义.xlsx
+0
-0
No files found.
ODS/DDL元数据/ENDOR.sql
View file @
efe96155
...
...
@@ -4,6 +4,8 @@ ENDOR
ENDOR_PLPENDORSE
ENDOR_PLPENDORSE_PLPCOMMISSIONDETAIL
ENDOR_PLCSOLUTION
ENDOR_PLCSOLUTION_PLCCOINS
ENDOR_PLCSOLUTION_PLCCOINS_PLCCOINSBASICINFORMATION
来源:
{
...
...
@@ -26,13 +28,12 @@ ENDOR_PLCSOLUTION
}
>
}
,
plcSolution
array
<
row
{
plcCoins
String
--String类型 该对象部分参数在某些数据中可能不存在 自定义函数 JsonValuUDF读取
-- plcCoins{
-- plcCoinsBasicInformation {
-- coinsRate -- 非车险共保比例
-- coinsIdentity -- 共保我方标记 = 1 时共保我方
-- }
-- }
plcCoins
row
(
--String类型 该对象部分参数在某些数据中可能不存在 自定义函数 JsonValuUDF读取
plcCoinsBasicInformation
array
<
row
(
coinsRate
-- 非车险共保比例
coinsIdentity
-- 共保我方标记 = 1 时共保我方
)
>
)
}
>
,
recordClerkCode
String
,
-- 14 归属业务员ID
recordClerkName
String
,
-- 15 归属业务员名称
...
...
ODS/DDL元数据/POLICY.sql
View file @
efe96155
...
...
@@ -7,11 +7,12 @@ POLICY_PLCPUBLICINSURANT
POLICY_PLCSOLUTION
POLICY_PLCSOLUTION_PLCRATION
POLICY_PLCSOLUTION_PLCCOINS
POLICY_PLCSOLUTION_PLCCOINS_PLCCOINSBASICINFORMATION
POLICY_PLCSOLUTION_PLCCOMMISSIONDETAIL
-- 来源:
{
(
sigAndStaExchangeRate
String
,
-- 费率
policyCreatDate
String
,
endorseNo
String
,
-- 1 批单号
...
...
@@ -26,7 +27,7 @@ POLICY_PLCSOLUTION_PLCCOMMISSIONDETAIL
endTime
String
,
-- 10 终保时间
netPremium
String
,
-- 11 不含税保费
premium
String
,
-- 12 含税保费
plcCar05
row
{
plcCar05
row
(
licensePlateNo
String
,
-- 13 车牌号
frameNo
String
,
-- 14 车架号
vehiclecode
String
,
-- 15 行业车型代码
...
...
@@ -36,33 +37,33 @@ POLICY_PLCSOLUTION_PLCCOMMISSIONDETAIL
carKindName
String
,
-- 30 车辆种类名称
carUserNatureCode
String
,
-- 31 车辆使用性质代码
carUserNature
String
-- 32 车辆使用性质名称
}
,
plcApplicant
array
<
row
{
)
,
plcApplicant
array
<
row
(
customerName
String
-- 18 投保人名称
}
>
,
plcPublicInsurant
array
<
row
{
)
>
,
plcPublicInsurant
array
<
row
(
customerName
String
-- 19 被保人名称
}
>
,
)
>
,
newPolicyFlag
String
,
-- 20 新保标识 1:是,0:否
autoTransrenewFlag
String
,
-- 21 自动续保标识 1:是,4:跨险种自动续保,0:否
transferPolicyFlag
String
,
-- 22 转保标识1:是,0:否
transrenewFlag
String
,
-- 23 续保标识 1:是,4:跨险种续保,0:否
plcSolution
array
<
row
{
PlcRation
row
{
plcSolution
array
<
row
(
PlcRation
row
(
artifSelfPricesRat
String
-- 24 自主定价系数
}
,
plcCoins
String
--String类型 该对象部分参数在某些数据中可能不存在 自定义函数 JsonValuUDF读取
-- plcCoinsBasicInformation {
--
coinsRate -- 非车险共保比例
--
coinsIdentity -- 共保我方标记 = 1 时共保我方
-- }
}
,
plcCommissionDetail
array
<
row
{
)
,
plcCoins
row
(
--String类型 该对象部分参数在某些数据中可能不存在 自定义函数 JsonValuUDF读取
plcCoinsBasicInformation
array
<
row
(
coinsRate
-- 非车险共保比例
coinsIdentity
-- 共保我方标记 = 1 时共保我方
)
>
)
,
plcCommissionDetail
array
<
row
(
agentFee
String
,
-- 36 份额含税手续费
agentNetFee
String
-- 37 份额不含税手续费
}
>
}
>
,
)
>
)
>
,
saleaman
String
,
-- 25 代理机构代码
saleamanName
String
,
-- 26 代理机构名称
businessChannelCode
String
,
-- 27 业务渠道
...
...
@@ -72,4 +73,4 @@ POLICY_PLCSOLUTION_PLCCOMMISSIONDETAIL
staCurAmount
String
,
-- 38 保险金额
staCurTaxFee
String
-- 39 税
}
\ No newline at end of file
)
\ No newline at end of file
ODS/DDL元数据/POLICY原始数据.sql
View file @
efe96155
This source diff could not be displayed because it is too large. You can
view the blob
instead.
ZB_ODS/ZB_ODS_CBDATA.sql
View file @
efe96155
...
...
@@ -7,7 +7,7 @@
-- 备注:只有在非车险共保我方保费时存在系数得字段
-- 2、汇率换算 = 承保保费 * sigAndStaExchangeRate (汇率)
-- 备注:批单不用计算,sta开头得字段是被转过汇率得
-- 条件: 车险 或 (非车险 并且 plcSolution[1].plcCoins.plcCoinsBasicInformation[1].coinsIdentity(共保我方) =1)
--
3、
条件: 车险 或 (非车险 并且 plcSolution[1].plcCoins.plcCoinsBasicInformation[1].coinsIdentity(共保我方) =1)
insert
into
ZB_ODS
.
ZB_ODS_KAFKA
.
CBDATA
...
...
@@ -40,16 +40,19 @@ select
,
s1
.
recordClerkCode
as
`id`
-- 14 归属业务员ID
,
s1
.
recordClerkName
as
`name`
-- 15 归属业务员名称
from
(
select
select
LongTimeToStringUDF
(
uwConclueDate
,
'yyyyMMdd'
)
as
uwConclueDate
-- 核保通过时间
,
LongTimeToStringUDF
(
startTime
,
'yyyyMMdd'
)
as
startTime
-- 起保时间
,
businessOffice
as
businessOffice
-- 保单归属机构代码
,
productCode
as
productCode
-- 险种代码
,
businessChannelCode
as
businessChannelCode
-- 业务渠道
,
businessNatureCode
as
businessNatureCode
-- 业务来源
,
cast
(
netPremium
as
decimal
(
18
,
2
))
*
cast
(
sigAndStaExchangeRate
as
decimal
(
18
,
2
))
*
(
case
when
JsonValueUDF
(
plcSolution
[
1
].
plcCoins
,
'plcCoinsBasicInformation[1].coinsRate'
)
is
null
then
1
else
cast
(
JsonValueUDF
(
plcSolution
[
1
].
plcCoins
,
'plcCoinsBasicInformation[1].coinsRate'
)
AS
decimal
(
18
,
2
)
)
end
)
,
cast
(
netPremium
as
decimal
(
18
,
2
))
*
cast
(
sigAndStaExchangeRate
as
decimal
(
18
,
2
))
*
(
case
when
plcSolution
[
1
].
plcCoins
.
plcCoinsBasicInformation
is
null
then
1
else
cast
(
plcSolution
[
1
].
plcCoins
.
plcCoinsBasicInformation
[
1
].
coinsRate
AS
decimal
(
18
,
2
)
)
end
)
as
netPremium
-- 不含税保费
,
policyNo
as
policyNo
-- 保单号
,
case
...
...
@@ -62,19 +65,28 @@ select
,
proctime
as
proctime
from
ODS
.
ODS_KAFKA
.
POLICY
-- 保单业务数据
where
LongTimeToStringUDF
(
uwConclueDate
,
'yyyyMMdd'
)
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
and
(
LEFT
(
productCode
,
2
)
=
'05'
or
(
LEFT
(
productCode
,
2
)
<>
'05'
and
JsonValueUDF
(
plcSolution
[
1
].
plcCoins
,
'plcCoinsBasicInformation[1].coinsIdentity'
)
=
'1'
))
and
(
LEFT
(
productCode
,
2
)
=
'05'
or
(
LEFT
(
productCode
,
2
)
<>
'05'
and
plcSolution
[
1
].
plcCoins
.
plcCoinsBasicInformation
is
not
null
and
plcSolution
[
1
].
plcCoins
.
plcCoinsBasicInformation
[
1
].
coinsIdentity
=
'1'
)
)
union
all
select
LongTimeToStringUDF
(
uwConclueDate
,
'yyyyMMdd'
)
as
uwConclueDate
-- 核保通过时间 ??
,
LongTimeToStringUDF
(
endorseEffectiveTime
,
'yyyyMMdd'
)
as
startTime
-- 起保时间
,
LongTimeToStringUDF
(
plpEndorse
.
endorseEffectiveTime
,
'yyyyMMdd'
)
as
startTime
-- 起保时间
,
businessOffice
as
businessOffice
-- 保单归属机构代码
,
productCode
as
productCode
-- 险种代码
,
businessChannelCode
as
businessChannelCode
-- 业务渠道
,
businessNatureCode
as
businessNatureCode
-- 业务来源
,
cast
(
plpEndorse
.
staCurPremiumVariation
as
decimal
(
18
,
2
))
*
(
case
when
JsonValueUDF
(
plcSolution
[
1
].
plcCoins
,
'plcCoinsBasicInformation[1].coinsRate'
)
is
null
then
1
else
cast
(
JsonValueUDF
(
plcSolution
[
1
].
plcCoins
,
'plcCoinsBasicInformation[1].coinsRate'
)
AS
decimal
(
18
,
2
)
)
end
)
,
cast
(
plpEndorse
.
staCurPremiumVariation
as
decimal
(
18
,
2
))
*
(
case
when
plcSolution
[
1
].
plcCoins
.
plcCoinsBasicInformation
is
null
then
1
else
cast
(
plcSolution
[
1
].
plcCoins
.
plcCoinsBasicInformation
[
1
].
coinsRate
AS
decimal
(
18
,
2
)
)
end
)
as
netPremium
-- 不含税保费 ??
,
endorseNo
as
policyNo
-- 批单号
,
case
...
...
@@ -85,9 +97,16 @@ select
,
recordClerkName
as
recordClerkName
-- 15 归属业务员名称
,
'pd'
as
flag
-- 保单或批单标记
,
proctime
as
proctime
from
ODS
.
ODS_KA
KF
A
.
ENDOR
-- 批单业务数据
from
ODS
.
ODS_KA
FK
A
.
ENDOR
-- 批单业务数据
where
LongTimeToStringUDF
(
uwConclueDate
,
'yyyyMMdd'
)
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
and
(
LEFT
(
productCode
,
2
)
=
'05'
or
(
LEFT
(
productCode
,
2
)
<>
'05'
and
JsonValueUDF
(
plcSolution
[
1
].
plcCoins
,
'plcCoinsBasicInformation[1].coinsIdentity'
)
=
'1'
))
and
(
LEFT
(
productCode
,
2
)
=
'05'
or
(
LEFT
(
productCode
,
2
)
<>
'05'
and
plcSolution
[
1
].
plcCoins
.
plcCoinsBasicInformation
is
not
null
and
plcSolution
[
1
].
plcCoins
.
plcCoinsBasicInformation
[
1
].
coinsIdentity
=
'1'
)
)
)
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
...
...
数据模型表定义.xlsx
View file @
efe96155
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