Commit 795380f8 authored by 王东's avatar 王东

指标计算承保字段调整

parent 2ab22ee2
...@@ -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 -- 业务单号
) )
......
...@@ -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
; ;
......
...@@ -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
...@@ -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 -- 保单业务数据
; ;
...@@ -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` -- 不含税保费
,policyNo as `no` -- 保单号 ,businessNo 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` -- 不含税保费
,endorseNo as `no` -- 批单号 ,businessNo 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
......
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