Commit 70f661eb authored by 胡涛's avatar 胡涛

指标统计sql脚本

parent f56b3e5c
......@@ -42,7 +42,7 @@ group by
;
-- 分公司
insert into ZB_DM.ZB_DM_REDIS.HSET_DECIAML
insert into ZB_DM.ZB_DM_REDIS.HSET_DECIMAL
select
CONCAT(
'provqbbf/'
......@@ -57,7 +57,7 @@ group by
;
-- 中支
insert into ZB_DM.ZB_DM_REDIS.HSET_DECIAML
insert into ZB_DM.ZB_DM_REDIS.HSET_DECIMAL
select
CONCAT(
'cityqbbf/'
......@@ -73,7 +73,7 @@ group by
-- 县支
insert into ZB_DM.ZB_DM_REDIS.HSET_DECIAML
insert into ZB_DM.ZB_DM_REDIS.HSET_DECIMAL
select
CONCAT(
'countryqbbf/'
......@@ -89,7 +89,7 @@ group by
-- 团队
insert into ZB_DM.ZB_DM_REDIS.HSET_DECIAML
insert into ZB_DM.ZB_DM_REDIS.HSET_DECIMAL
select
CONCAT(
'teamqbbf/'
......
......@@ -30,7 +30,7 @@ from (
,d1.`LEVEL1COMDESC` as `comname`
,d1.`id` as `id`
,d1.`name` as `name`
,d1.`cost` as `cost`
,cast(d1.`cost` AS VARCHAR ) as `cost`
,ROW_NUMBER() OVER(PARTITION BY d1.`uwConclueDate` ORDER BY d1.`cost` DESC) as rownum
from (
select
......@@ -39,7 +39,7 @@ from (
,`LEVEL1COMDESC` as `LEVEL1COMDESC`
,`id` as `id`
,`name` as `name`
,sum(`cost`) as `cost`
,sum(cast(`cost` as DECIMAL(18,2))) as `cost`
from ZB_ODS.ZB_ODS_KAFKA.CBDATA
where
`COMNAME` is not null
......@@ -95,7 +95,7 @@ from (
,d1.`LEVEL2COMDESC` as `cityname`
,d1.`id` as `id`
,d1.`name` as `name`
,d1.`cost` as `cost`
,cast(d1.`cost` AS VARCHAR ) as `cost`
,ROW_NUMBER() OVER(PARTITION BY d1.`uwConclueDate`,d1.`LEVEL1COMCODE` ORDER BY d1.`cost` DESC) as rownum
from (
select
......@@ -106,7 +106,7 @@ from (
,`LEVEL2COMDESC` as `LEVEL2COMDESC`
,`id` as `id`
,`name` as `name`
,sum(`cost`) as `cost`
,sum(cast(`cost` as DECIMAL(18,2))) as `cost`
from ZB_ODS.ZB_ODS_KAFKA.CBDATA
where
`COMNAME` is not null
......@@ -168,7 +168,7 @@ from (
,d1.`LEVEL3COMDESC` as `countryname`
,d1.`id` as `id`
,d1.`name` as `name`
,d1.`cost` as `cost`
,cast(d1.`cost` AS VARCHAR ) as `cost`
,ROW_NUMBER() OVER(PARTITION BY d1.`uwConclueDate`,d1.`LEVEL2COMCODE` ORDER BY d1.`cost` DESC) as rownum
from (
select
......@@ -181,7 +181,7 @@ from (
,`LEVEL3COMDESC` as `LEVEL3COMDESC`
,`id` as `id`
,`name` as `name`
,sum(`cost`) as `cost`
,sum(cast(`cost` as DECIMAL(18,2))) as `cost`
from ZB_ODS.ZB_ODS_KAFKA.CBDATA
where
`COMNAME` is not null
......
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