Commit b7df161c authored by 胡涛's avatar 胡涛

指标统计sql脚本

parent 70f661eb
......@@ -45,8 +45,8 @@ from (
,recordClerkName as recordClerkName -- 15 归属业务员名称
,'bd' as flag -- 保单或批单标记
,proctime as proctime
,ROW_NUMBER() OVER(PARTITION BY policyNo,businessOffice,netPremium ORDER BY uwConclueDate DESC) as rownum
from ZB_ODS.ZB_SOURCE_RMQ_POLICY_SIT.POLICY -- 保单业务数据
-- ,ROW_NUMBER() OVER(PARTITION BY policyNo,businessOffice,netPremium ORDER BY uwConclueDate DESC) as rownum
from ZB_ODS.ZB_SOURCE_RMQ_POLICY_UAT.POLICY -- 保单业务数据
where `uwConclueDate` = DATE_FORMAT(LOCALTIMESTAMP,'yyyyMMdd')
union all
......@@ -67,8 +67,8 @@ from (
,recordClerkName as recordClerkName -- 15 归属业务员名称
,'pd' as flag -- 保单或批单标记
,proctime as proctime
,ROW_NUMBER() OVER(PARTITION BY endorseNo,businessOffice,plpEndorse.staCurPremiumVariation ORDER BY uwConclueDate DESC) as rownum
from ZB_ODS.ZB_SOURCE_RMQ_ENDOR_SIT.ENDOR -- 批单业务数据
-- ,ROW_NUMBER() OVER(PARTITION BY endorseNo,businessOffice,plpEndorse.staCurPremiumVariation ORDER BY uwConclueDate DESC) as rownum
from ZB_ODS.ZB_SOURCE_RMQ_ENDOR_UAT.ENDOR -- 批单业务数据
where `uwConclueDate` = DATE_FORMAT(LOCALTIMESTAMP,'yyyyMMdd')
) s1
......@@ -76,7 +76,7 @@ left join ZB_ODS.ZB_ODS_MYSQL.CD_COM_ALL for system_time as of s1.proctime as t1
left join ZB_ODS.ZB_ODS_MYSQL.CD_NEWCHNLTYPE for system_time as of s1.proctime as t2 on s1.businessChannelCode = t2.NEWCHNLTYPE
left join ZB_ODS.ZB_ODS_MYSQL.CD_REALTIME_RISK for system_time as of s1.proctime as t3 on s1.productCode = t3.RISKCODE
left join ZB_ODS.ZB_ODS_MYSQL.CD_BUSINESSNATURE for system_time as of s1.proctime as t4 on s1.businessNatureCode = t4.CODE
where s1.rownum = 1
-- where s1.rownum = 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