Commit e7b517c1 authored by 胡涛's avatar 胡涛

指标统计sql脚本

parent c237079f
...@@ -13,11 +13,11 @@ SELECT ...@@ -13,11 +13,11 @@ SELECT
,s1.`LEVEL2COMCODE` as `LEVEL2COMCODE` ,s1.`LEVEL2COMCODE` as `LEVEL2COMCODE`
,s1.`LEVEL3COMCODE` as `LEVEL3COMCODE` ,s1.`LEVEL3COMCODE` as `LEVEL3COMCODE`
,s1.`LEVEL4COMCODE` as `LEVEL4COMCODE` ,s1.`LEVEL4COMCODE` as `LEVEL4COMCODE`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `cost` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `settledamount`
from ( from (
select select
* *
,ROW_NUMBER() OVER(PARTITION BY `no`,`COMCODE`,`cost` ORDER BY `setdate` DESC) as rownum ,ROW_NUMBER() OVER(PARTITION BY `no`,`COMCODE`,`settledamount` ORDER BY `setdate` DESC) as rownum
from ZB_ODS.ZB_ODS_KAFKA.LPDATA from ZB_ODS.ZB_ODS_KAFKA.LPDATA
where where
`COMNAME` is not null `COMNAME` is not null
...@@ -43,7 +43,7 @@ select ...@@ -43,7 +43,7 @@ select
,'/00000000' ,'/00000000'
) as `key` ) as `key`
,s1.`chnl` as `hkey` ,s1.`chnl` as `hkey`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `val` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `val`
from VIEW_ZB_DM_FQDYJPK_TUANDUI s1 from VIEW_ZB_DM_FQDYJPK_TUANDUI s1
group by group by
s1.`setdate` s1.`setdate`
...@@ -60,7 +60,7 @@ select ...@@ -60,7 +60,7 @@ select
,'/',s1.`LEVEL1COMCODE` ,'/',s1.`LEVEL1COMCODE`
) as `key` ) as `key`
,s1.`chnl` as `hkey` ,s1.`chnl` as `hkey`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `val` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `val`
from VIEW_ZB_DM_FQDYJPK_TUANDUI s1 from VIEW_ZB_DM_FQDYJPK_TUANDUI s1
group by group by
s1.`setdate` s1.`setdate`
...@@ -77,7 +77,7 @@ select ...@@ -77,7 +77,7 @@ select
,'/',s1.`LEVEL2COMCODE` ,'/',s1.`LEVEL2COMCODE`
) as `key` ) as `key`
,s1.`chnl` as `hkey` ,s1.`chnl` as `hkey`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `val` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `val`
from VIEW_ZB_DM_FQDYJPK_TUANDUI s1 from VIEW_ZB_DM_FQDYJPK_TUANDUI s1
group by group by
s1.`setdate` s1.`setdate`
...@@ -94,7 +94,7 @@ select ...@@ -94,7 +94,7 @@ select
,'/',s1.`LEVEL3COMCODE` ,'/',s1.`LEVEL3COMCODE`
) as `key` ) as `key`
,s1.`chnl` as `hkey` ,s1.`chnl` as `hkey`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `val` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `val`
from VIEW_ZB_DM_FQDYJPK_TUANDUI s1 from VIEW_ZB_DM_FQDYJPK_TUANDUI s1
group by group by
s1.`setdate` s1.`setdate`
...@@ -111,6 +111,6 @@ select ...@@ -111,6 +111,6 @@ select
,'/',s1.`LEVEL4COMCODE` ,'/',s1.`LEVEL4COMCODE`
) as `key` ) as `key`
,s1.`chnl` as `hkey` ,s1.`chnl` as `hkey`
,cast(s1.`cost` as DECIMAL(18,2)) as `val` ,cast(s1.`settledamount` as DECIMAL(18,2)) as `val`
from VIEW_ZB_DM_FQDYJPK_TUANDUI s1 from VIEW_ZB_DM_FQDYJPK_TUANDUI s1
; ;
\ No newline at end of file
...@@ -13,11 +13,11 @@ SELECT ...@@ -13,11 +13,11 @@ SELECT
,s1.`LEVEL2COMCODE` as `LEVEL2COMCODE` ,s1.`LEVEL2COMCODE` as `LEVEL2COMCODE`
,s1.`LEVEL3COMCODE` as `LEVEL3COMCODE` ,s1.`LEVEL3COMCODE` as `LEVEL3COMCODE`
,s1.`LEVEL4COMCODE` as `LEVEL4COMCODE` ,s1.`LEVEL4COMCODE` as `LEVEL4COMCODE`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `cost` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `settledamount`
from ( from (
select select
* *
,ROW_NUMBER() OVER(PARTITION BY `no`,`COMCODE`,`cost` ORDER BY `setdate` DESC) as rownum ,ROW_NUMBER() OVER(PARTITION BY `no`,`COMCODE`,`settledamount` ORDER BY `setdate` DESC) as rownum
from ZB_ODS.ZB_ODS_KAFKA.LPDATA from ZB_ODS.ZB_ODS_KAFKA.LPDATA
where where
`COMNAME` is not null `COMNAME` is not null
...@@ -43,7 +43,7 @@ select ...@@ -43,7 +43,7 @@ select
,'/00000000' ,'/00000000'
) as `key` ) as `key`
,s1.`chnl` as `hkey` ,s1.`chnl` as `hkey`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `val` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `val`
from VIEW_ZB_DM_FQDWJPK_TUANDUI s1 from VIEW_ZB_DM_FQDWJPK_TUANDUI s1
group by group by
s1.`setdate` s1.`setdate`
...@@ -60,7 +60,7 @@ select ...@@ -60,7 +60,7 @@ select
,'/',s1.`LEVEL1COMCODE` ,'/',s1.`LEVEL1COMCODE`
) as `key` ) as `key`
,s1.`chnl` as `hkey` ,s1.`chnl` as `hkey`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `val` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `val`
from VIEW_ZB_DM_FQDWJPK_TUANDUI s1 from VIEW_ZB_DM_FQDWJPK_TUANDUI s1
group by group by
s1.`setdate` s1.`setdate`
...@@ -77,7 +77,7 @@ select ...@@ -77,7 +77,7 @@ select
,'/',s1.`LEVEL2COMCODE` ,'/',s1.`LEVEL2COMCODE`
) as `key` ) as `key`
,s1.`chnl` as `hkey` ,s1.`chnl` as `hkey`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `val` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `val`
from VIEW_ZB_DM_FQDWJPK_TUANDUI s1 from VIEW_ZB_DM_FQDWJPK_TUANDUI s1
group by group by
s1.`setdate` s1.`setdate`
...@@ -94,7 +94,7 @@ select ...@@ -94,7 +94,7 @@ select
,'/',s1.`LEVEL3COMCODE` ,'/',s1.`LEVEL3COMCODE`
) as `key` ) as `key`
,s1.`chnl` as `hkey` ,s1.`chnl` as `hkey`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `val` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `val`
from VIEW_ZB_DM_FQDWJPK_TUANDUI s1 from VIEW_ZB_DM_FQDWJPK_TUANDUI s1
group by group by
s1.`setdate` s1.`setdate`
...@@ -111,6 +111,6 @@ select ...@@ -111,6 +111,6 @@ select
,'/',s1.`LEVEL4COMCODE` ,'/',s1.`LEVEL4COMCODE`
) as `key` ) as `key`
,s1.`chnl` as `hkey` ,s1.`chnl` as `hkey`
,cast(s1.`cost` as DECIMAL(18,2)) as `val` ,cast(s1.`settledamount` as DECIMAL(18,2)) as `val`
from VIEW_ZB_DM_FQDWJPK_TUANDUI s1 from VIEW_ZB_DM_FQDWJPK_TUANDUI s1
; ;
\ No newline at end of file
...@@ -13,11 +13,11 @@ SELECT ...@@ -13,11 +13,11 @@ SELECT
,s1.`LEVEL2COMCODE` as `LEVEL2COMCODE` ,s1.`LEVEL2COMCODE` as `LEVEL2COMCODE`
,s1.`LEVEL3COMCODE` as `LEVEL3COMCODE` ,s1.`LEVEL3COMCODE` as `LEVEL3COMCODE`
,s1.`LEVEL4COMCODE` as `LEVEL4COMCODE` ,s1.`LEVEL4COMCODE` as `LEVEL4COMCODE`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `cost` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `settledamount`
from ( from (
select select
* *
,ROW_NUMBER() OVER(PARTITION BY `no`,`COMCODE`,`cost` ORDER BY `setdate` DESC) as rownum ,ROW_NUMBER() OVER(PARTITION BY `no`,`COMCODE`,`settledamount` ORDER BY `setdate` DESC) as rownum
from ZB_ODS.ZB_ODS_KAFKA.LPDATA from ZB_ODS.ZB_ODS_KAFKA.LPDATA
where where
`COMNAME` is not null `COMNAME` is not null
...@@ -42,7 +42,7 @@ select ...@@ -42,7 +42,7 @@ select
,s1.`setdate` ,s1.`setdate`
) as `key` ) as `key`
,s1.`classcode` as `hkey` ,s1.`classcode` as `hkey`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `val` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `val`
from VIEW_ZB_DM_FXLYJPK_TUANDUI s1 from VIEW_ZB_DM_FXLYJPK_TUANDUI s1
group by group by
s1.`setdate` s1.`setdate`
...@@ -59,7 +59,7 @@ select ...@@ -59,7 +59,7 @@ select
,'/',s1.`LEVEL1COMCODE` ,'/',s1.`LEVEL1COMCODE`
) as `key` ) as `key`
,s1.`classcode` as `hkey` ,s1.`classcode` as `hkey`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `val` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `val`
from VIEW_ZB_DM_FXLYJPK_TUANDUI s1 from VIEW_ZB_DM_FXLYJPK_TUANDUI s1
group by group by
s1.`setdate` s1.`setdate`
...@@ -76,7 +76,7 @@ select ...@@ -76,7 +76,7 @@ select
,'/',s1.`LEVEL2COMCODE` ,'/',s1.`LEVEL2COMCODE`
) as `key` ) as `key`
,s1.`classcode` as `hkey` ,s1.`classcode` as `hkey`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `val` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `val`
from VIEW_ZB_DM_FXLYJPK_TUANDUI s1 from VIEW_ZB_DM_FXLYJPK_TUANDUI s1
group by group by
s1.`setdate` s1.`setdate`
...@@ -93,7 +93,7 @@ select ...@@ -93,7 +93,7 @@ select
,'/',s1.`LEVEL3COMCODE` ,'/',s1.`LEVEL3COMCODE`
) as `key` ) as `key`
,s1.`classcode` as `hkey` ,s1.`classcode` as `hkey`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `val` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `val`
from VIEW_ZB_DM_FXLYJPK_TUANDUI s1 from VIEW_ZB_DM_FXLYJPK_TUANDUI s1
group by group by
s1.`setdate` s1.`setdate`
...@@ -110,6 +110,6 @@ select ...@@ -110,6 +110,6 @@ select
,'/',s1.`LEVEL4COMCODE` ,'/',s1.`LEVEL4COMCODE`
) as `key` ) as `key`
,s1.`classcode` as `hkey` ,s1.`classcode` as `hkey`
,cast(s1.`cost` as DECIMAL(18,2)) as `val` ,cast(s1.`settledamount` as DECIMAL(18,2)) as `val`
from VIEW_ZB_DM_FXLYJPK_TUANDUI s1 from VIEW_ZB_DM_FXLYJPK_TUANDUI s1
; ;
\ No newline at end of file
...@@ -13,11 +13,11 @@ SELECT ...@@ -13,11 +13,11 @@ SELECT
,s1.`LEVEL2COMCODE` as `LEVEL2COMCODE` ,s1.`LEVEL2COMCODE` as `LEVEL2COMCODE`
,s1.`LEVEL3COMCODE` as `LEVEL3COMCODE` ,s1.`LEVEL3COMCODE` as `LEVEL3COMCODE`
,s1.`LEVEL4COMCODE` as `LEVEL4COMCODE` ,s1.`LEVEL4COMCODE` as `LEVEL4COMCODE`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `cost` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `settledamount`
from ( from (
select select
* *
,ROW_NUMBER() OVER(PARTITION BY `no`,`COMCODE`,`cost` ORDER BY `setdate` DESC) as rownum ,ROW_NUMBER() OVER(PARTITION BY `no`,`COMCODE`,`settledamount` ORDER BY `setdate` DESC) as rownum
from ZB_ODS.ZB_ODS_KAFKA.LPDATA from ZB_ODS.ZB_ODS_KAFKA.LPDATA
where where
`COMNAME` is not null `COMNAME` is not null
...@@ -42,7 +42,7 @@ select ...@@ -42,7 +42,7 @@ select
,s1.`setdate` ,s1.`setdate`
) as `key` ) as `key`
,s1.`classcode` as `hkey` ,s1.`classcode` as `hkey`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `val` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `val`
from VIEW_ZB_DM_FXLWJPK_TUANDUI s1 from VIEW_ZB_DM_FXLWJPK_TUANDUI s1
group by group by
s1.`setdate` s1.`setdate`
...@@ -59,7 +59,7 @@ select ...@@ -59,7 +59,7 @@ select
,'/',s1.`LEVEL1COMCODE` ,'/',s1.`LEVEL1COMCODE`
) as `key` ) as `key`
,s1.`classcode` as `hkey` ,s1.`classcode` as `hkey`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `val` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `val`
from VIEW_ZB_DM_FXLWJPK_TUANDUI s1 from VIEW_ZB_DM_FXLWJPK_TUANDUI s1
group by group by
s1.`setdate` s1.`setdate`
...@@ -76,7 +76,7 @@ select ...@@ -76,7 +76,7 @@ select
,'/',s1.`LEVEL2COMCODE` ,'/',s1.`LEVEL2COMCODE`
) as `key` ) as `key`
,s1.`classcode` as `hkey` ,s1.`classcode` as `hkey`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `val` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `val`
from VIEW_ZB_DM_FXLWJPK_TUANDUI s1 from VIEW_ZB_DM_FXLWJPK_TUANDUI s1
group by group by
s1.`setdate` s1.`setdate`
...@@ -93,7 +93,7 @@ select ...@@ -93,7 +93,7 @@ select
,'/',s1.`LEVEL3COMCODE` ,'/',s1.`LEVEL3COMCODE`
) as `key` ) as `key`
,s1.`classcode` as `hkey` ,s1.`classcode` as `hkey`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `val` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `val`
from VIEW_ZB_DM_FXLWJPK_TUANDUI s1 from VIEW_ZB_DM_FXLWJPK_TUANDUI s1
group by group by
s1.`setdate` s1.`setdate`
...@@ -110,6 +110,6 @@ select ...@@ -110,6 +110,6 @@ select
,'/',s1.`LEVEL4COMCODE` ,'/',s1.`LEVEL4COMCODE`
) as `key` ) as `key`
,s1.`classcode` as `hkey` ,s1.`classcode` as `hkey`
,cast(s1.`cost` as DECIMAL(18,2)) as `val` ,cast(s1.`settledamount` as DECIMAL(18,2)) as `val`
from VIEW_ZB_DM_FXLWJPK_TUANDUI s1 from VIEW_ZB_DM_FXLWJPK_TUANDUI s1
; ;
\ No newline at end of file
...@@ -13,11 +13,11 @@ SELECT ...@@ -13,11 +13,11 @@ SELECT
,s1.`LEVEL2COMCODE` as `LEVEL2COMCODE` ,s1.`LEVEL2COMCODE` as `LEVEL2COMCODE`
,s1.`LEVEL3COMCODE` as `LEVEL3COMCODE` ,s1.`LEVEL3COMCODE` as `LEVEL3COMCODE`
,s1.`LEVEL4COMCODE` as `LEVEL4COMCODE` ,s1.`LEVEL4COMCODE` as `LEVEL4COMCODE`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `cost` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `settledamount`
from ( from (
select select
* *
,ROW_NUMBER() OVER(PARTITION BY `no`,`COMCODE`,`cost` ORDER BY `setdate` DESC) as rownum ,ROW_NUMBER() OVER(PARTITION BY `no`,`COMCODE`,`settledamount` ORDER BY `setdate` DESC) as rownum
from ZB_ODS.ZB_ODS_KAFKA.LPDATA from ZB_ODS.ZB_ODS_KAFKA.LPDATA
where where
`COMNAME` is not null `COMNAME` is not null
...@@ -40,7 +40,7 @@ select ...@@ -40,7 +40,7 @@ select
'allyjpk/' 'allyjpk/'
,s1.`setdate` ,s1.`setdate`
) as `key` ) as `key`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `val` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `val`
from VIEW_ZB_DM_YJPK_TUANDUI s1 from VIEW_ZB_DM_YJPK_TUANDUI s1
group by group by
s1.`setdate` s1.`setdate`
...@@ -54,7 +54,7 @@ select ...@@ -54,7 +54,7 @@ select
,s1.`setdate` ,s1.`setdate`
) as `key` ) as `key`
,s1.`LEVEL1COMCODE` as `hkey` ,s1.`LEVEL1COMCODE` as `hkey`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `val` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `val`
from VIEW_ZB_DM_YJPK_TUANDUI s1 from VIEW_ZB_DM_YJPK_TUANDUI s1
group by group by
s1.`setdate` s1.`setdate`
...@@ -69,7 +69,7 @@ select ...@@ -69,7 +69,7 @@ select
,s1.`setdate` ,s1.`setdate`
) as `key` ) as `key`
,s1.`LEVEL2COMCODE` as `hkey` ,s1.`LEVEL2COMCODE` as `hkey`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `val` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `val`
from VIEW_ZB_DM_YJPK_TUANDUI s1 from VIEW_ZB_DM_YJPK_TUANDUI s1
group by group by
s1.`setdate` s1.`setdate`
...@@ -85,7 +85,7 @@ select ...@@ -85,7 +85,7 @@ select
,s1.`setdate` ,s1.`setdate`
) as `key` ) as `key`
,s1.`LEVEL3COMCODE` as `hkey` ,s1.`LEVEL3COMCODE` as `hkey`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `val` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `val`
from VIEW_ZB_DM_YJPK_TUANDUI s1 from VIEW_ZB_DM_YJPK_TUANDUI s1
group by group by
s1.`setdate` s1.`setdate`
...@@ -101,6 +101,6 @@ select ...@@ -101,6 +101,6 @@ select
,s1.`setdate` ,s1.`setdate`
) as `key` ) as `key`
,s1.`LEVEL4COMCODE` as `hkey` ,s1.`LEVEL4COMCODE` as `hkey`
,cast(s1.`cost` as DECIMAL(18,2)) as `val` ,cast(s1.`settledamount` as DECIMAL(18,2)) as `val`
from VIEW_ZB_DM_YJPK_TUANDUI s1 from VIEW_ZB_DM_YJPK_TUANDUI s1
; ;
\ No newline at end of file
...@@ -13,11 +13,11 @@ SELECT ...@@ -13,11 +13,11 @@ SELECT
,s1.`LEVEL2COMCODE` as `LEVEL2COMCODE` ,s1.`LEVEL2COMCODE` as `LEVEL2COMCODE`
,s1.`LEVEL3COMCODE` as `LEVEL3COMCODE` ,s1.`LEVEL3COMCODE` as `LEVEL3COMCODE`
,s1.`LEVEL4COMCODE` as `LEVEL4COMCODE` ,s1.`LEVEL4COMCODE` as `LEVEL4COMCODE`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `cost` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `settledamount`
from ( from (
select select
* *
,ROW_NUMBER() OVER(PARTITION BY `no`,`COMCODE`,`cost` ORDER BY `setdate` DESC) as rownum ,ROW_NUMBER() OVER(PARTITION BY `no`,`COMCODE`,`settledamount` ORDER BY `setdate` DESC) as rownum
from ZB_ODS.ZB_ODS_KAFKA.LPDATA from ZB_ODS.ZB_ODS_KAFKA.LPDATA
where where
`COMNAME` is not null `COMNAME` is not null
...@@ -40,7 +40,7 @@ select ...@@ -40,7 +40,7 @@ select
'allwjpk/' 'allwjpk/'
,s1.`setdate` ,s1.`setdate`
) as `key` ) as `key`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `val` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `val`
from VIEW_ZB_DM_WJPK_TUANDUI s1 from VIEW_ZB_DM_WJPK_TUANDUI s1
group by group by
s1.`setdate` s1.`setdate`
...@@ -54,7 +54,7 @@ select ...@@ -54,7 +54,7 @@ select
,s1.`setdate` ,s1.`setdate`
) as `key` ) as `key`
,s1.`LEVEL1COMCODE` as `hkey` ,s1.`LEVEL1COMCODE` as `hkey`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `val` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `val`
from VIEW_ZB_DM_WJPK_TUANDUI s1 from VIEW_ZB_DM_WJPK_TUANDUI s1
group by group by
s1.`setdate` s1.`setdate`
...@@ -69,7 +69,7 @@ select ...@@ -69,7 +69,7 @@ select
,s1.`setdate` ,s1.`setdate`
) as `key` ) as `key`
,s1.`LEVEL2COMCODE` as `hkey` ,s1.`LEVEL2COMCODE` as `hkey`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `val` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `val`
from VIEW_ZB_DM_WJPK_TUANDUI s1 from VIEW_ZB_DM_WJPK_TUANDUI s1
group by group by
s1.`setdate` s1.`setdate`
...@@ -85,7 +85,7 @@ select ...@@ -85,7 +85,7 @@ select
,s1.`setdate` ,s1.`setdate`
) as `key` ) as `key`
,s1.`LEVEL3COMCODE` as `hkey` ,s1.`LEVEL3COMCODE` as `hkey`
,sum(cast(s1.`cost` as DECIMAL(18,2))) as `val` ,sum(cast(s1.`settledamount` as DECIMAL(18,2))) as `val`
from VIEW_ZB_DM_WJPK_TUANDUI s1 from VIEW_ZB_DM_WJPK_TUANDUI s1
group by group by
s1.`setdate` s1.`setdate`
...@@ -101,6 +101,6 @@ select ...@@ -101,6 +101,6 @@ select
,s1.`setdate` ,s1.`setdate`
) as `key` ) as `key`
,s1.`LEVEL4COMCODE` as `hkey` ,s1.`LEVEL4COMCODE` as `hkey`
,cast(s1.`cost` as DECIMAL(18,2)) as `val` ,cast(s1.`settledamount` as DECIMAL(18,2)) as `val`
from VIEW_ZB_DM_WJPK_TUANDUI s1 from VIEW_ZB_DM_WJPK_TUANDUI s1
; ;
\ No newline at end of file
...@@ -23,7 +23,7 @@ create table LPDATA( ...@@ -23,7 +23,7 @@ create table LPDATA(
`chnlname` String ,-- 业务渠道名称 `chnlname` String ,-- 业务渠道名称
`cladate` String ,-- 立案日期 `cladate` String ,-- 立案日期
`setdate` String ,-- 结案日期/估损调整日期 `setdate` String ,-- 结案日期/估损调整日期
`cost` String ,-- 已决赔款金额/估损提转差 `settledamount` String ,-- 已决赔款金额/估损提转差
`lossamout` String ,-- 估损金额 `lossamout` String ,-- 估损金额
`flag` String ,-- 类型 `flag` String ,-- 类型
`claimno` String ,-- 赔案号 `claimno` String ,-- 赔案号
......
...@@ -7,7 +7,7 @@ create table WJPK( ...@@ -7,7 +7,7 @@ create table WJPK(
businessChannelCode String ,-- 渠道 businessChannelCode String ,-- 渠道
cladate String ,-- 立案日期 cladate String ,-- 立案日期
setdate String ,-- 结案日期 setdate String ,-- 结案日期
cost String ,-- 已决赔款金额 settledamount String ,-- 已决赔款金额
lossamout String ,-- 估损金额 lossamout String ,-- 估损金额
flag String ,-- 类型 flag String ,-- 类型
claimno String ,-- 赔案号 claimno String ,-- 赔案号
......
...@@ -7,7 +7,7 @@ create table YJPK( ...@@ -7,7 +7,7 @@ create table YJPK(
businessChannelCode String ,-- 渠道 businessChannelCode String ,-- 渠道
cladate String ,-- 立案日期 cladate String ,-- 立案日期
setdate String ,-- 结案日期 setdate String ,-- 结案日期
cost String ,-- 已决赔款金额 settledamount String ,-- 已决赔款金额
lossamout String ,-- 估损金额 lossamout String ,-- 估损金额
flag String ,-- 类型 flag String ,-- 类型
claimno String ,-- 赔案号 claimno String ,-- 赔案号
......
...@@ -24,7 +24,7 @@ select ...@@ -24,7 +24,7 @@ select
,t2.NEWCHNLTYPEDESC as `chnlname` -- ,t2.NEWCHNLTYPEDESC as `chnlname` --
,s1.cladate as `cladate` -- 立案日期 ,s1.cladate as `cladate` -- 立案日期
,s1.setdate as `setdate` -- 结案日期/估损调整日期 ,s1.setdate as `setdate` -- 结案日期/估损调整日期
,s1.cost as `cost` -- 已决赔款金额/估损提转差 ,s1.settledamount as `settledamount` -- 已决赔款金额/估损提转差
,s1.lossamout as `lossamout` -- 估损金额 ,s1.lossamout as `lossamout` -- 估损金额
,s1.flag as `flag` -- 类型 ,s1.flag as `flag` -- 类型
,s1.claimno as `claimno` -- 赔案号 ,s1.claimno as `claimno` -- 赔案号
...@@ -37,7 +37,7 @@ from ( ...@@ -37,7 +37,7 @@ from (
,businessChannelCode as businessChannelCode -- 渠道 ,businessChannelCode as businessChannelCode -- 渠道
,left(replace(cladate,'-',''),6) as cladate -- 立案日期 ,left(replace(cladate,'-',''),6) as cladate -- 立案日期
,replace(setdate,'-','') as setdate -- 结案日期 ,replace(setdate,'-','') as setdate -- 结案日期
,cost as cost -- 已决赔款金额 ,settledamount as settledamount -- 已决赔款金额
,lossamout as lossamout -- 估损金额 ,lossamout as lossamout -- 估损金额
,flag as flag -- 类型 ,flag as flag -- 类型
,claimno as claimno -- 赔案号 ,claimno as claimno -- 赔案号
...@@ -54,7 +54,7 @@ from ( ...@@ -54,7 +54,7 @@ from (
,businessChannelCode as businessChannelCode -- 渠道 ,businessChannelCode as businessChannelCode -- 渠道
,left(replace(cladate,'-',''),6) as cladate -- 立案日期 ,left(replace(cladate,'-',''),6) as cladate -- 立案日期
,replace(setdate,'-','') as setdate -- 结案日期 ,replace(setdate,'-','') as setdate -- 结案日期
,cost as cost -- 估损提转差 ,settledamount as settledamount -- 估损提转差
,lossamout as lossamout -- 估损金额 ,lossamout as lossamout -- 估损金额
,flag as flag -- 类型 ,flag as flag -- 类型
,claimno as claimno -- 赔案号 ,claimno as claimno -- 赔案号
......
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