|
@@ -453,7 +453,7 @@ DROP SEQUENCE IF EXISTS globaleCusId_sequence;
|
|
|
!set plsqlUseSlash true
|
|
|
SET plsql.catch.hive.exception=true;
|
|
|
|
|
|
-CREATE OR REPLACE PROCEDURE init_individual_main()
|
|
|
+CREATE OR REPLACE PROCEDURE shanglifeecif.init_individual_main()
|
|
|
IS
|
|
|
DECLARE
|
|
|
individual_count int
|
|
@@ -461,17 +461,17 @@ DECLARE
|
|
|
BEGIN
|
|
|
|
|
|
|
|
|
- init_individual_0(individual_count);
|
|
|
+ shanglifeecif.init_individual_0(individual_count);
|
|
|
|
|
|
|
|
|
individual_count:=individual_count+1;
|
|
|
- init_individual_1(individual_count);
|
|
|
+ shanglifeecif.init_individual_1(individual_count);
|
|
|
|
|
|
individual_count:=individual_count+1;
|
|
|
- init_individual_3(individual_count);
|
|
|
+ shanglifeecif.init_individual_3(individual_count);
|
|
|
|
|
|
individual_count:=individual_count+1;
|
|
|
- init_individual_other(individual_count);
|
|
|
+ shanglifeecif.init_individual_other(individual_count);
|
|
|
|
|
|
|
|
|
individual_count:=individual_count+1;
|
|
@@ -490,10 +490,10 @@ BEGIN
|
|
|
EXECUTE IMMEDIATE strsql
|
|
|
|
|
|
|
|
|
- up_t_customers_class_1();
|
|
|
+ shanglifeecif.up_t_customers_class_1();
|
|
|
|
|
|
|
|
|
- up_health_insurance_listing_1();
|
|
|
+ shanglifeecif.up_health_insurance_listing_1();
|
|
|
|
|
|
EXCEPTION
|
|
|
WHEN HIVE_EXCEPTION THEN
|
|
@@ -510,12 +510,12 @@ END;
|
|
|
!set plsqlUseSlash true
|
|
|
SET plsql.catch.hive.exception=true;
|
|
|
|
|
|
-CREATE OR REPLACE PROCEDURE init_individual_0( individual_count OUT int)
|
|
|
+CREATE OR REPLACE PROCEDURE shanglifeecif.init_individual_0( individual_count OUT int)
|
|
|
IS
|
|
|
BEGIN
|
|
|
|
|
|
|
|
|
- insert into individual (
|
|
|
+ insert into shanglifeecif.individual (
|
|
|
indid,
|
|
|
custid,
|
|
|
|
|
@@ -539,7 +539,7 @@ BEGIN
|
|
|
idcard ,
|
|
|
|
|
|
sysdate,
|
|
|
- 'qxp'
|
|
|
+ 'admin'
|
|
|
FROM (
|
|
|
SELECT
|
|
|
customerno AS scustid,
|
|
@@ -564,7 +564,7 @@ BEGIN
|
|
|
WHERE insuredno IS NOT NULL AND insuredidtype=0
|
|
|
) tmpTable
|
|
|
|
|
|
- select count(0) into individual_count from individual
|
|
|
+ select count(0) into individual_count from shanglifeecif.individual
|
|
|
EXCEPTION
|
|
|
WHEN HIVE_EXCEPTION THEN
|
|
|
log_exception('init_individual_0',sqlerrm(),sqlcode())
|
|
@@ -576,12 +576,12 @@ END;
|
|
|
!set plsqlUseSlash true
|
|
|
SET plsql.catch.hive.exception=true;
|
|
|
|
|
|
-CREATE OR REPLACE PROCEDURE init_individual_1(individual_count INOUT int)
|
|
|
+CREATE OR REPLACE PROCEDURE shanglifeecif.init_individual_1(individual_count INOUT int)
|
|
|
IS
|
|
|
BEGIN
|
|
|
|
|
|
|
|
|
- insert into individual (
|
|
|
+ insert into shanglifeecif.individual (
|
|
|
indid,
|
|
|
custid,
|
|
|
|
|
@@ -606,7 +606,7 @@ BEGIN
|
|
|
idcard ,
|
|
|
|
|
|
sysdate,
|
|
|
- 'qxp'
|
|
|
+ 'admin'
|
|
|
FROM (
|
|
|
SELECT
|
|
|
customerno AS scustid,
|
|
@@ -632,7 +632,7 @@ BEGIN
|
|
|
) tmpTable
|
|
|
|
|
|
|
|
|
- select count(0) into individual_count from individual
|
|
|
+ select count(0) into individual_count from shanglifeecif.individual
|
|
|
|
|
|
EXCEPTION
|
|
|
WHEN HIVE_EXCEPTION THEN
|
|
@@ -643,12 +643,12 @@ END;
|
|
|
!set plsqlUseSlash true
|
|
|
SET plsql.catch.hive.exception=true;
|
|
|
|
|
|
-CREATE OR REPLACE PROCEDURE init_individual_3(individual_count INOUT int)
|
|
|
+CREATE OR REPLACE PROCEDURE shanglifeecif.init_individual_3(individual_count INOUT int)
|
|
|
IS
|
|
|
BEGIN
|
|
|
|
|
|
|
|
|
- insert into individual(
|
|
|
+ insert into shanglifeecif.individual(
|
|
|
indid,
|
|
|
custid,
|
|
|
|
|
@@ -672,7 +672,7 @@ BEGIN
|
|
|
idcard ,
|
|
|
|
|
|
sysdate,
|
|
|
- 'qxp'
|
|
|
+ 'admin'
|
|
|
FROM (
|
|
|
SELECT
|
|
|
customerno AS scustid,
|
|
@@ -698,7 +698,7 @@ BEGIN
|
|
|
) tmpTable
|
|
|
|
|
|
|
|
|
- select count(0) into individual_count from individual
|
|
|
+ select count(0) into individual_count from shanglifeecif.individual
|
|
|
|
|
|
EXCEPTION
|
|
|
WHEN HIVE_EXCEPTION THEN
|
|
@@ -710,12 +710,12 @@ END;
|
|
|
!set plsqlUseSlash true
|
|
|
SET plsql.catch.hive.exception=true;
|
|
|
|
|
|
-CREATE OR REPLACE PROCEDURE init_individual_other(individual_count INOUT int)
|
|
|
+CREATE OR REPLACE PROCEDURE shanglifeecif.init_individual_other(individual_count INOUT int)
|
|
|
IS
|
|
|
BEGIN
|
|
|
|
|
|
|
|
|
- insert into individual(
|
|
|
+ insert into shanglifeecif.individual(
|
|
|
indid,
|
|
|
custid,
|
|
|
|
|
@@ -736,7 +736,7 @@ BEGIN
|
|
|
gender ,
|
|
|
birthday,
|
|
|
sysdate,
|
|
|
- 'qxp'
|
|
|
+ 'admin'
|
|
|
FROM (
|
|
|
SELECT
|
|
|
customerno AS scustid,
|
|
@@ -762,23 +762,19 @@ BEGIN
|
|
|
) tmpTable
|
|
|
|
|
|
|
|
|
- select count(0) into individual_count from individual
|
|
|
+ select count(0) into individual_count from shanglifeecif.individual
|
|
|
+
|
|
|
|
|
|
- EXCEPTION
|
|
|
- WHEN HIVE_EXCEPTION THEN
|
|
|
- log_exception('init_individual_other',sqlerrm(),sqlcode())
|
|
|
- WHEN Others THEN
|
|
|
- log_exception('init_individual_other',sqlerrm(),sqlcode())
|
|
|
END;
|
|
|
|
|
|
|
|
|
!set plsqlUseSlash true
|
|
|
SET plsql.catch.hive.exception=true;
|
|
|
|
|
|
-CREATE OR REPLACE PROCEDURE up_t_customers_class_1()
|
|
|
+CREATE OR REPLACE PROCEDURE shanglifeecif.up_t_customers_class_1()
|
|
|
IS
|
|
|
BEGIN
|
|
|
- UPDATE individual a SET (
|
|
|
+ UPDATE shanglifeecif.individual a SET (
|
|
|
CustClass ,
|
|
|
ConValue ,
|
|
|
Awarded3 ,
|
|
@@ -788,10 +784,17 @@ BEGIN
|
|
|
EndDate,
|
|
|
Height,
|
|
|
Weight,
|
|
|
+ BMI,
|
|
|
PIncome,
|
|
|
FIncome,
|
|
|
IncomeSource,
|
|
|
- SIStatus
|
|
|
+ SIStatus,
|
|
|
+ Ethnic,
|
|
|
+ Nation,
|
|
|
+ MaritalStat,
|
|
|
+ Employer,
|
|
|
+ Education,
|
|
|
+ Dday
|
|
|
) = (
|
|
|
select
|
|
|
CLASS_VALUE ,
|
|
@@ -803,12 +806,19 @@ BEGIN
|
|
|
END_DATE,
|
|
|
STATURE,
|
|
|
AVOIRDUPOIS,
|
|
|
+ BMI,
|
|
|
YEARINCOME,
|
|
|
FAMILYYEARSALARY,
|
|
|
INCOMESOURCE,
|
|
|
- SOCIALINSUFLAG
|
|
|
-
|
|
|
- from shanghailifeecif.t_customer_class b
|
|
|
+ SOCIALINSUFLAG,
|
|
|
+ NATIONALITY,
|
|
|
+ NATIVEPLACE,
|
|
|
+ MARRIAGE,
|
|
|
+ GRPNAME,
|
|
|
+ DEGREE,
|
|
|
+ DEATHDATE
|
|
|
+
|
|
|
+ from t_customer_class b
|
|
|
where b.CUSTOMER_ID = a.scustid;
|
|
|
) WHERE 1=1 ;
|
|
|
EXCEPTION
|
|
@@ -818,8 +828,8 @@ BEGIN
|
|
|
log_exception('up_t_customers_class_1',sqlerrm(),sqlcode())
|
|
|
END;
|
|
|
/
|
|
|
-DROP TABLE IF EXISTS occupation_tmp;
|
|
|
-CREATE TABLE occupation_tmp(
|
|
|
+DROP TABLE IF EXISTS shanglifeecif.occupation_tmp;
|
|
|
+CREATE TABLE shanglifeecif.occupation_tmp(
|
|
|
scustid string not NULL COMMENT '客户号',
|
|
|
OccupationId string DEFAULT NULL COMMENT '名称',
|
|
|
Occupation string DEFAULT NULL COMMENT '出生日期' ,
|
|
@@ -829,13 +839,13 @@ CREATE TABLE occupation_tmp(
|
|
|
with shard number 10
|
|
|
replication 1;
|
|
|
|
|
|
-CREATE OR REPLACE PROCEDURE up_health_insurance_listing_1()
|
|
|
+CREATE OR REPLACE PROCEDURE shanglifeecif.up_health_insurance_listing_1()
|
|
|
IS
|
|
|
BEGIN
|
|
|
|
|
|
- delete occupation_tmp;
|
|
|
+ delete shanglifeecif.occupation_tmp;
|
|
|
|
|
|
- insert into occupation_tmp(
|
|
|
+ insert into shanglifeecif.occupation_tmp(
|
|
|
scustid,
|
|
|
OccupationId,
|
|
|
Occupation,
|
|
@@ -853,7 +863,7 @@ BEGIN
|
|
|
|
|
|
|
|
|
|
|
|
- UPDATE individual a SET (
|
|
|
+ UPDATE shanglifeecif.individual a SET (
|
|
|
OccupationId ,
|
|
|
Occupation,
|
|
|
HomeAdress
|
|
@@ -862,7 +872,7 @@ BEGIN
|
|
|
OccupationId ,
|
|
|
Occupation,
|
|
|
HomeAdress
|
|
|
- from occupation_tmp b
|
|
|
+ from shanglifeecif.occupation_tmp b
|
|
|
where b.scustid = a.scustid
|
|
|
) WHERE 1=1 ;
|
|
|
EXCEPTION
|
|
@@ -896,8 +906,8 @@ END;
|
|
|
=======================================================================================================================================
|
|
|
|
|
|
|
|
|
-DROP TABLE IF EXISTS scustid_unique_tmp;
|
|
|
-CREATE TABLE scustid_unique_tmp(
|
|
|
+DROP TABLE IF EXISTS shanglifeecif.scustid_unique_tmp;
|
|
|
+CREATE TABLE shanglifeecif.scustid_unique_tmp(
|
|
|
scustid string COMMENT '上游客户号' ,
|
|
|
indid string COMMENT '客户号'
|
|
|
)
|
|
@@ -907,15 +917,15 @@ with shard number 10
|
|
|
replication 1;
|
|
|
|
|
|
|
|
|
-CREATE OR REPLACE PROCEDURE up_scustid_unique_tmp()
|
|
|
+CREATE OR REPLACE PROCEDURE shanglifeecif.up_scustid_unique_tmp()
|
|
|
IS
|
|
|
BEGIN
|
|
|
|
|
|
- delete from scustid_unique_tmp;
|
|
|
+ delete from shanglifeecif.scustid_unique_tmp;
|
|
|
|
|
|
|
|
|
- insert into scustid_unique_tmp(scustid,indid)
|
|
|
- select scustid,min(indid) from individual group by scustid;
|
|
|
+ insert into shanglifeecif.scustid_unique_tmp(scustid,indid)
|
|
|
+ select scustid,min(indid) from shanglifeecif.individual group by scustid;
|
|
|
|
|
|
EXCEPTION
|
|
|
WHEN HIVE_EXCEPTION THEN
|