Commit b7df161c authored by 胡涛's avatar 胡涛

指标统计sql脚本

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