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
d6d5c7da
Commit
d6d5c7da
authored
Sep 28, 2022
by
王东
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
指标计算承保字段调整
parent
029e1efd
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
9 deletions
+17
-9
ZB_CK/数据存储差异清单导出/ZB_CK_CHECK_CBDATA.sql
ZB_CK/数据存储差异清单导出/ZB_CK_CHECK_CBDATA.sql
+2
-1
ZB_CK/数据存储差异清单导出/ZB_CK_CHECK_WEBSERVICE.sql
ZB_CK/数据存储差异清单导出/ZB_CK_CHECK_WEBSERVICE.sql
+5
-2
ZB_ODS/DDL元数据/LPDATA.sql
ZB_ODS/DDL元数据/LPDATA.sql
+2
-0
ZB_ODS/ZB_ODS_CBDATA.sql
ZB_ODS/ZB_ODS_CBDATA.sql
+2
-4
ZB_ODS/ZB_ODS_LPDATA.sql
ZB_ODS/ZB_ODS_LPDATA.sql
+6
-2
No files found.
ZB_CK/数据存储差异清单导出/ZB_CK_CHECK_CBDATA.sql
View file @
d6d5c7da
...
@@ -126,5 +126,5 @@ left join (
...
@@ -126,5 +126,5 @@ left join (
on
s1
.
`no`
=
s2
.
BUSINESSNO
on
s1
.
`no`
=
s2
.
BUSINESSNO
and
s1
.
COMCODE
=
s2
.
COMCODE
and
s1
.
COMCODE
=
s2
.
COMCODE
and
cast
(
s1
.
cost
as
decimal
(
18
,
0
))
=
cast
(
s2
.
BAOFEI
as
decimal
(
18
,
0
))
and
cast
(
s1
.
cost
as
decimal
(
18
,
0
))
=
cast
(
s2
.
BAOFEI
as
decimal
(
18
,
0
))
where
s2
.
BUSINESSNO
is
null
where
s2
.
BUSINESSNO
is
null
;
;
\ No newline at end of file
ZB_CK/数据存储差异清单导出/ZB_CK_CHECK_WEBSERVICE.sql
View file @
d6d5c7da
...
@@ -119,6 +119,7 @@ select
...
@@ -119,6 +119,7 @@ select
from
(
from
(
select
*
from
ZB_CK
.
ZB_CK_ORACLE_ANAQUERY
.
WEB_REALTIME_BUSINESS_INFO
select
*
from
ZB_CK
.
ZB_CK_ORACLE_ANAQUERY
.
WEB_REALTIME_BUSINESS_INFO
where
UNDERWRITEENDDATE
like
concat
(
DATE_FORMAT
(
TIMESTAMPADD
(
DAY
,
-
1
,
LOCALTIMESTAMP
),
'yyyy-MM-dd'
),
'%'
)
where
UNDERWRITEENDDATE
like
concat
(
DATE_FORMAT
(
TIMESTAMPADD
(
DAY
,
-
1
,
LOCALTIMESTAMP
),
'yyyy-MM-dd'
),
'%'
)
and
LOADDATE
like
concat
(
DATE_FORMAT
(
TIMESTAMPADD
(
DAY
,
-
1
,
LOCALTIMESTAMP
),
'yyyy-MM-dd'
),
'%'
)
)
s2
)
s2
left
join
(
left
join
(
select
*
from
ZB_CK
.
ZB_CK_MYSQL
.
KAFKA_CBDATA
select
*
from
ZB_CK
.
ZB_CK_MYSQL
.
KAFKA_CBDATA
...
@@ -126,6 +127,8 @@ left join (
...
@@ -126,6 +127,8 @@ left join (
)
s1
)
s1
on
s1
.
`no`
=
s2
.
BUSINESSNO
on
s1
.
`no`
=
s2
.
BUSINESSNO
and
s1
.
COMCODE
=
s2
.
COMCODE
and
s1
.
COMCODE
=
s2
.
COMCODE
and
cast
(
s1
.
cost
as
decimal
(
18
,
0
))
=
cast
(
s2
.
BAOFEI
as
decimal
(
18
,
0
))
and
cast
(
s1
.
cost
as
decimal
(
18
,
2
))
-
cast
(
s2
.
BAOFEI
as
decimal
(
18
,
2
))
between
-
0
.
1
and
0
.
1
where
s1
.
`no`
is
null
where
s1
.
`no`
is
null
and
cast
(
s2
.
BAOFEI
as
decimal
(
18
,
2
))
>
0
;
;
ZB_ODS/DDL元数据/LPDATA.sql
View file @
d6d5c7da
...
@@ -28,5 +28,6 @@ create table LPDATA(
...
@@ -28,5 +28,6 @@ create table LPDATA(
`flag`
String
,
-- 类型
`flag`
String
,
-- 类型
`claimno`
String
,
-- 赔案号
`claimno`
String
,
-- 赔案号
`no`
String
,
-- 保单号
`no`
String
,
-- 保单号
log_time
String
)
)
;
;
\ No newline at end of file
ZB_ODS/ZB_ODS_CBDATA.sql
View file @
d6d5c7da
...
@@ -71,7 +71,7 @@ from (
...
@@ -71,7 +71,7 @@ from (
)
)
end
end
)
as
decimal
(
30
,
4
))
as
`cost`
-- 不含税保费
)
as
decimal
(
30
,
4
))
as
`cost`
-- 不含税保费
,
case
when
policyNo
is
not
null
then
policyNo
else
businessNo
end
as
`no`
-- 保单号
,
COALESCE
(
policyNo
,
businessNo
)
as
`no`
-- 保单号
,
case
,
case
when
LEFT
(
productCode
,
2
)
=
'05'
and
(
newPolicyFlag
=
'1'
or
autoTransrenewFlag
=
'1'
or
autoTransrenewFlag
=
'4'
or
transferPolicyFlag
=
'1'
or
transrenewFlag
=
'1'
or
transrenewFlag
=
'4'
)
then
'1'
when
LEFT
(
productCode
,
2
)
=
'05'
and
(
newPolicyFlag
=
'1'
or
autoTransrenewFlag
=
'1'
or
autoTransrenewFlag
=
'4'
or
transferPolicyFlag
=
'1'
or
transrenewFlag
=
'1'
or
transrenewFlag
=
'4'
)
then
'1'
when
LEFT
(
productCode
,
2
)
<>
'05'
and
(
newPolicyFlag
=
'0'
or
autoTransrenewFlag
=
'1'
or
autoTransrenewFlag
=
'4'
or
transferPolicyFlag
=
'2'
or
transrenewFlag
=
'1'
)
then
'1'
when
LEFT
(
productCode
,
2
)
<>
'05'
and
(
newPolicyFlag
=
'0'
or
autoTransrenewFlag
=
'1'
or
autoTransrenewFlag
=
'4'
or
transferPolicyFlag
=
'2'
or
transrenewFlag
=
'1'
)
then
'1'
...
@@ -115,7 +115,7 @@ from (
...
@@ -115,7 +115,7 @@ from (
)
)
end
end
)
as
decimal
(
30
,
4
))
as
`cost`
-- 不含税保费
)
as
decimal
(
30
,
4
))
as
`cost`
-- 不含税保费
,
case
when
endorseNo
is
not
null
then
endorseNo
else
businessNo
end
as
`no`
-- 批单号
,
COALESCE
(
endorseNo
,
businessNo
)
as
`no`
-- 批单号
,
case
,
case
when
LEFT
(
productCode
,
2
)
=
'05'
and
(
newPolicyFlag
=
'1'
or
autoTransrenewFlag
=
'1'
or
autoTransrenewFlag
=
'4'
or
transferPolicyFlag
=
'1'
or
transrenewFlag
=
'1'
or
transrenewFlag
=
'4'
)
then
'1'
when
LEFT
(
productCode
,
2
)
=
'05'
and
(
newPolicyFlag
=
'1'
or
autoTransrenewFlag
=
'1'
or
autoTransrenewFlag
=
'4'
or
transferPolicyFlag
=
'1'
or
transrenewFlag
=
'1'
or
transrenewFlag
=
'4'
)
then
'1'
when
LEFT
(
productCode
,
2
)
<>
'05'
and
(
newPolicyFlag
=
'0'
or
autoTransrenewFlag
=
'1'
or
autoTransrenewFlag
=
'4'
or
transferPolicyFlag
=
'2'
or
transrenewFlag
=
'1'
)
then
'1'
when
LEFT
(
productCode
,
2
)
<>
'05'
and
(
newPolicyFlag
=
'0'
or
autoTransrenewFlag
=
'1'
or
autoTransrenewFlag
=
'4'
or
transferPolicyFlag
=
'2'
or
transrenewFlag
=
'1'
)
then
'1'
...
@@ -134,8 +134,6 @@ left join ZB_ODS.ZB_ODS_MYSQL.CD_COM_ALL for system_time as of s1.proctime as t1
...
@@ -134,8 +134,6 @@ 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
-- 数据查重 入参:md5 出参:boolean 如果存在 返回true
where
DuplicateCheckingUDF
(
MD5
(
ConcatObjUDF
(
`no`
,
businessOffice
,
`cost`
)))
is
not
true
;
;
...
...
ZB_ODS/ZB_ODS_LPDATA.sql
View file @
d6d5c7da
...
@@ -29,6 +29,8 @@ select
...
@@ -29,6 +29,8 @@ select
,
s1
.
flag
as
`flag`
-- 类型
,
s1
.
flag
as
`flag`
-- 类型
,
s1
.
claimno
as
`claimno`
-- 赔案号
,
s1
.
claimno
as
`claimno`
-- 赔案号
,
s1
.
`no`
as
`no`
-- 保单号
,
s1
.
`no`
as
`no`
-- 保单号
,
DATE_FORMAT
(
LOCALTIMESTAMP
,
'yyyy-MM-dd HH:mm:ss'
)
as
log_time
from
(
from
(
select
select
businessOffice
as
businessOffice
-- 机构
businessOffice
as
businessOffice
-- 机构
...
@@ -39,7 +41,7 @@ from (
...
@@ -39,7 +41,7 @@ from (
,
replace
(
setdate
,
'-'
,
''
)
as
setdate
-- 结案日期
,
replace
(
setdate
,
'-'
,
''
)
as
setdate
-- 结案日期
,
settledamount
as
settledamount
-- 已决赔款金额
,
settledamount
as
settledamount
-- 已决赔款金额
,
lossamout
as
lossamout
-- 估损金额
,
lossamout
as
lossamout
-- 估损金额
,
flag
as
flag
-- 类型
,
'yj'
as
flag
-- 类型
,
claimno
as
claimno
-- 赔案号
,
claimno
as
claimno
-- 赔案号
,
`no`
as
`no`
-- 保单号
,
`no`
as
`no`
-- 保单号
,
proctime
as
proctime
,
proctime
as
proctime
...
@@ -56,7 +58,9 @@ from (
...
@@ -56,7 +58,9 @@ from (
,
replace
(
setdate
,
'-'
,
''
)
as
setdate
-- 估损调整日期
,
replace
(
setdate
,
'-'
,
''
)
as
setdate
-- 估损调整日期
,
settledamount
as
settledamount
-- 估损提转差
,
settledamount
as
settledamount
-- 估损提转差
,
lossamout
as
lossamout
-- 估损金额
,
lossamout
as
lossamout
-- 估损金额
,
flag
as
flag
-- 类型
,
case
when
flag
=
'wj'
then
'wj'
when
flag
=
'yjwj'
then
'yjwj'
else
'wj'
end
as
flag
-- 类型
,
claimno
as
claimno
-- 赔案号
,
claimno
as
claimno
-- 赔案号
,
`no`
as
`no`
-- 保单号
,
`no`
as
`no`
-- 保单号
,
proctime
as
proctime
,
proctime
as
proctime
...
...
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