|
@@ -0,0 +1,61 @@
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+export LANG="en_US.UTF-8"
|
|
|
+source /etc/profile
|
|
|
+source ~/.bash_profile;
|
|
|
+source /BIreport/TDH-Client/init.sh
|
|
|
+
|
|
|
+shanglifeecif_sql="
|
|
|
+DECLARE
|
|
|
+ bes dsj.batch_execu_status2%ROWTYPE
|
|
|
+ curdate STRING
|
|
|
+BEGIN
|
|
|
+ SELECT * INTO bes
|
|
|
+ FROM dsj.batch_execu_status2 WHERE batch_number = to_char(sysdate,'yyyyMMdd');
|
|
|
+ -- 确定IF的条件语句为v_price的值大于20。
|
|
|
+ IF bes.batch_status = '00' THEN
|
|
|
+ -- 执行跑批任务
|
|
|
+ curdate:= to_char(sysdate,'yyyy-MM-dd HH:mm:ss')
|
|
|
+ dbms_output.put_line(curdate || '跑批开始!');
|
|
|
+
|
|
|
+ shanglifeecif.init_individual_main();
|
|
|
+ shanglifeecif.same_customer();
|
|
|
+ shanglifeecif.data_cleaning();
|
|
|
+ shanglifeecif.init_insurancearrangement_main();
|
|
|
+ shanglifeecif.insuranceclaimthread_main();
|
|
|
+ shanglifeecif.init_indrelationship_main();
|
|
|
+ shanglifeecif.partytimeline_main();
|
|
|
+ shanglifeecif.age_sex_distribution();
|
|
|
+ shanglifeecif.riskcode_statistics();
|
|
|
+ shanglifeecif.bdnum_distribution();
|
|
|
+ shanglifeecif.surrender_protection_temp();
|
|
|
+ shanglifeecif.updateIndividualLable();
|
|
|
+ shanglifeecif.effective_customer();
|
|
|
+ --跑批完成后,向跑批状态表插入数据
|
|
|
+ INSERT INTO dsj.batch_execu_status2
|
|
|
+ VALUES (
|
|
|
+ '客户统一视图' || to_char(sysdate,'yyyyMMdd'),
|
|
|
+ 'ecif',
|
|
|
+ '客户统一视图ETL任务',
|
|
|
+ 'ecif_etl',
|
|
|
+ to_char(sysdate,'yyyyMMddHHmmss'),
|
|
|
+ curdate,
|
|
|
+ to_char(sysdate,'yyyy-MM-dd HH:mm:ss'),
|
|
|
+ '00',
|
|
|
+ NULL,'ecif',to_char(sysdate,'yyyy-MM-dd HH:mm:ss'),NULL,NULL
|
|
|
+ );
|
|
|
+ END IF
|
|
|
+ dbms_output.put_line(to_char(sysdate,'yyyy-MM-dd HH:mm:ss') || '跑批完成!');
|
|
|
+ EXCEPTION
|
|
|
+ -- 引用一个NO_DATA_FOUND的EXCEPTION。
|
|
|
+ WHEN NO_DATA_FOUND THEN
|
|
|
+ -- 输出变量v_comment的值。
|
|
|
+ dbms_output.put_line('当天跑批未完成!')
|
|
|
+ WHEN TOO_MANY_ROWS THEN
|
|
|
+ dbms_output.put_line('当天出现多条跑批数据!')
|
|
|
+END;"
|
|
|
+beeline -u "jdbc:hive2://10.52.3.12:10000" --hiveconf hive.metastore.client.socket.timeout=86400000 --hiveconf hive.server2.idle.session.timeout=43200000 --hiveconf hive.server2.session.check.interval=900000 -e "${shanglifeecif_sql}"
|
|
|
+
|
|
|
+
|