Commit 6f44702e authored by 王东's avatar 王东

指标计算承保字段调整

parent e7b517c1
-- ENDOR 批单业务数据
ENDOR
ENDOR_PLPENDORSE
ENDOR_PLPENDORSE_PLPCOMMISSIONDETAIL
ENDOR_PLCSOLUTION
来源:
{
endorseNo String , -- 1 批单号
businessOffice String , -- 2 机构代码
productCode String , -- 3 险种代码
businessNatureCode String , -- 4 业务来源
channelType String , -- 5 渠道类型
uwConclueDate String , -- 6 核批完成时间
plpEndorse row{
endorseEffectiveTime Stirng , -- 7 批单生效日期
sigAndStaExchangeRate String , -- 8 到人民币汇率 除了粤港车,车险没有存汇率,模型默认0
staCurAmountVariation String , -- 10 变化保险金额
staCurPremiumVariation String , -- 11 不含税变化保险费
staCurNetPremiumVariation String , -- 12 含税变化保险费
staCurTaxFeeVariation String , -- 13 税
plpCommissionDetail array<row{
agentFeeVariation String , -- 16 份额含税手续费变化量
agentNetFeeVariation String -- 17 份额不含税手续费变化量
}>
},
plcSolution array<row{
plcCoins String --String类型 该对象部分参数在某些数据中可能不存在 自定义函数 JsonValuUDF读取
-- plcCoins{
-- plcCoinsBasicInformation {
-- coinsRate -- 非车险共保比例
-- coinsIdentity -- 共保我方标记 = 1 时共保我方
-- }
-- }
}>,
recordClerkCode String , -- 14 归属业务员ID
recordClerkName String , -- 15 归属业务员名称
businessChannelCode String , -- 27 业务渠道
businessChannelName String , -- 28 业务渠道名
newPolicyFlag String , -- 20 新保标识 1:是,0:否
autoTransrenewFlag String , -- 21 自动续保标识 1:是,4:跨险种自动续保,0:否
transferPolicyFlag String , -- 22 转保标识1:是,0:否
transrenewFlag String -- 23 续保标识 1:是,4:跨险种续保,0:否
}
-- POLICY 保单业务数据
POLICY
POLICY_PLCCAR05
POLICY_PLCAPPLICANT
POLICY_PLCPUBLICINSURANT
POLICY_PLCSOLUTION
POLICY_PLCSOLUTION_PLCRATION
POLICY_PLCSOLUTION_PLCCOINS
POLICY_PLCSOLUTION_PLCCOMMISSIONDETAIL
-- 来源:
{
sigAndStaExchangeRate String , -- 费率
policyCreatDate String ,
endorseNo String , -- 1 批单号
policyNo String , -- 2 保单号
businessNo String , -- 3 业务号
uwConclueDate String , -- 4 核保通过时间
businessOffice String , -- 5 保单归属机构代码
businessOfficeName String , -- 6 保单归属机构名称
productCode String , -- 7 险种代码
businessNatureCode String , -- 8 业务来源
startTime String , -- 9 起保时间
endTime String , -- 10 终保时间
netPremium String , -- 11 不含税保费
premium String , -- 12 含税保费
plcCar05 row{
licensePlateNo String , -- 13 车牌号
frameNo String , -- 14 车架号
vehiclecode String , -- 15 行业车型代码
carBrandCode String , -- 16 厂牌型号
newCarFlag String , -- 17 新车标识 1:新车,0:旧车
carKindCode String , -- 29 车辆种类代码
carKindName String , -- 30 车辆种类名称
carUserNatureCode String , -- 31 车辆使用性质代码
carUserNature String -- 32 车辆使用性质名称
},
plcApplicant array<row{
customerName String -- 18 投保人名称
}>,
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{
artifSelfPricesRat String -- 24 自主定价系数
},
plcCoins String --String类型 该对象部分参数在某些数据中可能不存在 自定义函数 JsonValuUDF读取
-- plcCoinsBasicInformation {
-- coinsRate -- 非车险共保比例
-- coinsIdentity -- 共保我方标记 = 1 时共保我方
-- }
},
plcCommissionDetail array<row{
agentFee String , -- 36 份额含税手续费
agentNetFee String -- 37 份额不含税手续费
}>
}>,
saleaman String , -- 25 代理机构代码
saleamanName String , -- 26 代理机构名称
businessChannelCode String , -- 27 业务渠道
businessChannelName String , -- 28 业务渠道名
recordClerkCode String , -- 34 归属业务员ID
recordClerkName String , -- 35 归属业务员名称
staCurAmount String , -- 38 保险金额
staCurTaxFee String -- 39 税
}
\ No newline at end of file
-- ZB_ODS_ENDOR ZB_ODS_批单业务数据
insert into ODS.ODS_KAFKA.ENDOR
select
endorseNo , -- 1 批单号
businessOffice , -- 2 机构代码
productCode , -- 3 险种代码
businessNatureCode , -- 4 业务来源
channelType , -- 5 渠道类型
uwConclueDate , -- 6 核批完成时间
plpEndorse , -- plpEndorse
plcSolution , -- plcSolution
recordClerkCode , -- 14 归属业务员ID
recordClerkName , -- 15 归属业务员名称
businessChannelCode , -- 27 业务渠道
businessChannelName , -- 28 业务渠道名
newPolicyFlag , -- 20 新保标识 1:是,0:否
autoTransrenewFlag , -- 21 自动续保标识 1:是,4:跨险种自动续保,0:否
transferPolicyFlag , -- 22 转保标识1:是,0:否
transrenewFlag -- 23 续保标识 1:是,4:跨险种续保,0:否
from ODS.SOURCE_RMQ_ENDOR_SIT.ENDOR
;
\ No newline at end of file
-- ZB_ODS_POLICY ZB_ODS_保单业务数据
insert into ODS.ODS_KAFKAL.POLICY
select
sigAndStaExchangeRate , -- 费率
policyCreatDate ,
endorseNo , -- 1 批单号
policyNo , -- 2 保单号
businessNo , -- 3 业务号
uwConclueDate , -- 4 核保通过时间
businessOffice , -- 5 保单归属机构代码
businessOfficeName , -- 6 保单归属机构名称
productCode , -- 7 险种代码
businessNatureCode , -- 8 业务来源
startTime , -- 9 起保时间
endTime , -- 10 终保时间
netPremium , -- 11 不含税保费
premium , -- 12 含税保费
plcCar05 ,
plcApplicant ,
plcPublicInsurant ,
newPolicyFlag , -- 20 新保标识 1:是,0:否
autoTransrenewFlag , -- 21 自动续保标识 1:是,4:跨险种自动续保,0:否
transferPolicyFlag , -- 22 转保标识1:是,0:否
transrenewFlag , -- 23 续保标识 1:是,4:跨险种续保,0:否
plcSolution ,
saleaman , -- 25 代理机构代码
saleamanName , -- 26 代理机构名称
businessChannelCode , -- 27 业务渠道
businessChannelName , -- 28 业务渠道名
recordClerkCode , -- 34 归属业务员ID
recordClerkName , -- 35 归属业务员名称
staCurAmount , -- 38 保险金额
staCurTaxFee -- 39 税
from ODS.SOURCE_RMQ_POLICY_SIT.POLICY
-- ZB_ODS_ENDOR ZB_ODS_批单业务数据
insert into ZB_ODS.ZB_ODS_MYSQL.TEST_ENDOR
select
endorseNo as endorseNo ,
uwConclueDate as uwConclueDate ,
plpEndorse.plpCommissionDetail[1].agentNetFeeVariation as agentNetFeeVariation
from ZB_ODS.ZB_SOURCE_RMQ_ENDOR_SIT.ENDOR
;
\ No newline at end of file
-- ZB_ODS_POLICY ZB_ODS_保单业务数据
insert into ZB_ODS.ZB_ODS_MYSQL.TEST_POLICY
select
policyNo as policyNo ,
plcCar05.licensePlateNo as licensePlateNo ,
plcSolution[1].PlcRation.artifSelfPricesRat as artifSelfPricesRat
from ZB_ODS.ZB_SOURCE_RMQ_POLICY_SIT.POLICY
-- ENDOR 批单业务数据
ENDOR
ENDOR_PLPENDORSE
ENDOR_PLPENDORSE_PLPCOMMISSIONDETAIL
ENDOR_PLCSOLUTION
来源:
{
"endorseNo": "6805212021411283003730001", -- 1 批单号
"businessOffice": "4112833803", -- 2 机构代码
"productCode": "0521", -- 3 险种代码
"businessNatureCode": "b", -- 4 业务来源
"channelType": "03", -- 5 渠道类型
"uwConclueDate": 1655346164000, -- 6 核批完成时间
"plpEndorse": {
"endorseEffectiveTime": 1655395200000, -- 7 批单生效日期
"sigAndStaExchangeRate": 0, -- 8 到人民币汇率 除了粤港车,车险没有存汇率,模型默认0
"staCurAmountVariation": 0, -- 10 变化保险金额
"staCurPremiumVariation": 20.66, -- 11 不含税变化保险费
"staCurNetPremiumVariation": 19.49, -- 12 含税变化保险费
"staCurTaxFeeVariation": 1.17, -- 13 税
"plpCommissionDetail": [{
"agentFeeVariation": 2.34, -- 16 份额含税手续费变化量
"agentNetFeeVariation": 2.34 -- 17 份额不含税手续费变化量
}]
},
"plcSolution": [{
"plcCoins": { -- 自定义函数 JsonValuUDF读取
-- plcCoinsBasicInformation {
-- coinsRate -- 非车险共保比例
-- coinsIdentity -- 共保我方标记 = 1 时共保我方
-- }
}
}],
"recordClerkCode": "411422198909123920", -- 14 归属业务员ID
"recordClerkName": "李琳琳" , -- 15 归属业务员名称
"businessChannelCode": "03", -- 27 业务渠道
"businessChannelName": "互动渠道" , -- 28 业务渠道名
"newPolicyFlag": "0", -- 20 新保标识 1:是,0:否
"autoTransrenewFlag": "0", -- 21 自动续保标识 1:是,4:跨险种自动续保,0:否
"transferPolicyFlag": "1", -- 22 转保标识1:是,0:否
"transrenewFlag": "0" -- 23 续保标识 1:是,4:跨险种续保,0:否
}
-- POLICY 保单业务数据
POLICY
POLICY_PLCCAR05
POLICY_PLCAPPLICANT
POLICY_PLCPUBLICINSURANT
POLICY_PLCSOLUTION
POLICY_PLCSOLUTION_PLCRATION
POLICY_PLCSOLUTION_PLCCOINS
POLICY_PLCSOLUTION_PLCCOMMISSIONDETAIL
来源:
{
"sigAndStaExchangeRate": 1,
"policyCreatDate": 1642142368422,
"endorseNo": null , -- 1 批单号
"policyNo": "6605212022411424000406", -- 2 保单号
"businessNo": "6605212022411424000406", -- 3 业务号
"uwConclueDate": 1642141803000, -- 4 核保通过时间
"businessOffice": "4114243001", -- 5 保单归属机构代码
"businessOfficeName": "商丘市柘城县营销服务部互动业务一部", -- 6 保单归属机构名称
"productCode": "0521", -- 7 险种代码
"businessNatureCode": "b", -- 8 业务来源
"startTime": 1643817600000, -- 9 起保时间
"endTime": 1675353600000, -- 10 终保时间
"netPremium": 313.32, -- 11 不含税保费
"premium": 332.12, -- 12 含税保费
"plcCar05": {
"licensePlateNo": "豫N96A12", -- 13 车牌号
"frameNo": "LMVAFLFD5GA070602", -- 14 车架号
"vehiclecode": "BHMEHAUE0001", -- 15 行业车型代码
"carBrandCode": "海马HMA7160DA4CW轿车", -- 16 厂牌型号
"newCarFlag": "0", -- 17 新车标识 1:新车,0:旧车
"carKindCode": "A0", -- 29 车辆种类代码
"carKindName": "客车", -- 30 车辆种类名称
"carUserNatureCode": "8A", -- 31 车辆使用性质代码
"carUserNature": "家庭自用" -- 32 车辆使用性质名称
},
"plcApplicant": [
{
"customerName": "李志强" -- 18 投保人名称
}
],
"plcPublicInsurant": [
{
"customerName": "李强" -- 19 被保人名称
}
],
"newPolicyFlag": "0", -- 20 新保标识 1:是,0:否
"autoTransrenewFlag": "0", -- 21 自动续保标识 1:是,4:跨险种自动续保,0:否
"transferPolicyFlag": "1", -- 22 转保标识1:是,0:否
"transrenewFlag": "0", -- 23 续保标识 1:是,4:跨险种续保,0:否
"plcSolution": [{
"PlcRation": {
"artifSelfPricesRat": 0.8801 -- 24 自主定价系数
},
"plcCoins": { -- 自定义函数 JsonValuUDF读取
-- plcCoinsBasicInformation {
-- coinsRate -- 非车险共保比例
-- coinsIdentity -- 共保我方标记 = 1 时共保我方
-- }
},
"plcCommissionDetail": [{
"agentFee": 28.2, -- 36 份额含税手续费
"agentNetFee": 28.2 -- 37 份额不含税手续费
}]
}],
"saleaman": "87503064-0", -- 25 代理机构代码
"saleamanName": "中国人寿保险股份有限公司商丘分公司", -- 26 代理机构名称
"businessChannelCode": "03", -- 27 业务渠道
"businessChannelName": "互动渠道", -- 28 业务渠道名
"recordClerkCode": "411424199510110033", -- 34 归属业务员ID
"recordClerkName": "王昊", -- 35 归属业务员名称
"staCurAmount": 1000000, -- 38 保险金额
"staCurTaxFee": 18.8 -- 39 税
}
\ No newline at end of file
......@@ -60,7 +60,7 @@ select
,recordClerkName as recordClerkName -- 15 归属业务员名称
,'bd' as flag -- 保单或批单标记
,proctime as proctime
from ZB_ODS.ZB_SOURCE_RMQ_POLICY_SIT.POLICY -- 保单业务数据
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'))
......@@ -85,7 +85,7 @@ select
,recordClerkName as recordClerkName -- 15 归属业务员名称
,'pd' as flag -- 保单或批单标记
,proctime as proctime
from ZB_ODS.ZB_SOURCE_RMQ_ENDOR_SIT.ENDOR -- 批单业务数据
from ODS.ODS_KAKFA.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'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment