Commit 2ab22ee2 authored by 胡涛's avatar 胡涛

指标统计sql脚本

parent da67f973
......@@ -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
,JsonGetCoinsRateUDF(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
......@@ -11,8 +11,8 @@ select
,sigAndStaExchangeRate as sigAndStaExchangeRate
,coinsCode as coinsCode
,coinsLinkCode as coinsLinkCode
,JsonGetCoinsRateUDF(plcSolution[1].plcCoins.plcLinkBasicInformat,'coinsLinkCode',coinsLinkCode) as LinkCoinsRate
,sonGetCoinsRateUDF(plcSolution[1].plcCoins.plcCoinsBasicInformation,'coinsCode',coinsCode) as CoinsCoinsRate
,JsonGetCoinsRateUDF(plcSolution[1].plcCoins.plcLinkBasicInformat,'coinsLinkCode',coinsLinkCode) as LinkCoinsRate
,JsonGetCoinsRateUDF(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 -- 保单业务数据
;
......@@ -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
......
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