|
@@ -72,6 +72,8 @@ replication 1;
|
|
|
|
|
|
|
|
|
|
==================================================初始化数据====================================================================
|
|
==================================================初始化数据====================================================================
|
|
|
|
+
|
|
|
|
+DROP SEQUENCE IF EXISTS globaleTripID_sequence;
|
|
CREATE OR REPLACE PROCEDURE init_partytimeline_main() -- 创建主存储过程
|
|
CREATE OR REPLACE PROCEDURE init_partytimeline_main() -- 创建主存储过程
|
|
IS
|
|
IS
|
|
DECLARE
|
|
DECLARE
|
|
@@ -82,13 +84,17 @@ BEGIN
|
|
init_insuranceclaimthread_edorlist(partytimeline_count)
|
|
init_insuranceclaimthread_edorlist(partytimeline_count)
|
|
partytimeline_count:=partytimeline_count+1;
|
|
partytimeline_count:=partytimeline_count+1;
|
|
--2.从保全表中初始化 参与事件
|
|
--2.从保全表中初始化 参与事件
|
|
- init_insuranceclaimthread_dorinfo(partytimeline_count)
|
|
|
|
|
|
+ init_insuranceclaimthread_edorinfo(partytimeline_count)
|
|
|
|
+ partytimeline_count:=partytimeline_count+1;
|
|
|
|
+ -- 3.初始化理赔相关信息
|
|
|
|
+ init_insuranceclaimthread_insuranceclaimthread(partytimeline_count)
|
|
|
|
+ partytimeline_count:=partytimeline_count+1;
|
|
|
|
+ -- 4.初始化投保赔相关信息
|
|
|
|
+ init_insuranceclaimthread_InsuranceArrangement(partytimeline_count)
|
|
partytimeline_count:=partytimeline_count+1;
|
|
partytimeline_count:=partytimeline_count+1;
|
|
-
|
|
|
|
|
|
|
|
-- 用于以后更新时是用的序列
|
|
-- 用于以后更新时是用的序列
|
|
strsql:='
|
|
strsql:='
|
|
- DROP SEQUENCE IF EXISTS globaleTripID_sequence;
|
|
|
|
CREATE SEQUENCE globaleTripID_sequence
|
|
CREATE SEQUENCE globaleTripID_sequence
|
|
INCREMENT BY 1
|
|
INCREMENT BY 1
|
|
START WITH '|| partytimeline_count||'
|
|
START WITH '|| partytimeline_count||'
|
|
@@ -96,7 +102,7 @@ BEGIN
|
|
NOMINVALUE
|
|
NOMINVALUE
|
|
NOCYCLE
|
|
NOCYCLE
|
|
CACHE 1;
|
|
CACHE 1;
|
|
- ';
|
|
|
|
|
|
+ '
|
|
|
|
|
|
EXECUTE IMMEDIATE strsql
|
|
EXECUTE IMMEDIATE strsql
|
|
|
|
|
|
@@ -188,9 +194,9 @@ BEGIN
|
|
PPhone
|
|
PPhone
|
|
) = (
|
|
) = (
|
|
select
|
|
select
|
|
- ApplicantID ,--客户等级
|
|
|
|
- AppCertID ,--贡献度分
|
|
|
|
- AppPhone--家庭加分
|
|
|
|
|
|
+ ApplicantID ,
|
|
|
|
+ AppCertID ,
|
|
|
|
+ AppPhone
|
|
from shanglifeecif.InsuranceArrangement b
|
|
from shanglifeecif.InsuranceArrangement b
|
|
where b.PolicyNo = a.contno
|
|
where b.PolicyNo = a.contno
|
|
) WHERE 1=1 ;
|
|
) WHERE 1=1 ;
|
|
@@ -218,7 +224,7 @@ BEGIN
|
|
PCertID,
|
|
PCertID,
|
|
PPhone,
|
|
PPhone,
|
|
'投保人',
|
|
'投保人',
|
|
- '投保',
|
|
|
|
|
|
+ '保全',
|
|
cusappdate,
|
|
cusappdate,
|
|
edoracceptno,
|
|
edoracceptno,
|
|
contno,
|
|
contno,
|
|
@@ -241,6 +247,10 @@ END;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+=============================================================================================================================================================
|
|
|
|
+============================================================根据edorinfo更新========================================================================================
|
|
|
|
+==========================================================================================================================================================
|
|
|
|
+
|
|
--------------------------------根据edorinfo更新 保全----------------------------------------
|
|
--------------------------------根据edorinfo更新 保全----------------------------------------
|
|
/*
|
|
/*
|
|
contno string DEFAULT NULL COMMENT '保单号',
|
|
contno string DEFAULT NULL COMMENT '保单号',
|
|
@@ -257,7 +267,7 @@ END;
|
|
EDORCVALIDATE string DEFAULT NULL COMMENT '保全生效日期 '
|
|
EDORCVALIDATE string DEFAULT NULL COMMENT '保全生效日期 '
|
|
*/
|
|
*/
|
|
|
|
|
|
-CREATE OR REPLACE PROCEDURE init_insuranceclaimthread_dorinfo(partytimeline_count OUT int)
|
|
|
|
|
|
+CREATE OR REPLACE PROCEDURE init_insuranceclaimthread_edorinfo(partytimeline_count OUT int)
|
|
IS
|
|
IS
|
|
BEGIN
|
|
BEGIN
|
|
--初始化临时表
|
|
--初始化临时表
|
|
@@ -265,30 +275,29 @@ BEGIN
|
|
insert into PartyTimeLine_edor_tmp(
|
|
insert into PartyTimeLine_edor_tmp(
|
|
id,
|
|
id,
|
|
contno,
|
|
contno,
|
|
- appntname,
|
|
|
|
- cusappdate,
|
|
|
|
- edoracceptno,
|
|
|
|
- edorvalidate
|
|
|
|
|
|
+ PPhone,
|
|
|
|
+ PCertID,
|
|
|
|
+ edoracceptno ,
|
|
|
|
+ edorvalidate
|
|
|
|
+
|
|
)
|
|
)
|
|
SELECT
|
|
SELECT
|
|
row_number()over(),
|
|
row_number()over(),
|
|
contno,
|
|
contno,
|
|
- appntname,
|
|
|
|
|
|
+ lcmobile,
|
|
|
|
+ lcidno,
|
|
EDORAPPDATE,
|
|
EDORAPPDATE,
|
|
- edoracceptno,
|
|
|
|
EDORCVALIDATE
|
|
EDORCVALIDATE
|
|
from shanghailifeecif.audit_edorlist;
|
|
from shanghailifeecif.audit_edorlist;
|
|
|
|
|
|
--更新临时表信息
|
|
--更新临时表信息
|
|
UPDATE PartyTimeLine_edor_tmp a SET (
|
|
UPDATE PartyTimeLine_edor_tmp a SET (
|
|
PartyID ,-- 参与方ID
|
|
PartyID ,-- 参与方ID
|
|
- PCertID ,-- 参与方证件号码
|
|
|
|
- PPhone
|
|
|
|
|
|
+ appntname
|
|
) = (
|
|
) = (
|
|
select
|
|
select
|
|
- ApplicantID ,--客户等级
|
|
|
|
- AppCertID ,--贡献度分
|
|
|
|
- AppPhone--家庭加分
|
|
|
|
|
|
+ ApplicantID ,
|
|
|
|
+ appname--投保人名称
|
|
from shanglifeecif.InsuranceArrangement b
|
|
from shanglifeecif.InsuranceArrangement b
|
|
where b.PolicyNo = a.contno
|
|
where b.PolicyNo = a.contno
|
|
) WHERE 1=1 ;
|
|
) WHERE 1=1 ;
|
|
@@ -310,13 +319,13 @@ BEGIN
|
|
CREATED_TIME
|
|
CREATED_TIME
|
|
)
|
|
)
|
|
SELECT
|
|
SELECT
|
|
- row_number()over(),
|
|
|
|
|
|
+ row_number()over() +partytimeline_count,
|
|
PartyID,
|
|
PartyID,
|
|
appntname,
|
|
appntname,
|
|
PCertID,
|
|
PCertID,
|
|
PPhone,
|
|
PPhone,
|
|
'投保人',
|
|
'投保人',
|
|
- '投保',
|
|
|
|
|
|
+ '保全',
|
|
cusappdate,
|
|
cusappdate,
|
|
edoracceptno,
|
|
edoracceptno,
|
|
contno,
|
|
contno,
|
|
@@ -332,20 +341,115 @@ BEGIN
|
|
|
|
|
|
EXCEPTION
|
|
EXCEPTION
|
|
WHEN HIVE_EXCEPTION THEN
|
|
WHEN HIVE_EXCEPTION THEN
|
|
- log_exception('init_insuranceclaimthread_dorinfo',sqlerrm(),sqlcode())
|
|
|
|
|
|
+ log_exception('init_insuranceclaimthread_edorinfo',sqlerrm(),sqlcode())
|
|
WHEN Others THEN
|
|
WHEN Others THEN
|
|
- log_exception('init_insuranceclaimthread_dorinfo',sqlerrm(),sqlcode())
|
|
|
|
|
|
+ log_exception('init_insuranceclaimthread_edorinfo',sqlerrm(),sqlcode())
|
|
END;
|
|
END;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+=============================================================================================================================================================
|
|
|
|
+============================================================根据insuranceclaimthread更新理赔========================================================================================
|
|
|
|
+==========================================================================================================================================================
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+CREATE OR REPLACE PROCEDURE init_insuranceclaimthread_insuranceclaimthread(partytimeline_count OUT int)
|
|
|
|
+IS
|
|
|
|
+BEGIN
|
|
|
|
+ --初始化临时表、
|
|
|
|
+ insert into PartyTimeLine(
|
|
|
|
+ TripID,
|
|
|
|
+ PartyID, --参与方id
|
|
|
|
+ Name,
|
|
|
|
+ PCertID,
|
|
|
|
+ PPhone,
|
|
|
|
+ PRole,
|
|
|
|
+ Scenario,
|
|
|
|
+ SDate,
|
|
|
|
+ ThreadID,
|
|
|
|
+ ParentID,
|
|
|
|
+ EndDate,
|
|
|
|
+ CREATED_BY,
|
|
|
|
+ CREATED_TIME
|
|
|
|
+ )
|
|
|
|
+ SELECT
|
|
|
|
+ row_number()over() +partytimeline_count,
|
|
|
|
+ applicantid,
|
|
|
|
+ appname,
|
|
|
|
+ appcertid,
|
|
|
|
+ appphone,
|
|
|
|
+ '投保人',
|
|
|
|
+ '报案',
|
|
|
|
+ crdate,
|
|
|
|
+ icthreadid,
|
|
|
|
+ policyno,
|
|
|
|
+ csdate,
|
|
|
|
+ 'admin',
|
|
|
|
+ sysdate
|
|
|
|
+ from qxp.insuranceclaimthread where applicantid is not null;
|
|
|
|
+
|
|
|
|
+ --已经存在的数据行数
|
|
|
|
+ select count(0) into partytimeline_count from PartyTimeLine
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ EXCEPTION
|
|
|
|
+ WHEN HIVE_EXCEPTION THEN
|
|
|
|
+ log_exception('init_insuranceclaimthread_insuranceclaimthread',sqlerrm(),sqlcode())
|
|
|
|
+ WHEN Others THEN
|
|
|
|
+ log_exception('init_insuranceclaimthread_insuranceclaimthread',sqlerrm(),sqlcode())
|
|
|
|
+END;
|
|
|
|
|
|
|
|
|
|
|
|
+=============================================================================================================================================================
|
|
|
|
+============================================================根据InsuranceArrangement更新投保========================================================================================
|
|
|
|
+==========================================================================================================================================================
|
|
|
|
|
|
|
|
|
|
|
|
+CREATE OR REPLACE PROCEDURE init_insuranceclaimthread_InsuranceArrangement(partytimeline_count OUT int)
|
|
|
|
+IS
|
|
|
|
+BEGIN
|
|
|
|
+ --初始化临时表、
|
|
|
|
+ insert into PartyTimeLine(
|
|
|
|
+ TripID,
|
|
|
|
+ PartyID, --参与方id
|
|
|
|
+ Name,
|
|
|
|
+ PCertID,
|
|
|
|
+ PPhone,
|
|
|
|
+ PRole,
|
|
|
|
+ Scenario,
|
|
|
|
+ SDate,
|
|
|
|
+ ThreadID,
|
|
|
|
+ ParentID,
|
|
|
|
+ EndDate,
|
|
|
|
+ CREATED_BY,
|
|
|
|
+ CREATED_TIME
|
|
|
|
+ )
|
|
|
|
+ SELECT
|
|
|
|
+ row_number()over() +partytimeline_count,
|
|
|
|
+ applicantid,
|
|
|
|
+ appname,
|
|
|
|
+ appcertid,
|
|
|
|
+ appphone,
|
|
|
|
+ '投保人',
|
|
|
|
+ '投保',
|
|
|
|
+ PADate,
|
|
|
|
+ PANo,
|
|
|
|
+ PolicyNo,
|
|
|
|
+ PMDate ,
|
|
|
|
+ 'admin',
|
|
|
|
+ sysdate
|
|
|
|
+ from shanglifeecif.InsuranceArrangement where applicantid is not null;
|
|
|
|
|
|
|
|
+ --已经存在的数据行数
|
|
|
|
+ select count(0) into partytimeline_count from PartyTimeLine
|
|
|
|
|
|
|
|
|
|
|
|
+ EXCEPTION
|
|
|
|
+ WHEN HIVE_EXCEPTION THEN
|
|
|
|
+ log_exception('init_insuranceclaimthread_InsuranceArrangement',sqlerrm(),sqlcode())
|
|
|
|
+ WHEN Others THEN
|
|
|
|
+ log_exception('init_insuranceclaimthread_InsuranceArrangement',sqlerrm(),sqlcode())
|
|
|
|
+END;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -368,6 +472,8 @@ END;
|
|
--从 audit_edorlist 的表中插入的数据为 619006
|
|
--从 audit_edorlist 的表中插入的数据为 619006
|
|
--有1060个数据 因为查不到保单无法进入数据库
|
|
--有1060个数据 因为查不到保单无法进入数据库
|
|
|
|
|
|
|
|
+--带edorinfo 一共插入 619685
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -384,4 +490,7 @@ SELECT contno,cusappdate FROM audit_edorlist GROUP BY contno,cusappdate
|
|
SELECT count(1) a,contno FROM audit_edorlist GROUP BY contno,cusappdate ORDER BY a DESC;
|
|
SELECT count(1) a,contno FROM audit_edorlist GROUP BY contno,cusappdate ORDER BY a DESC;
|
|
|
|
|
|
--查询重复最多的数据
|
|
--查询重复最多的数据
|
|
-SELECT * FROM audit_edorlist WHERE contno = '2018020800060078';
|
|
|
|
|
|
+SELECT * FROM audit_edorlist WHERE contno = '2018020800060078';
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+--
|