Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dataquality_doc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王东
dataquality_doc
Commits
525d5a7b
Commit
525d5a7b
authored
Aug 02, 2022
by
胡涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
指标统计sql脚本
parent
e666d7ca
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
90 deletions
+90
-90
ZB_DM/理赔指标/ZB_DM_车险未决大单.sql
ZB_DM/理赔指标/ZB_DM_车险未决大单.sql
+45
-45
ZB_DM/理赔指标/ZB_DM_非车险未决大单.sql
ZB_DM/理赔指标/ZB_DM_非车险未决大单.sql
+45
-45
数据模型表定义.xlsx
数据模型表定义.xlsx
+0
-0
No files found.
ZB_DM/理赔指标/ZB_DM_车险未决大单.sql
View file @
525d5a7b
...
...
@@ -11,17 +11,17 @@ select
)
as
`key`
,
CastToJsonArrayUDF
(
listagg
(
concat
(
'com'
,
':'
,
`com`
,
','
,
'maincom'
,
':'
,
`maincom`
,
','
,
'no'
,
':'
,
`no`
,
','
,
'claimno'
,
':'
,
`claimno`
,
','
,
'cost'
,
':'
,
`cost`
,
','
,
'comname'
,
':'
,
`comname`
,
','
,
'chnl'
,
':'
,
`chnl`
,
','
,
'mainkey'
,
':'
,
`mainkey`
,
','
,
'riskname'
,
':'
,
`riskname`
,
','
,
'chnlname'
,
':'
,
`chnlname`
,
','
,
'risk'
,
':'
,
`risk`
'com'
,
':'
,
s1
.
`com`
,
','
,
'maincom'
,
':'
,
s1
.
`maincom`
,
','
,
'no'
,
':'
,
s1
.
`no`
,
','
,
'claimno'
,
':'
,
s1
.
`claimno`
,
','
,
'cost'
,
':'
,
s1
.
`cost`
,
','
,
'comname'
,
':'
,
s1
.
`comname`
,
','
,
'chnl'
,
':'
,
s1
.
`chnl`
,
','
,
'mainkey'
,
':'
,
s1
.
`mainkey`
,
','
,
'riskname'
,
':'
,
s1
.
`riskname`
,
','
,
'chnlname'
,
':'
,
s1
.
`chnlname`
,
','
,
'risk'
,
':'
,
s1
.
`risk`
),
';'
)
)
as
`val`
from
(
...
...
@@ -38,7 +38,7 @@ from (
,
d1
.
`cost`
as
`cost`
,
d1
.
`chnl`
as
`chnl`
,
d1
.
`chnlname`
as
`chnlname`
,
C
AST
(
d1
.
`LEVEL1COMCODE`
,
d1
.
`claimno`
,
d1
.
`no`
)
as
`mainkey`
,
C
ONCAT
(
d1
.
`LEVEL1COMCODE`
,
'/'
,
d1
.
`claimno`
,
'/'
,
d1
.
`no`
)
as
`mainkey`
,
d1
.
`risk`
as
`risk`
,
d1
.
`riskname`
as
`riskname`
,
ROW_NUMBER
()
OVER
(
PARTITION
BY
d1
.
`setdate`
ORDER
BY
d1
.
`lossamout`
DESC
)
as
rownum
...
...
@@ -46,7 +46,7 @@ from (
where
d1
.
`COMNAME`
is
not
null
and
d1
.
`flag`
=
'wj'
and
LEFT
(
s
1
.
`setdate`
,
8
)
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
and
LEFT
(
d
1
.
`setdate`
,
8
)
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
and
LEFT
(
d1
.
`risk`
,
2
)
=
'05'
)
c1
where
c1
.
rownum
<=
20
...
...
@@ -70,19 +70,19 @@ select
)
as
`key`
,
CastToJsonArrayUDF
(
listagg
(
concat
(
'com'
,
':'
,
`com`
,
','
,
'maincom'
,
':'
,
`maincom`
,
','
,
'city'
,
':'
,
`city`
,
','
,
'cityname'
,
':'
,
`cityname`
,
','
,
'no'
,
':'
,
`no`
,
','
,
'claimno'
,
':'
,
`claimno`
,
','
,
'cost'
,
':'
,
`cost`
,
','
,
'comname'
,
':'
,
`comname`
,
','
,
'chnl'
,
':'
,
`chnl`
,
','
,
'mainkey'
,
':'
,
`mainkey`
,
','
,
'riskname'
,
':'
,
`riskname`
,
','
,
'chnlname'
,
':'
,
`chnlname`
,
','
,
'risk'
,
':'
,
`risk`
'com'
,
':'
,
s1
.
`com`
,
','
,
'maincom'
,
':'
,
s1
.
`maincom`
,
','
,
'city'
,
':'
,
s1
.
`city`
,
','
,
'cityname'
,
':'
,
s1
.
`cityname`
,
','
,
'no'
,
':'
,
s1
.
`no`
,
','
,
'claimno'
,
':'
,
s1
.
`claimno`
,
','
,
'cost'
,
':'
,
s1
.
`cost`
,
','
,
'comname'
,
':'
,
s1
.
`comname`
,
','
,
'chnl'
,
':'
,
s1
.
`chnl`
,
','
,
'mainkey'
,
':'
,
s1
.
`mainkey`
,
','
,
'riskname'
,
':'
,
s1
.
`riskname`
,
','
,
'chnlname'
,
':'
,
s1
.
`chnlname`
,
','
,
'risk'
,
':'
,
s1
.
`risk`
),
';'
)
)
as
`val`
from
(
...
...
@@ -102,7 +102,7 @@ from (
,
d1
.
`cost`
as
`cost`
,
d1
.
`chnl`
as
`chnl`
,
d1
.
`chnlname`
as
`chnlname`
,
C
AST
(
d1
.
`LEVEL1COMCODE`
,
d1
.
`claimno`
,
d1
.
`no`
)
as
`mainkey`
,
C
ONCAT
(
d1
.
`LEVEL1COMCODE`
,
'/'
,
d1
.
`claimno`
,
'/'
,
d1
.
`no`
)
as
`mainkey`
,
d1
.
`risk`
as
`risk`
,
d1
.
`riskname`
as
`riskname`
,
ROW_NUMBER
()
OVER
(
PARTITION
BY
d1
.
`LEVEL1COMCODE`
,
d1
.
`setdate`
ORDER
BY
d1
.
`lossamout`
DESC
)
as
rownum
...
...
@@ -110,7 +110,7 @@ from (
where
d1
.
`COMNAME`
is
not
null
and
d1
.
`flag`
=
'wj'
and
LEFT
(
s
1
.
`setdate`
,
8
)
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
and
LEFT
(
d
1
.
`setdate`
,
8
)
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
and
LEFT
(
d1
.
`risk`
,
2
)
=
'05'
)
c1
where
c1
.
rownum
<=
20
...
...
@@ -134,21 +134,21 @@ select
)
as
`key`
,
CastToJsonArrayUDF
(
listagg
(
concat
(
'com'
,
':'
,
`com`
,
','
,
'maincom'
,
':'
,
`maincom`
,
','
,
'city'
,
':'
,
`city`
,
','
,
'cityname'
,
':'
,
`cityname`
,
','
,
'country'
,
':'
,
`country`
,
','
,
'countryname'
,
':'
,
`countryname`
,
','
,
'no'
,
':'
,
`no`
,
','
,
'claimno'
,
':'
,
`claimno`
,
','
,
'cost'
,
':'
,
`cost`
,
','
,
'comname'
,
':'
,
`comname`
,
','
,
'chnl'
,
':'
,
`chnl`
,
','
,
'mainkey'
,
':'
,
`mainkey`
,
','
,
'riskname'
,
':'
,
`riskname`
,
','
,
'chnlname'
,
':'
,
`chnlname`
,
','
,
'risk'
,
':'
,
`risk`
'com'
,
':'
,
s1
.
`com`
,
','
,
'maincom'
,
':'
,
s1
.
`maincom`
,
','
,
'city'
,
':'
,
s1
.
`city`
,
','
,
'cityname'
,
':'
,
s1
.
`cityname`
,
','
,
'country'
,
':'
,
s1
.
`country`
,
','
,
'countryname'
,
':'
,
s1
.
`countryname`
,
','
,
'no'
,
':'
,
s1
.
`no`
,
','
,
'claimno'
,
':'
,
s1
.
`claimno`
,
','
,
'cost'
,
':'
,
s1
.
`cost`
,
','
,
'comname'
,
':'
,
s1
.
`comname`
,
','
,
'chnl'
,
':'
,
s1
.
`chnl`
,
','
,
'mainkey'
,
':'
,
s1
.
`mainkey`
,
','
,
'riskname'
,
':'
,
s1
.
`riskname`
,
','
,
'chnlname'
,
':'
,
s1
.
`chnlname`
,
','
,
'risk'
,
':'
,
s1
.
`risk`
),
';'
)
)
as
`val`
from
(
...
...
@@ -170,7 +170,7 @@ from (
,
d1
.
`cost`
as
`cost`
,
d1
.
`chnl`
as
`chnl`
,
d1
.
`chnlname`
as
`chnlname`
,
C
AST
(
d1
.
`LEVEL1COMCODE`
,
d1
.
`claimno`
,
d1
.
`no`
)
as
`mainkey`
,
C
ONCAT
(
d1
.
`LEVEL1COMCODE`
,
'/'
,
d1
.
`claimno`
,
'/'
,
d1
.
`no`
)
as
`mainkey`
,
d1
.
`risk`
as
`risk`
,
d1
.
`riskname`
as
`riskname`
,
ROW_NUMBER
()
OVER
(
PARTITION
BY
d1
.
`LEVEL2COMCODE`
,
d1
.
`setdate`
ORDER
BY
d1
.
`lossamout`
DESC
)
as
rownum
...
...
@@ -178,7 +178,7 @@ from (
where
d1
.
`COMNAME`
is
not
null
and
d1
.
`flag`
=
'wj'
and
LEFT
(
s
1
.
`setdate`
,
8
)
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
and
LEFT
(
d
1
.
`setdate`
,
8
)
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
and
LEFT
(
d1
.
`risk`
,
2
)
=
'05'
)
c1
where
c1
.
rownum
<=
20
...
...
ZB_DM/理赔指标/ZB_DM_非车险未决大单.sql
View file @
525d5a7b
...
...
@@ -11,17 +11,17 @@ select
)
as
`key`
,
CastToJsonArrayUDF
(
listagg
(
concat
(
'com'
,
':'
,
`com`
,
','
,
'maincom'
,
':'
,
`maincom`
,
','
,
'no'
,
':'
,
`no`
,
','
,
'claimno'
,
':'
,
`claimno`
,
','
,
'cost'
,
':'
,
`cost`
,
','
,
'comname'
,
':'
,
`comname`
,
','
,
'chnl'
,
':'
,
`chnl`
,
','
,
'mainkey'
,
':'
,
`mainkey`
,
','
,
'riskname'
,
':'
,
`riskname`
,
','
,
'chnlname'
,
':'
,
`chnlname`
,
','
,
'risk'
,
':'
,
`risk`
'com'
,
':'
,
s1
.
`com`
,
','
,
'maincom'
,
':'
,
s1
.
`maincom`
,
','
,
'no'
,
':'
,
s1
.
`no`
,
','
,
'claimno'
,
':'
,
s1
.
`claimno`
,
','
,
'cost'
,
':'
,
s1
.
`cost`
,
','
,
'comname'
,
':'
,
s1
.
`comname`
,
','
,
'chnl'
,
':'
,
s1
.
`chnl`
,
','
,
'mainkey'
,
':'
,
s1
.
`mainkey`
,
','
,
'riskname'
,
':'
,
s1
.
`riskname`
,
','
,
'chnlname'
,
':'
,
s1
.
`chnlname`
,
','
,
'risk'
,
':'
,
s1
.
`risk`
),
';'
)
)
as
`val`
from
(
...
...
@@ -38,7 +38,7 @@ from (
,
d1
.
`cost`
as
`cost`
,
d1
.
`chnl`
as
`chnl`
,
d1
.
`chnlname`
as
`chnlname`
,
C
AST
(
d1
.
`LEVEL1COMCODE`
,
d1
.
`claimno`
,
d1
.
`no`
)
as
`mainkey`
,
C
ONCAT
(
d1
.
`LEVEL1COMCODE`
,
'/'
,
d1
.
`claimno`
,
'/'
,
d1
.
`no`
)
as
`mainkey`
,
d1
.
`risk`
as
`risk`
,
d1
.
`riskname`
as
`riskname`
,
ROW_NUMBER
()
OVER
(
PARTITION
BY
d1
.
`setdate`
ORDER
BY
d1
.
`lossamout`
DESC
)
as
rownum
...
...
@@ -46,7 +46,7 @@ from (
where
d1
.
`COMNAME`
is
not
null
and
d1
.
`flag`
=
'wj'
and
LEFT
(
s
1
.
`setdate`
,
8
)
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
and
LEFT
(
d
1
.
`setdate`
,
8
)
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
and
LEFT
(
d1
.
`risk`
,
2
)
<>
'05'
)
c1
where
c1
.
rownum
<=
20
...
...
@@ -70,19 +70,19 @@ select
)
as
`key`
,
CastToJsonArrayUDF
(
listagg
(
concat
(
'com'
,
':'
,
`com`
,
','
,
'maincom'
,
':'
,
`maincom`
,
','
,
'city'
,
':'
,
`city`
,
','
,
'cityname'
,
':'
,
`cityname`
,
','
,
'no'
,
':'
,
`no`
,
','
,
'claimno'
,
':'
,
`claimno`
,
','
,
'cost'
,
':'
,
`cost`
,
','
,
'comname'
,
':'
,
`comname`
,
','
,
'chnl'
,
':'
,
`chnl`
,
','
,
'mainkey'
,
':'
,
`mainkey`
,
','
,
'riskname'
,
':'
,
`riskname`
,
','
,
'chnlname'
,
':'
,
`chnlname`
,
','
,
'risk'
,
':'
,
`risk`
'com'
,
':'
,
s1
.
`com`
,
','
,
'maincom'
,
':'
,
s1
.
`maincom`
,
','
,
'city'
,
':'
,
s1
.
`city`
,
','
,
'cityname'
,
':'
,
s1
.
`cityname`
,
','
,
'no'
,
':'
,
s1
.
`no`
,
','
,
'claimno'
,
':'
,
s1
.
`claimno`
,
','
,
'cost'
,
':'
,
s1
.
`cost`
,
','
,
'comname'
,
':'
,
s1
.
`comname`
,
','
,
'chnl'
,
':'
,
s1
.
`chnl`
,
','
,
'mainkey'
,
':'
,
s1
.
`mainkey`
,
','
,
'riskname'
,
':'
,
s1
.
`riskname`
,
','
,
'chnlname'
,
':'
,
s1
.
`chnlname`
,
','
,
'risk'
,
':'
,
s1
.
`risk`
),
';'
)
)
as
`val`
from
(
...
...
@@ -102,7 +102,7 @@ from (
,
d1
.
`cost`
as
`cost`
,
d1
.
`chnl`
as
`chnl`
,
d1
.
`chnlname`
as
`chnlname`
,
C
AST
(
d1
.
`LEVEL1COMCODE`
,
d1
.
`claimno`
,
d1
.
`no`
)
as
`mainkey`
,
C
ONCAT
(
d1
.
`LEVEL1COMCODE`
,
'/'
,
d1
.
`claimno`
,
'/'
,
d1
.
`no`
)
as
`mainkey`
,
d1
.
`risk`
as
`risk`
,
d1
.
`riskname`
as
`riskname`
,
ROW_NUMBER
()
OVER
(
PARTITION
BY
d1
.
`LEVEL1COMCODE`
,
d1
.
`setdate`
ORDER
BY
d1
.
`lossamout`
DESC
)
as
rownum
...
...
@@ -110,7 +110,7 @@ from (
where
d1
.
`COMNAME`
is
not
null
and
d1
.
`flag`
=
'wj'
and
LEFT
(
s
1
.
`setdate`
,
8
)
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
and
LEFT
(
d
1
.
`setdate`
,
8
)
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
and
LEFT
(
d1
.
`risk`
,
2
)
<>
'05'
)
c1
where
c1
.
rownum
<=
20
...
...
@@ -134,21 +134,21 @@ select
)
as
`key`
,
CastToJsonArrayUDF
(
listagg
(
concat
(
'com'
,
':'
,
`com`
,
','
,
'maincom'
,
':'
,
`maincom`
,
','
,
'city'
,
':'
,
`city`
,
','
,
'cityname'
,
':'
,
`cityname`
,
','
,
'country'
,
':'
,
`country`
,
','
,
'countryname'
,
':'
,
`countryname`
,
','
,
'no'
,
':'
,
`no`
,
','
,
'claimno'
,
':'
,
`claimno`
,
','
,
'cost'
,
':'
,
`cost`
,
','
,
'comname'
,
':'
,
`comname`
,
','
,
'chnl'
,
':'
,
`chnl`
,
','
,
'mainkey'
,
':'
,
`mainkey`
,
','
,
'riskname'
,
':'
,
`riskname`
,
','
,
'chnlname'
,
':'
,
`chnlname`
,
','
,
'risk'
,
':'
,
`risk`
'com'
,
':'
,
s1
.
`com`
,
','
,
'maincom'
,
':'
,
s1
.
`maincom`
,
','
,
'city'
,
':'
,
s1
.
`city`
,
','
,
'cityname'
,
':'
,
s1
.
`cityname`
,
','
,
'country'
,
':'
,
s1
.
`country`
,
','
,
'countryname'
,
':'
,
s1
.
`countryname`
,
','
,
'no'
,
':'
,
s1
.
`no`
,
','
,
'claimno'
,
':'
,
s1
.
`claimno`
,
','
,
'cost'
,
':'
,
s1
.
`cost`
,
','
,
'comname'
,
':'
,
s1
.
`comname`
,
','
,
'chnl'
,
':'
,
s1
.
`chnl`
,
','
,
'mainkey'
,
':'
,
s1
.
`mainkey`
,
','
,
'riskname'
,
':'
,
s1
.
`riskname`
,
','
,
'chnlname'
,
':'
,
s1
.
`chnlname`
,
','
,
'risk'
,
':'
,
s1
.
`risk`
),
';'
)
)
as
`val`
from
(
...
...
@@ -170,7 +170,7 @@ from (
,
d1
.
`cost`
as
`cost`
,
d1
.
`chnl`
as
`chnl`
,
d1
.
`chnlname`
as
`chnlname`
,
C
AST
(
d1
.
`LEVEL1COMCODE`
,
d1
.
`claimno`
,
d1
.
`no`
)
as
`mainkey`
,
C
ONCAT
(
d1
.
`LEVEL1COMCODE`
,
'/'
,
d1
.
`claimno`
,
'/'
,
d1
.
`no`
)
as
`mainkey`
,
d1
.
`risk`
as
`risk`
,
d1
.
`riskname`
as
`riskname`
,
ROW_NUMBER
()
OVER
(
PARTITION
BY
d1
.
`LEVEL2COMCODE`
,
d1
.
`setdate`
ORDER
BY
d1
.
`lossamout`
DESC
)
as
rownum
...
...
@@ -178,7 +178,7 @@ from (
where
d1
.
`COMNAME`
is
not
null
and
d1
.
`flag`
=
'wj'
and
LEFT
(
s
1
.
`setdate`
,
8
)
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
and
LEFT
(
d
1
.
`setdate`
,
8
)
=
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyyMMdd'
)
and
LEFT
(
d1
.
`risk`
,
2
)
<>
'05'
)
c1
where
c1
.
rownum
<=
20
...
...
数据模型表定义.xlsx
View file @
525d5a7b
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment