瀏覽代碼

更新一阶段错误问题bug,首页分渠道下拉框显示判断

chenzhenguo 2 年之前
父節點
當前提交
47dd19c22d

+ 931 - 0
dgtis-modules/dgtis-modules-data/src/main/java/com/dgtis/data/util/SqlGenerator.java

@@ -0,0 +1,931 @@
+package com.dgtis.data.util;
+
+public class SqlGenerator {
+//    public static void main2(String[] args) {
+//        String sql = "\n" +
+//                "SELECT scustid , label55 ,salecom,'label55'  FROM shanglifeecif.customerno_salecom_relation \n" +
+//                "WHERE  scustid IN (\n" +
+//                "select  scustid     from (\n" +
+//                "\n" +
+//                "SELECT a.scustid ,  count(1) AS  ct   FROM ( \n" +
+//                "SELECT * FROM ( SELECT scustid , label55 FROM shanglifeecif.customerno_salecom_relation \n" +
+//                "GROUP BY label55 , scustid )\n" +
+//                ") a GROUP BY a.scustid ORDER BY ct DESC   limit 2 \n" +
+//                ") \n" +
+//                ")\n" +
+//                "\n";
+//String sql2 = "";
+//
+//        for (int i = 1; i <=120 ; i++) {
+//            String lable = "label"+i;
+//             sql2+= sql.replaceAll("label55", lable);
+//            sql2+="\n union  \n ";
+//        }
+//        System.out.println(sql2);
+//    }
+//
+//    public static void main(String[] args) {
+//        String str="CREATE OR REPLACE PROCEDURE shanglifeecif.updateindividuallable() IS\n" +
+//                "DECLARE\n" +
+//                "BEGIN\n" +
+//                "\t--1\t学历\tlabel1\t按照客户最新记录中的学历取值\t幼儿园、小学、中专、职高、技校、初中、高中、大专、本科、硕士及以上、其他\t\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label1 = si1.Education where si1.Education is not null;\n" +
+//                "\t--2\t职业\tlabel2\t按照客户最新记录中的职业名称取值\t食用调料制作工、味精制作工、糕点、面包烘焙工、米面主食制作工、油脂制品工等\n" +
+//                "\t\t\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label2 = si1.Occupation where si1.Occupation is not null;\n" +
+//                "\t--3\t出生日期区间\tlabel3\t根据出生日期,判断客户年代归属\t60后、70后、80后、90后、00后、10后等\t\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label3 = substr(si1.birthday,3,1) || '0后' where 1 = 1;\n" +
+//                "\t--4\t年龄区间\tlabel4\t\"case age when 0<=age and age<13 then '儿童' when  13<=age and age<19 then '少年' when 19<=age and age<41 then '青年' when 41<=age and age<66 then '中年' --else '老年'\"\t儿童、少年、青年、中年、老年\t\n" +
+//                "\t--UPDATE shanglifeecif.Individual si1 SET si1.label4 = (SELECT CASE WHEN temp.age>=0 AND temp.age<13 THEN '儿童' WHEN temp.age>=13 AND temp.age <19 THEN '少年' WHEN temp.age -->=19 AND temp.age <41 THEN '青年' WHEN temp.age >=41 AND temp.age <66 THEN '中年' ELSE '老年' END FROM (SELECT TRUNC(months_between(sysdate, si2.birthday)/12) age,si2.indid --FROM shanglifeecif.Individual si2) temp WHERE temp.indid = si1.indid);\n" +
+//                "\t--5\t联系地址归属省份\tlabel5\t按照客户最近一次办理业务给出的最新联系地址取所在省名称或地级市的名称\t省、直辖市:江苏、北京、上海等\t\n" +
+//                "\t--6\t联系地址归属地区\tlabel6\t按照客户最近一次办理业务给出的最新联系地址取所在市名称或者地级市所在区的名称\t市:苏州市、南京市等\t\n" +
+//                "\t--7\t婚姻状况\tlabel9\t\"根据婚姻状态字段判断 case maritalStat when maritalStat=1 then '未婚' when  maritalStat=2 then '已婚' when maritalStat=3 then '丧偶' when maritalStat=4 --then '离异' else null\"\t1未婚、2已婚、3丧偶、4离异\t\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label9 = si1.maritalStat WHERE 1 = 1;\n" +
+//                "\t--UPDATE shanglifeecif.Individual si1 SET si1.label9 = (\n" +
+//                "\t\t\t\t--case si1.maritalStat\n" +
+//                "\t\t\t\t--when 1 then '未婚'\n" +
+//                "\t\t\t\t--when 2 then '已婚'\n" +
+//                "\t\t\t\t--when 3 then '丧偶'\n" +
+//                "\t\t\t\t--when 4 then '离异'\n" +
+//                "\t\t\t\t--else NULL END \n" +
+//                "\t--) WHERE 1 = 1;\n" +
+//                "\t--8\t子女数量区间\tlabel10\t\"根据子女登录(登记录入)数量判断 case COChild when COChild=0  then '无子女' when COChild=1  then '1孩' when COChild>0  then '2孩及以上' \n" +
+//                "\t--else null\"\t无子女、1孩、2孩及以上\t\n" +
+//                "\tUPDATE shanglifeecif.individual si1 SET si1.cochild = (\n" +
+//                "\t\tSELECT nvl(t.cnum,0) FROM (\n" +
+//                "\t\t\tSELECT si.indid1,count(*) AS cnum FROM shanglifeecif.IndRelationShip si \n" +
+//                "\t\t\tWHERE si.rstype = '子女' GROUP BY si.indid1\n" +
+//                "\t\t) t WHERE t.indid1 = si1.scustid\n" +
+//                "\t) ;\n" +
+//                "\t\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label10 = (\n" +
+//                "\t\t\t\tcase \n" +
+//                "\t\t\t\twhen si1.COChild=0  then '无子女' \n" +
+//                "\t\t\t\twhen si1.COChild=1  then '1孩' \n" +
+//                "\t\t\t\twhen si1.COChild>=2  then '2孩及以上' \n" +
+//                "\t\t\t\telse null END \n" +
+//                "\t) WHERE si1.cochild is not null;\n" +
+//                "\t--9\t最近5年是否曾或正在接受治疗\tlabel11\t按照该字段标识最后一次更新的结果判断,如果标识为true则显示“最近五年曾或正在接受治疗”,否则不做显示\t近5年有治疗,近5年无治疗\t\n" +
+//                "    --10\t是否饮酒\tlabel12\t按照该字段标识判断,只要记录中有一次标识为true,则显示“饮酒”,否则不做显示\t饮酒\t\n" +
+//                "\t--11\t是否吸烟\tlabel13\t按照该字段标识判断,只要记录中有一次标识为true,则显示“吸烟”,否则不做显示\t吸烟\t\n" +
+//                "\t--12\t是否有先天性疾病\tlabel14\t按照该字段标识最后一次更新的结果判断,如果标识为true则显示“有先天性疾病”,否则不做显示\t有先天性疾病\t\n" +
+//                "\t--13\t是否患过重大疾病\tlabel15\t按照该字段标识最后一次更新的结果判断,如果标识为true则显示“患过重大疾病”,否则不做显示\t患过重大疾病\t\n" +
+//                "\t--14\t家族是否有遗传病史\tlabel16\t按照该字段标识最后一次更新的结果判断,如果标识为true则显示“有遗传病”,否则不做显示\t家族有遗传病史\t\n" +
+//                "\t--15\t是否正在怀孕\tlabel17\t按照该字段标识最后一次更新的结果判断,如果标识为true则显示“怀孕”,否则不做显示\t正在怀孕\t\n" +
+//                "\t--16\t是否有早产、过期产、难产情况\tlabel18\t按照该字段标识判断,只要记录中有一次标识为true,则显示“有早产、过期产、难产情况”,否则不做显示\t有早产、过期产、难产情况\t\n" +
+//                "\t--17\t是否进行危险性运动\tlabel20\t按照该字段标识判断,只要记录中有一次标识为true,则显示“进行危险性运动”,否则不做显示\t进行危险性运动\t\n" +
+//                "\t--18\t个人年收入区间\tlabel21\t\"根据个人年收入字段进行判断:case PIncome when PIncome<=120000 then '低收入' when PIncome>120000 and PIncome<=1000000 then '中产' when --PIncome>1000000 then '富人' else null\"\t低收入、中产、富人\t\n" +
+//                "\t--根据数据判断单位应该是万元,这里都除以10000做判断\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label21 = (\n" +
+//                "\t\t\tCASE \n" +
+//                "\t\t\t\tWHEN si1.pincome >=0 AND si1.pincome<=12 THEN '低收入' \n" +
+//                "\t\t\t\tWHEN si1.pincome >12 AND si1.pincome<=100 THEN '中产' \n" +
+//                "\t\t\t\tWHEN si1.pincome > 100 THEN '富人'\n" +
+//                "\t\t\t\telse null END \n" +
+//                "\t\t\t) where 1 = 1;\n" +
+//                "\t--19\t拥有车辆数量区间\tlabel22\t\"根据车辆登录数量字段进行判断:case COVehicle when COVehicle=0 then '无车' when COVehicle=1 then '1辆车' when COVehicle>1 then '2辆车以上'\n" +
+//                "    --else null\" 无车,1辆车,2辆车及以上\t\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label22 = (\n" +
+//                "\t\tCASE \n" +
+//                "\t\tWHEN si1.COVehicle ==0  THEN '无车' \n" +
+//                "\t\tWHEN si1.COVehicle == 1  THEN '1辆车' \n" +
+//                "\t\tWHEN si1.COVehicle > 1  THEN '2辆车以上' \n" +
+//                "\t\tELSE NULL END \n" +
+//                "\t\t) where 1 = 1;\t\n" +
+//                "\t--20\t拥有住房套数\tlabel23\t\"根据房屋登录数量字段进行判断:case CORP when CORP=0 then '无房' when CORP=1 then '1套房' when CORP>1 then '2套房以上'\n" +
+//                "\t--else null\"\t无房,1套房,2套房及以上\t\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label23 = (\n" +
+//                "\t\tCASE \n" +
+//                "\t\tWHEN si1.CORP ==0  THEN '无房' \n" +
+//                "\t\tWHEN si1.CORP == 1  THEN '1套房' \n" +
+//                "\t\tWHEN si1.CORP > 1  THEN '2套房以上' \n" +
+//                "\t\telse null END \n" +
+//                "\t\t) where 1 = 1;\n" +
+//                "\t--21\t是否持有寿险有效保单\tlabel24\t筛选客户名下所有保单,保单中客户为投保人,保单险种大类为寿险\t持有寿险有效保单\t\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label24 = '持有寿险有效保单' WHERE si1.scustid in\n" +
+//                "\t(SELECT p.customerno FROM dsj.policy_information p,dsj.riskkind l WHERE p.riskcode = l.riskcode AND p.appflag = '有效' AND (l.kindtype = '新型寿险' OR l.kindtype = '人寿保险'));\n" +
+//                "\t--22\t保单件数区间\tlabel25\t\"判断客户作为投保人所有的保单数量(有效保单数量+失效保单数量):NOVPolicy+NOIVPolicy=pCount(保单总件数)\n" +
+//                "\t--case pCount when pCount=1 then '1件' when pCount=2 then '2件' when pCount>2 and pCount<6 then '3-5件' when pCount>5 and pCount<11 then '6-10件' \n" +
+//                "\t--when pCount>10 and pCount<21 then '10-20件'when pCount>20 and pCount<51 then '21-50件'\n" +
+//                "\t--when pCount>50 then '50件以上' else '无保单'\"\t无保单、1件保单、2件保单、3-5件保单、6-10件保单、11-20件保单、20-50件保单、50件以上保单\t\n" +
+//                "\t--第一步 更新 Individual.NOVPolicy 有效记录数\n" +
+//                "\t--UPDATE shanglifeecif.Individual si1 SET si1.NOVPolicy = (SELECT nvl(t.cnum,0) FROM (\n" +
+//                "\t\t--SELECT temp.customerno,count(*) AS cnum FROM (\n" +
+//                "\t\t\t--SELECT max(p.customerno) customerno,p.contno FROM dsj.policy_information p WHERE p.appflag = '有效' GROUP BY p.contno \n" +
+//                "\t\t--) temp GROUP BY temp.customerno\n" +
+//                "\t--) t WHERE t.customerno =  si1.scustid); \n" +
+//                "\t\n" +
+//                "\t\n" +
+//                "\t\n" +
+//                "\t--第二步 更新 Individual.NOIVPolicy 无效记录数\n" +
+//                "\t--UPDATE shanglifeecif.Individual si1 SET si1.noivpolicy = (SELECT nvl(t.cnum,0) FROM (\n" +
+//                "\t\t\t--SELECT temp.customerno,count(*) AS cnum FROM (\n" +
+//                "\t\t\t--SELECT max(p.customerno) customerno,p.contno FROM dsj.policy_information p WHERE p.appflag <> '有效' GROUP BY p.contno \n" +
+//                "\t\t--) temp GROUP BY temp.customerno\n" +
+//                "\t--) t WHERE t.customerno =  si1.scustid); \n" +
+//                "\t\n" +
+//                "\t--第三步\n" +
+//                "\t--UPDATE shanglifeecif.Individual si1 SET si1.Label25 = (\n" +
+//                "\t\t--CASE \n" +
+//                "\t\t\t\t--WHEN (nvl(si1.NOVPolicy,0) + nvl(si1.NOIVPolicy,0)) == 0 THEN '无保单' \n" +
+//                "\t\t\t\t--WHEN (nvl(si1.NOVPolicy,0) + nvl(si1.NOIVPolicy,0)) == 1 THEN '1件' \n" +
+//                "\t\t\t\t--WHEN (nvl(si1.NOVPolicy,0) + nvl(si1.NOIVPolicy,0)) == 2 THEN '2件'  \n" +
+//                "\t\t\t\t--WHEN (nvl(si1.NOVPolicy,0) + nvl(si1.NOIVPolicy,0)) >= 3  AND (nvl(si1.NOVPolicy,0) + nvl(si1.NOIVPolicy,0)) <= 5 THEN '3-5件'  \n" +
+//                "\t\t\t\t--WHEN (nvl(si1.NOVPolicy,0) + nvl(si1.NOIVPolicy,0)) >= 6  AND (nvl(si1.NOVPolicy,0) + nvl(si1.NOIVPolicy,0)) <= 10 THEN '6-10件'  \n" +
+//                "\t\t\t\t--WHEN (nvl(si1.NOVPolicy,0) + nvl(si1.NOIVPolicy,0)) >= 11  AND (nvl(si1.NOVPolicy,0) + nvl(si1.NOIVPolicy,0))<= 20 THEN '11-20件'  \n" +
+//                "\t\t\t\t--WHEN (nvl(si1.NOVPolicy,0) + nvl(si1.NOIVPolicy,0)) >= 21  AND (nvl(si1.NOVPolicy,0) + nvl(si1.NOIVPolicy,0)) <= 50 THEN '21-50件'  \n" +
+//                "\t\t\t\t--WHEN (nvl(si1.NOVPolicy,0) + nvl(si1.NOIVPolicy,0)) > 50 THEN '50件以上' \n" +
+//                "\t\t--END ) where 1 = 1;\n" +
+//                "\t\t\n" +
+//                "\t--UPDATE shanglifeecif.Individual si1 SET si1.Label25 = (\n" +
+//                "\t\t--CASE \n" +
+//                "\t\t\t\t--WHEN (nvl(si1.NOVPolicy,0) + nvl(si1.NOIVPolicy,0)) == 0 THEN '无保单' \n" +
+//                "\t\t\t\t--WHEN (nvl(si1.NOVPolicy,0) + nvl(si1.NOIVPolicy,0)) == 1 THEN '1件保单' \n" +
+//                "\t\t\t\t--WHEN (nvl(si1.NOVPolicy,0) + nvl(si1.NOIVPolicy,0)) == 2 THEN '2件保单'  \n" +
+//                "\t\t\t\t--WHEN (nvl(si1.NOVPolicy,0) + nvl(si1.NOIVPolicy,0)) >= 3  AND (nvl(si1.NOVPolicy,0) + nvl(si1.NOIVPolicy,0)) <= 5 THEN '3-5件保单'  \n" +
+//                "\t\t\t\t--WHEN (nvl(si1.NOVPolicy,0) + nvl(si1.NOIVPolicy,0)) >= 6  AND (nvl(si1.NOVPolicy,0) + nvl(si1.NOIVPolicy,0)) <= 10 THEN '6-10件保单'  \n" +
+//                "\t\t\t\t--WHEN (nvl(si1.NOVPolicy,0) + nvl(si1.NOIVPolicy,0)) >= 11  AND (nvl(si1.NOVPolicy,0) + nvl(si1.NOIVPolicy,0))<= 20 THEN '11-20件保单'  \n" +
+//                "\t\t\t\t--WHEN (nvl(si1.NOVPolicy,0) + nvl(si1.NOIVPolicy,0)) >= 21  AND (nvl(si1.NOVPolicy,0) + nvl(si1.NOIVPolicy,0)) <= 50 THEN '21-50件保单'  \n" +
+//                "\t\t\t\t--WHEN (nvl(si1.NOVPolicy,0) + nvl(si1.NOIVPolicy,0)) > 50 THEN '50件保单以上' \n" +
+//                "\t\t--END \n" +
+//                "\t\t\t--) where 1 = 1;\t\n" +
+//                "\t\t\n" +
+//                "\t\n" +
+//                "\t--23\t是否贷款\tlabel26\t筛选客户为投保人的有效保单,且办理了贷款业务\t有贷款\t\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label26 = '有保单贷款' WHERE si1.scustid IN (\n" +
+//                "\t\tSELECT p.customerno FROM dsj.policy_information p WHERE p.appflag = '有效' and p.contno IN (\n" +
+//                "\t\t\tSELECT contno FROM dsj.loloandetail WHERE moneytype='DK'\n" +
+//                "\t\t) \n" +
+//                "\t);\n" +
+//                "\t--24\t是否有极短意保单/是否仅有极短意保单\t label27\t\"客户为保单投保人 case AGRMNTAge(保险期限) when avg(sum(AGRMNTAges))<90 then '仅极短意外险'\n" +
+//                "\t\t\t--when AGRMNTAge<90  then '有极短意外险'\"\t仅极短意外险,有极短意外险\t志广说只用判断有极短意外险不用判断仅有\n" +
+//                "\t\t/*UPDATE shanglifeecif.Individual si1 SET si1.Label27 = (\n" +
+//                "\t\t\tSELECT\n" +
+//                "\t\t\t\tCASE\t\n" +
+//                "\t\t\t\t\tWHEN temp.cnt >0 THEN\n" +
+//                "\t\t\t\t\t\t\t'有极短意外险' \t\n" +
+//                "\t\t\t\tEND\n" +
+//                "\t\t\tFROM\n" +
+//                "\t\t\t\t(\n" +
+//                "\t\t\t\tSELECT\n" +
+//                "\t\t\t\t\tcount(1) cnt,\n" +
+//                "\t\t\t\t\tpolicy.customerno \n" +
+//                "\t\t\t\tFROM\n" +
+//                "\t\t\t\t\tpolicy_information policy\n" +
+//                "\t\t\t\twhere\n" +
+//                "\t\t\t\t\tpolicy.SECURITY in('7天','15天','30天','90天','1月','3月')\n" +
+//                "\t\t\t\tand\n" +
+//                "\t\t\t\t\tpolicy.riskperiod='短期险'\n" +
+//                "\t\t\t\tand\t\n" +
+//                "\t\t\t\t\tpolicy.riskcode not in('1066008','1066007','1066006','1066004','1066003','1066002','1066001','1065005','1065003','1065001','1025003')\n" +
+//                "\t\t\t\t\n" +
+//                "\t\t\t\tGROUP BY\n" +
+//                "\t\t\t\t\tpolicy.customerno \n" +
+//                "\t\t\t\t) temp \n" +
+//                "\t\t\tWHERE temp.customerno = si1.scustid \n" +
+//                "\t\t);*/\n" +
+//                "\t\t\n" +
+//                "\t\tUPDATE shanglifeecif.Individual si1 SET si1.Label27 = (\n" +
+//                "\t\t\tSELECT  \n" +
+//                "\t\t\tCASE \n" +
+//                "\t\t\t\tWHEN temp.cnt > 0 AND temp.cnt = temp.tnum THEN '仅极短意外险'\n" +
+//                "\t\t\t\tWHEN temp.cnt > 0 AND temp.cnt <> temp.tnum THEN '有极短意外险'\n" +
+//                "\t\t\tEND\n" +
+//                "\t\tFROM (\n" +
+//                "\t\t\t\tSELECT p.customerno,max(cnt) cnt,nvl(count(*),0) tnum FROM (\n" +
+//                "\t\t\t\t\tSELECT\n" +
+//                "\t\t\t\t\t\tcount(1) cnt,\n" +
+//                "\t\t\t\t\tpolicy.customerno\n" +
+//                "\t\t\t\tFROM\n" +
+//                "\t\t\t\t\tdsj.policy_information policy\n" +
+//                "\t\t\t\twhere\n" +
+//                "\t\t\t\t\tpolicy.SECURITY in('7天','15天','30天','90天','1月','3月')\n" +
+//                "\t\t\t\tand\n" +
+//                "\t\t\t\t\tpolicy.riskperiod='短期险'\n" +
+//                "\t\t\t\tand\t\n" +
+//                "\t\t\t\t\tpolicy.riskcode not in('1066008','1066007','1066006','1066004','1066003','1066002','1066001','1065005','1065003','1065001','1025003')\n" +
+//                "\t\t\t\tGROUP BY\n" +
+//                "\t\t\t\t\tpolicy.customerno \n" +
+//                "\t\t\t) t LEFT JOIN dsj.policy_information p ON t.customerno = p.customerno GROUP BY p.customerno\n" +
+//                "\t\t) temp where temp.customerno = si1.scustid \n" +
+//                "\n" +
+//                "\t);\n" +
+//                "\t--29\t是否有趸交保单\tLabel29\t有趸交保单\tNOSPInsurance,POLICY_INFORMATION.PAYINTV='趸缴',PREMIUM_LIST.PAYMENT_PERIOD='一次交清'\t\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label29 = '有趸交保单' WHERE si1.scustid IN (\n" +
+//                "\t\tSELECT p.customerno FROM dsj.policy_information p WHERE p.payintv = '趸缴' and p.riskperiod = '长期险' AND p.contno IN (SELECT l.contno FROM dsj.PREMIUM_LIST l WHERE l.PAYMENT_PERIOD LIKE '%一次交清%')\t\n" +
+//                "\t);\t\n" +
+//                "\t--30\t是否给本人投保\tLabel30\t仅本人投保,本人已投保,本人未投保\tIself\t\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label30 = (\n" +
+//                "\t\n" +
+//                "\t\tSELECT \n" +
+//                "\t\t\tCASE \n" +
+//                "\t\t\t\tWHEN tt.bnum = 0  THEN '本人未投保'\n" +
+//                "\t\t\t\tWHEN tt.bnum > 0 and tt.bnum <> tt.tnum THEN '为本人投保'\n" +
+//                "\t\t\t\tWHEN tt.bnum > 0 and tt.bnum = tt.tnum THEN '仅为本人投保'\n" +
+//                "\t\t\tEND\n" +
+//                "\t\t\t\n" +
+//                "\t\tFROM (\n" +
+//                "\t\t\tSELECT t.customerno,MAX(t.bnum) bnum,count(*) as tnum FROM (\n" +
+//                "\t\t\t\tSELECT count(*) AS bnum,p.customerno FROM dsj.policy_information p WHERE p.relationtoappnt = '本人' GROUP BY p.customerno\n" +
+//                "\t\t\t) t LEFT JOIN dsj.policy_information pi ON pi.customerno = t.customerno GROUP BY t.customerno\n" +
+//                "\t\t) tt WHERE tt.customerno = si1.scustid\n" +
+//                "\t\n" +
+//                "\t);\n" +
+//                "\t--32\t是否给父母投保\tLabel31\t仅父母投保,父母已投保,父母未投保\tIparent\t\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label31 = (\n" +
+//                "\t\n" +
+//                "\t\tSELECT \n" +
+//                "\t\t\tCASE \n" +
+//                "\t\t\t\tWHEN tt.bnum = 0  THEN '父母未投保'\n" +
+//                "\t\t\t\tWHEN tt.bnum > 0 and tt.bnum <> tt.tnum THEN '为父母投保'\n" +
+//                "\t\t\t\tWHEN tt.bnum > 0 and tt.bnum = tt.tnum THEN '仅为父母投保'\n" +
+//                "\t\t\tEND\n" +
+//                "\t\t\t\n" +
+//                "\t\tFROM (\n" +
+//                "\t\t\tSELECT t.customerno,MAX(t.bnum) bnum,count(*) as tnum FROM (\n" +
+//                "\t\t\t\tSELECT count(*) AS bnum,p.customerno FROM dsj.policy_information p WHERE (p.RELATIONTOAPPNT = '子女' OR p.RELATIONTOAPPNT = '父母') AND p.birthday > p.insuredbirthday \n" +
+//                "\t\t\t\tGROUP BY p.customerno\n" +
+//                "\t\t\t) t LEFT JOIN dsj.policy_information pi ON pi.customerno = t.customerno GROUP BY t.customerno\n" +
+//                "\t\t) tt WHERE tt.customerno = si1.scustid\n" +
+//                "\t\n" +
+//                "\t);\n" +
+//                "\t--34\t是否给子女投保\tLabel32\t仅子女投保,子女已投保,子女未·投保\tIchildren\t\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label32 = (\n" +
+//                "\t\n" +
+//                "\t\tSELECT \n" +
+//                "\t\t\tCASE \n" +
+//                "\t\t\t\tWHEN tt.bnum = 0  THEN '子女未投保'\n" +
+//                "\t\t\t\tWHEN tt.bnum > 0 and tt.bnum <> tt.tnum THEN '为子女投保'\n" +
+//                "\t\t\t\tWHEN tt.bnum > 0 and tt.bnum = tt.tnum THEN '仅为子女投保'\n" +
+//                "\t\t\tEND\n" +
+//                "\t\t\t\n" +
+//                "\t\tFROM (\n" +
+//                "\t\t\tSELECT t.customerno,MAX(t.bnum) bnum,count(*) as tnum FROM (\n" +
+//                "\t\t\tSELECT nvl(count(*),0) AS bnum,p.customerno FROM dsj.policy_information p WHERE (p.RELATIONTOAPPNT = '子女' OR p.RELATIONTOAPPNT = '父母') AND p.birthday < p.insuredbirthday GROUP BY p.customerno\n" +
+//                "\t\t) t LEFT JOIN dsj.policy_information pi ON pi.customerno = t.customerno GROUP BY t.customerno\n" +
+//                "\t\t) tt WHERE tt.customerno = si1.scustid\n" +
+//                "\t);\n" +
+//                "\t\n" +
+//                "\t\t\n" +
+//                "\t--36\t是否给配偶投保\tLabel33\t仅配偶投保,配偶已投保,配偶未投保\tImate\t\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label33 = (\n" +
+//                "\t\n" +
+//                "\t\tSELECT \n" +
+//                "\t\t\tCASE \n" +
+//                "\t\t\t\tWHEN tt.bnum = 0  THEN '配偶未投保'\n" +
+//                "\t\t\t\tWHEN tt.bnum > 0 and tt.bnum <> tt.tnum THEN '为配偶投保'\n" +
+//                "\t\t\t\tWHEN tt.bnum > 0 and tt.bnum = tt.tnum THEN '仅为配偶投保'\n" +
+//                "\t\t\tEND\n" +
+//                "\t\t\t\n" +
+//                "\t\tFROM (\n" +
+//                "\t\t\tSELECT t.customerno,MAX(t.bnum) bnum,count(*) as tnum FROM (\n" +
+//                "\t\t\t\tSELECT count(*) AS bnum,p.customerno FROM dsj.policy_information p WHERE p.relationtoappnt = '配偶' GROUP BY p.customerno\n" +
+//                "\t\t\t) t LEFT JOIN dsj.policy_information pi ON pi.customerno = t.customerno GROUP BY t.customerno\n" +
+//                "\t\t) tt WHERE tt.customerno = si1.scustid\n" +
+//                "\t);\t\n" +
+//                "\t--47\t是否仅有1年期短险保单\tLabel43\t仅有1年期短险保单,有1年期短险保单\t\"policy_information表 SECURITY in('1年','6月','180天') riskperiod=‘短期险’\n" +
+//                "\t--riskcode not in('1066008','1066007','1066006','1066004','1066003','1066002','1066001','1065005','1065003','1065001','1025003')\"\t客户为保单投保人,所有保单的保障期限为一年\n" +
+//                "\t/*UPDATE shanglifeecif.Individual si1 SET si1.Label43 = (\n" +
+//                "\t\tSELECT\n" +
+//                "\t\t\tCASE\t\n" +
+//                "\t\t\t\tWHEN temp.cnt >0 THEN\n" +
+//                "\t\t\t\t\t\t'有1年期短险保单' \t\n" +
+//                "\t\t\tEND\n" +
+//                "\t\tFROM\n" +
+//                "\t\t\t(\n" +
+//                "\t\t\tSELECT\n" +
+//                "\t\t\t\tcount(1) cnt,\n" +
+//                "\t\t\t\tpolicy.customerno \n" +
+//                "\t\t\tFROM\n" +
+//                "\t\t\t\tpolicy_information policy\n" +
+//                "\t\t\twhere\n" +
+//                "\t\t\t\tpolicy.SECURITY in('1年','6月','180天')\n" +
+//                "\t\t\tand\n" +
+//                "\t\t\t\tpolicy.riskperiod='短期险'\n" +
+//                "\t\t\tand\t\n" +
+//                "\t\t\t\tpolicy.riskcode not in('1066008','1066007','1066006','1066004','1066003','1066002','1066001','1065005','1065003','1065001','1025003')\n" +
+//                "\t\t\t\n" +
+//                "\t\t\tGROUP BY\n" +
+//                "\t\t\t\tpolicy.customerno \n" +
+//                "\t\t\t) temp \n" +
+//                "\t\tWHERE\n" +
+//                "\t\ttemp.customerno = si1.scustid \n" +
+//                "\t);*/\n" +
+//                "\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label43 = (\n" +
+//                "\t\t\tSELECT  \n" +
+//                "\t\t\tCASE \n" +
+//                "\t\t\t\tWHEN temp.cnt > 0 AND temp.cnt = temp.tnum THEN '仅有1年期短险保单'\n" +
+//                "\t\t\t\tWHEN temp.cnt > 0 AND temp.cnt <> temp.tnum THEN '有1年期短险保单'\n" +
+//                "\t\t\tEND\n" +
+//                "\t\tFROM (\n" +
+//                "\t\t\t\tSELECT p.customerno,max(cnt) cnt,nvl(count(*),0) tnum FROM (\n" +
+//                "\t\t\t\t\tSELECT\n" +
+//                "\t\t\t\t\t\tcount(1) cnt,\n" +
+//                "\t\t\t\t\tpolicy.customerno\n" +
+//                "\t\t\t\tFROM\n" +
+//                "\t\t\t\t\tdsj.policy_information policy\n" +
+//                "\t\t\t\twhere\n" +
+//                "\t\t\t\t\tpolicy.SECURITY in('1年','6月','180天')\n" +
+//                "\t\t\t\tand\n" +
+//                "\t\t\t\t\tpolicy.riskperiod='短期险'\n" +
+//                "\t\t\t\tand\t\n" +
+//                "\t\t\t\t\tpolicy.riskcode not in('1066008','1066007','1066006','1066004','1066003','1066002','1066001','1065005','1065003','1065001','1025003')\n" +
+//                "\t\t\t\tGROUP BY\n" +
+//                "\t\t\t\t\tpolicy.customerno \n" +
+//                "\t\t\t) t LEFT JOIN dsj.policy_information p ON t.customerno = p.customerno GROUP BY p.customerno\n" +
+//                "\t\t) temp where temp.customerno = si1.scustid \n" +
+//                "\n" +
+//                "\t);\n" +
+//                "\t--48\t是否有失效保单\tLabel44\t有失效保单\tNOIVPolicy\t客户为保单投保人,持有保单中保单状态为失效 (最新文档逻辑)\n" +
+//                "\t\tUPDATE shanglifeecif.Individual si1 SET si1.label44 = '有失效保单' WHERE si1.scustid IN (\n" +
+//                "\t\tSELECT p.customerno FROM dsj.policy_information p WHERE p.appflag <> '有效' and p.contno IN (select contno from dsj.lccontstate where statetype = 'Available' and state = '1') \n" +
+//                "\t);\n" +
+//                "\t--49\t是否有缴费期满长险保单\tLabel45\t有缴费期满长险保单\tPOLICY_INFORMATION:paycount= payendyear AND riskperiod='长期险'\t客户持有保险期限为一年以上,剩余保费期数为0\n" +
+//                "\t\tUPDATE shanglifeecif.Individual si1 SET si1.label45 = '有缴费期满长险保单' WHERE si1.scustid IN (\n" +
+//                "\t\tSELECT p.customerno FROM dsj.policy_information p WHERE p.appflag = '有效' and p.paycount = p.payendyear AND p.riskperiod='长期险'\t\n" +
+//                "\t);\n" +
+//                "\t--50\t是否有续期缴费的保单\tLabel46\t有续期缴费的保单\t\t客户为投保人,含有待缴费状态的保单\n" +
+//                "\t\tUPDATE shanglifeecif.Individual si1 SET si1.label46 = '有续期缴费保单' WHERE si1.scustid IN (\n" +
+//                "\t\tSELECT p.customerno FROM dsj.policy_information p WHERE p.appflag = '有效' and p.contno IN (\n" +
+//                "\t\t\tselect otherno from dsj.ljspay where othernotype = '2'\n" +
+//                "\t\t) \n" +
+//                "\t);\n" +
+//                "\t--51\t有责任期满的保单\tLabel47\t有责任期满的保单\t\t客户持有保单含有保险期限已满的保单\n" +
+//                "\t\tUPDATE shanglifeecif.Individual si1 SET si1.label47 = '有责任期满的保单' WHERE si1.scustid IN (\n" +
+//                "\t\tSELECT p.customerno FROM dsj.policy_information p WHERE p.enddate < to_char(SYSDATE,\"yyyy-MM-dd HH:mm:ss.S\")\n" +
+//                "\t);\n" +
+//                "\t\t\n" +
+//                "\t--52\t第一张保单投保日期\tLabel48\t首次投保日期XXXX-XX-XX\tFADate\t客户所有保单中投保时间最早的日期\n" +
+//                "\t--第一步  \n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.FADate = (\n" +
+//                "\tSELECT fadate FROM (\n" +
+//                "\t\tSELECT p.customerno,min(p.polapplydate) AS fadate  FROM dsj.POLICY_INFORMATION p WHERE p.polapplydate IS NOT null GROUP BY p.customerno\n" +
+//                "\t\t) t WHERE t.customerno = si1.scustid\n" +
+//                "\t);\n" +
+//                "\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.FADate = (\n" +
+//                "\t\tSELECT fadate FROM (\n" +
+//                "\t\t\tSELECT p.insuredno,min(p.polapplydate) AS fadate  FROM dsj.POLICY_INFORMATION p WHERE p.polapplydate IS NOT null GROUP BY p.insuredno\n" +
+//                "\t\t\t) t WHERE t.insuredno = si1.scustid\n" +
+//                "\t);\n" +
+//                "\t\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label48 = '首次投保日期'||  to_char(si1.fadate, 'yyyy-MM-dd')  WHERE si1.fadate IS NOT NULL;\n" +
+//                "\n" +
+//                "\t--53\t最后一次寿险投保距今时长\tLabel49\t最后一次投保距今XXX天\tLAPPDate\t当前日期减去客户所有保单中最后一次投保的保单的投保时间\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.LAPPDate = (\n" +
+//                "\t\tSELECT fadate FROM (\n" +
+//                "\t\t\tSELECT p.customerno,max(p.polapplydate) AS fadate  FROM dsj.POLICY_INFORMATION p WHERE p.polapplydate IS NOT null GROUP BY p.customerno\n" +
+//                "\t\t\t) t WHERE t.customerno = si1.scustid\n" +
+//                "\t\t);\n" +
+//                "\t\t\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.LAPPDate = (\n" +
+//                "\tSELECT fadate FROM (\n" +
+//                "\t\tSELECT p.insuredno,max(p.polapplydate) AS fadate  FROM dsj.POLICY_INFORMATION p WHERE p.polapplydate IS NOT null GROUP BY p.insuredno\n" +
+//                "\t\t) t WHERE t.insuredno = si1.scustid\n" +
+//                "\t);\t\t\n" +
+//                "\t\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label49 = '最后一次投保距今' || DATEDIFF(sysdate(), si1.LAPPDate) || '天' WHERE si1.lappdate IS NOT NULL;  \n" +
+//                "\t\t\n" +
+//                "\t--54\t最近一次保单所属渠道\tLabel50\t最近保单团险渠道、最近保单个人营销、最近保单银行代理、最近保单中介渠道、最近保单网销渠道\t--LPChannel,InsuranceArrangement.AgentChannel\t客户最后一次投保归属渠道\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label50 =  (SELECT '最近保单' || trim(t.salecomname) FROM (\n" +
+//                "\t\t\tSELECT p.customerno,row_number()OVER(PARTITION BY p.customerno ORDER BY p.polapplydate DESC) rd,p.salecomname  FROM dsj.POLICY_INFORMATION p \n" +
+//                "\t\t\tWHERE p.salecomname IS NOT null\n" +
+//                "\t\t) t WHERE t.rd = 1 AND t.customerno = si1.scustid);\n" +
+//                "\t\n" +
+//                "\t\n" +
+//                "\t--UPDATE shanglifeecif.Individual si1 SET si1.label50 =  (SELECT t.SALECHNL FROM (\n" +
+//                "\t\t\t--SELECT p.customerno,row_number()OVER(PARTITION BY p.customerno ORDER BY p.polapplydate DESC) rd,p.SALECHNL  FROM POLICY_INFORMATION p WHERE p.salechnl IS NOT null\n" +
+//                "\t\t--) t WHERE t.rd = 1 AND t.customerno = si1.scustid);\n" +
+//                "\n" +
+//                "\t--UPDATE shanglifeecif.Individual si1 SET si1.label50 =  '最近保单' || si1.label50 WHERE si1.label50 IS NOT NULL;\n" +
+//                "\t--55\t最近一次保单所属机构\tLabel51\t最近XX机构\tLPOrg,InsuranceArrangement.AgentOrg\t客户最后一次投保归属机构\n" +
+//                "\t--UPDATE shanglifeecif.Individual si1 SET si1.label51 =  (SELECT t.AGENTCOM FROM (\n" +
+//                "\t\t--\tSELECT p.customerno,row_number()OVER(PARTITION BY p.customerno ORDER BY p.polapplydate DESC) rd,p.AGENTCOM  FROM POLICY_INFORMATION p WHERE p.salechnl IS NOT null\n" +
+//                "\t\t--) t WHERE t.rd = 1 AND t.customerno = si1.scustid);\n" +
+//                "\n" +
+//                "\t--UPDATE shanglifeecif.Individual si1 SET si1.label51 =  '最近机构' || si1.label51 WHERE si1.label51 IS NOT NULL;\n" +
+//                "\t--56\t最早保单所属渠道\tLabel52\t首单团险渠道、首单个人营销、首单银行代理、首单中介渠道、首单网销渠道\tFAChannel\t客户第一次投保时保单归属渠道\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label52 =  (SELECT '首单' || trim(t.salecomname) FROM (\n" +
+//                "\t\t\tSELECT p.customerno,row_number()OVER(PARTITION BY p.customerno ORDER BY p.polapplydate asc) rd,p.salecomname  FROM dsj.POLICY_INFORMATION p WHERE p.salecomname IS NOT null\n" +
+//                "\t\t) t WHERE t.rd = 1 AND t.customerno = si1.scustid);\t\n" +
+//                "\t\n" +
+//                "\t\n" +
+//                "\t--UPDATE shanglifeecif.Individual si1 SET si1.label52 =  (SELECT t.SALECHNL FROM (\n" +
+//                "\t\t\t--SELECT p.customerno,row_number()OVER(PARTITION BY p.customerno ORDER BY p.polapplydate asc) rd,p.SALECHNL  FROM POLICY_INFORMATION p WHERE p.salechnl IS NOT null\n" +
+//                "\t\t--) t WHERE t.rd = 1 AND t.customerno = si1.scustid);\n" +
+//                "\n" +
+//                "\t--UPDATE shanglifeecif.Individual si1 SET si1.label52 =  '首单' || si1.label52 WHERE si1.label52 IS NOT NULL;\n" +
+//                "\t--57\t最早保单所属机构\tLabel53\t首单XX机构\tFAOrg\t客户第一次投保时保单归属机构\n" +
+//                "\t--UPDATE shanglifeecif.Individual si1 SET si1.label53 =  (SELECT t.AGENTCOM FROM (\n" +
+//                "\t--\tSELECT p.customerno,row_number()OVER(PARTITION BY p.customerno ORDER BY p.polapplydate ASC) rd,p.AGENTCOM  FROM POLICY_INFORMATION p WHERE p.salechnl IS NOT null\n" +
+//                "\t--) t WHERE t.rd = 1 AND t.customerno = si1.scustid);\n" +
+//                "\n" +
+//                "\t--UPDATE shanglifeecif.Individual si1 SET si1.Label53 =  '最近机构' || si1.Label53 WHERE si1.Label53 IS NOT NULL;\n" +
+//                "\t--58\t最近保单状态\tLabel54\t\"未承保承保新增附加险终止续保未对账对账失败\"\tLPState\t客户最后一张保单的保单状态\n" +
+//                "\t/*\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label54 = \n" +
+//                "\t(SELECT \n" +
+//                "\t\t(CASE temp.appflag \n" +
+//                "\t\tWHEN '0' THEN '最近保单状态未承保' \n" +
+//                "\t\tWHEN '1' THEN '最近保单状态承保' \n" +
+//                "\t\tWHEN '2' THEN '最近保单状态新增附加险' \n" +
+//                "\t\tWHEN '4' THEN '最近保单状态终止' \n" +
+//                "\t\tWHEN '9' THEN '最近保单状态续保' \n" +
+//                "\t\tWHEN 'B' THEN '最近保单状态未对账' \n" +
+//                "\t\tWHEN 'F' THEN '最近保单状态对账失败' \n" +
+//                "\t\tEND) a \n" +
+//                "\tFROM (\n" +
+//                "\t\tSELECT t.appflag,p.customerno,row_number()OVER(PARTITION BY p.customerno ORDER BY p.polapplydate desc) rd FROM dsj.policy_information p,dsj.lccont t WHERE p.contno = t.contno\n" +
+//                "\t) temp WHERE temp.rd = 1  AND si1.scustid = temp.customerno);\n" +
+//                "\t*/\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label54 = (\n" +
+//                "\t\tSELECT '最近保单状态'||trim(t.appflag) FROM (\n" +
+//                "\t\t\tSELECT row_number()OVER(PARTITION BY p.customerno ORDER BY p.polapplydate DESC) rd,p.customerno,p.appflag FROM dsj.policy_information p\n" +
+//                "\t\t) t WHERE t.rd = 1 AND si1.scustid = t.customerno\n" +
+//                "\t);\n" +
+//                "\t\n" +
+//                "\t--\t最近一次保全类型\tlabel55\t客户最后一次办理保全业务的业务类型\t\n" +
+//                "\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label55 = (\n" +
+//                "\t\tSELECT '客户最近一次办理'||t.edorname FROM (\n" +
+//                "\t\t\tSELECT\n" +
+//                "\t\t\t\trow_number() over(partition by p.customerno ORDER BY l.edorAPPDATE DESC,l.uwtime DESC) rn,\n" +
+//                "\t\t\t\tl.edortype,\n" +
+//                "\t\t\t\tl.contno,\n" +
+//                "\t\t\t\tp.customerno,\n" +
+//                "\t\t\t\tl.edorappdate,\n" +
+//                "\t\t\t\tl.edorstate,\n" +
+//                "\t\t\t\tlm.edorcode,\n" +
+//                "\t\t\t\tlm.edorname \n" +
+//                "\t\t\t\tFROM dsj.lpedoritem l,dsj.lmedoritem lm,dsj.policy_information p \n" +
+//                "\t\t\t\tWHERE l.edortype = lm.edorcode AND lm.appobj <> 'G' AND l.edorstate = '0' AND p.contno = l.contno\n" +
+//                "\t\t\t) t WHERE t.rn = 1 AND si1.scustid = t.customerno\n" +
+//                "\t) WHERE 1 = 1;\n" +
+//                "\t\n" +
+//                "\t\n" +
+//                "\t--60\t是否有退保保单\tLabel56\t有退保保单\t如何判断?\t客户所有的保单中是否存在保单状态为退保的保单\n" +
+//                "\t\tUPDATE shanglifeecif.Individual si1 SET si1.label56 = '有退保保单' WHERE si1.scustid IN (\n" +
+//                "\t\tSELECT p.customerno FROM dsj.policy_information p WHERE p.contno IN (\n" +
+//                "\t\t\tselect contno from dsj.lpedoritem where  edortype in ('CT', 'XT', 'GT') and edorstate = '0'\n" +
+//                "\t\t) \n" +
+//                "\t);\n" +
+//                "\t\n" +
+//                "\t--61\t最近一次理赔类型\tLabel57\t--意外医疗、意外伤残、意外死亡、意外高残、意外大病、意外特种疾病、意外失业失能、意外生命末期重疾、意外豁免、疾病医疗、疾病伤残、疾病死亡、疾病高残、疾病大病、疾病特种疾病、疾病失---业失能、疾病生命末期重疾、疾病豁免\t无\t客户最后一次投办理理赔业务的业务类型\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label57 = (\n" +
+//                "\tSELECT \"最近一次理赔类型\" || t.ACCIDENTTYPE FROM (\n" +
+//                "\t\tSELECT row_number()OVER(PARTITION BY c.insuredno ORDER BY c.applydate desc) rd,c.insuredno,c.ACCIDENTTYPE FROM dsj.INSURANCE_CLAIM c\n" +
+//                "\t\t) t WHERE t.rd = 1 AND t.insuredno = si1.scustid\n" +
+//                "\t);\n" +
+//                "\t--62\t最近一次出险类型\tLabel58\t疾病出险、意外出险\t无\t客户最后一次出险的类型\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label58 = (\n" +
+//                "\t\tSELECT \"最近一次出险类型\" || t.RISKTYPE FROM (\n" +
+//                "\t\t\tSELECT row_number()OVER(PARTITION BY c.insuredno ORDER BY c.applydate desc) rd,c.insuredno,c.RISKTYPE FROM dsj.INSURANCE_CLAIM c\n" +
+//                "\t\t) t WHERE t.rd = 1 AND t.insuredno = si1.scustid\n" +
+//                "\t);\n" +
+//                "\t--63\t最近一次理赔状态\tLabel59\t理赔报案中、理赔已受理、理赔已立案、理赔审核中、理赔预付审批中、理赔结案、理赔完成、理赔关闭\tInsuranceClaimThread.ClaimCaseStatus\t--客户最后一次发生理赔的理赔类型\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label59 = (\n" +
+//                "\t\tSELECT '最近一次理赔状态' || t.LLCLAIMSTATE FROM (\n" +
+//                "\t\t\tSELECT row_number()OVER(PARTITION BY c.insuredno ORDER BY c.applydate desc) rd,c.insuredno,c.LLCLAIMSTATE FROM dsj.INSURANCE_CLAIM c\n" +
+//                "\t\t) t WHERE t.rd = 1 AND t.insuredno = si1.scustid\n" +
+//                "\t);\n" +
+//                "\t--65\t是否有满期给付保单\tLabel61\t有满期给付保单\t如何判断?\t0\n" +
+//                "\t--select getdutycode from lmdutygetalive where getdutyname in ('满期保险金','满期生存保险金');\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label61 = '有满期给付保单' WHERE si1.scustid IN (\n" +
+//                "\t\tSELECT p.customerno FROM dsj.policy_information p WHERE p.contno IN (\n" +
+//                "\t\t\tSELECT contno FROM dsj.lcget WHERE getdutycode IN (select getdutycode from dsj.lmdutygetalive where getdutyname in ('满期保险金','满期生存保险金'))\n" +
+//                "\t\t) \n" +
+//                "\t);\n" +
+//                "\t--67\t是否有生存金给付的保单\tLabel63\t有生存金给付保单\t无\t0\n" +
+//                "\t--select getdutycode from lmdutygetalive where getdutyname = '生存保险金';\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label62 = '有生存金给付的保单' WHERE si1.scustid IN (\n" +
+//                "\t\tSELECT p.customerno FROM dsj.policy_information p WHERE p.contno IN (\n" +
+//                "\t\t\tSELECT contno FROM dsj.lcget WHERE getdutycode IN (select getdutycode from dsj.lmdutygetalive where getdutyname = '生存保险金')\n" +
+//                "\t\t) and p.appflag = '有效'\n" +
+//                "\t);\n" +
+//                "\t--68\t是否有红利可领取的保单\tLabel64\t有红利可领取保单\t无\t0\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label64 = '红利可领取的保单' WHERE si1.scustid IN \n" +
+//                "\t(SELECT p.customerno FROM dsj.policy_information p,dsj.lmriskapp l WHERE p.appflag = '有效' and p.riskcode = l.riskcode AND l.bonusflag = 1);\n" +
+//                "\t\n" +
+//                "\t--69\t一单寿险客户\tLabel65\t一单寿险客户\t客户仅购买了一张保单,且保单类型为寿险型保单\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label65 = '一单寿险客户' WHERE si1.scustid IN (SELECT temp.customerno FROM (\n" +
+//                "\t\tSELECT pi.customerno,count(DISTINCT pi.contno) AS tnum,max(t.pnum) AS pnum FROM (\n" +
+//                "\t\t\tSELECT count(DISTINCT p.contno) AS pnum,p.customerno FROM dsj.POLICY_INFORMATION p \n" +
+//                "\t\tLEFT JOIN dsj.riskkind b on p.riskcode = b.riskcode\n" +
+//                "\t\tWHERE (b.kindtype = '新型寿险' or b.kindtype = '人寿保险') GROUP BY p.customerno\n" +
+//                "\t\t) t LEFT JOIN dsj.POLICY_INFORMATION pi ON pi.customerno = t.customerno\n" +
+//                "\t\tGROUP BY pi.customerno\n" +
+//                "\t)temp WHERE temp.tnum = temp.pnum AND tnum = 1);\n" +
+//                "\t--70\t缴费期满客户\tLabel66\t缴费期满客户\tPOLICY_INFORMATION:paycount= payendyear\t客户缴费期数已满\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label66 = '缴费期满客户' WHERE si1.scustid IN (\n" +
+//                "\t\tSELECT temp.customerno FROM (\n" +
+//                "\t\tSELECT count(*) AS tnum,max(t.customerno) AS customerno,max(t.pnum) AS pnum FROM (\n" +
+//                "\t\tSELECT p.customerno,count(*) AS pnum FROM  dsj.policy_information p WHERE p.paycount = p.payendyear  GROUP BY p.customerno \n" +
+//                "\t\t) t LEFT JOIN dsj.policy_information pi ON pi.customerno = t.customerno\n" +
+//                "\t\tGROUP BY pi.customerno\n" +
+//                "\t\t) temp WHERE temp.tnum = temp.pnum\n" +
+//                "\t);\n" +
+//                "\t--71\t生日与司庆日同一天客户\tLabel67\t生日与司庆日同天\t2月15号 为司庆日\t客户生日和公司司庆日为同一天\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label67 = '生日与司庆日同天' where si1.birthday like '%-02-15%';\t\n" +
+//                "\t--72\t持有有效保单产品类型客户标签\tLabel68\t持有有效保单,未持有有效保单\t\t客户名下是否有投保人为自己的有效保单\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label68 = '持有有效保单' WHERE si1.scustid IN (SELECT t.customerno FROM (\n" +
+//                "\t\t\tSELECT count(*) AS pnum,p.customerno FROM dsj.POLICY_INFORMATION p \n" +
+//                "\t\tWHERE p.appflag = '有效' GROUP BY p.customerno\n" +
+//                "\t\t) t WHERE t.pnum > 0);\n" +
+//                "\t--73\t客户等级标签\tLabel69\t钻石、白金、黄金、普通\tIndividual.CustClass\t根据CustClass字段已有的等级值显示\n" +
+//                "\t--UPDATE shanglifeecif.Individual si1 SET si1.Label69 = si1.CustClass where 1 = 1;\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label69 = (\n" +
+//                "\t\t\t\t\t\tCASE si1.CustClass \n" +
+//                "\t\t\t\t\t\tWHEN 1 THEN '钻石客户'\n" +
+//                "\t\t\t\t\t\tWHEN 2 THEN '白金客户'\n" +
+//                "\t\t\t\t\t\tWHEN 3 THEN '黄金客户'\n" +
+//                "\t\t\t\t\t\t--WHEN 4 THEN '普通级别'\n" +
+//                "\t\t\t\t\t\t--ELSE '无级别' \n" +
+//                "\t\t\t\t\t\tELSE ''\n" +
+//                "\t\t\t\t\t\tEND\n" +
+//                "\t\t\t\t\t\t) where 1 = 1;\t\n" +
+//                "\t--74\t最近接触业务类型\tLabel70\t最近投诉、最近问询(咨询)、最近营销、最近理赔、最近出险、最近保全\tIndividual.LCType\t客户最后一次接触的业务类型\n" +
+//                "\t\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label70 = (\n" +
+//                "\tSELECT '最近'||t.scenario FROM (\n" +
+//                "\tSELECT \n" +
+//                "\trow_number()OVER(PARTITION BY pl.partyid ORDER BY pl.sdate desc) rn,\n" +
+//                "\tpl.partyid,\n" +
+//                "\tpl.scenario\n" +
+//                "\tFROM shanglifeecif.partytimeline pl WHERE pl.partyid IS NOT NULL\n" +
+//                ") t WHERE t.rn = 1 AND si1.scustid = t.partyid\n" +
+//                ");\n" +
+//                "\n" +
+//                "\t\n" +
+//                "\t--75\t最近接触方式\tLabel71\t最近外呼、最近呼入、微信\tIndividual.LCMethod\t客户最后一次接触的方式\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label71 = (\n" +
+//                "\tSELECT '最近'||CASE t.scenario WHEN '回访' THEN '外呼' WHEN '咨询' THEN '呼入' END FROM (\n" +
+//                "\tSELECT \n" +
+//                "\trow_number()OVER(PARTITION BY pl.partyid ORDER BY pl.sdate desc) rn,\n" +
+//                "\tpl.partyid,\n" +
+//                "\tpl.scenario\n" +
+//                "\tFROM shanglifeecif.partytimeline pl WHERE pl.partyid IS NOT NULL AND (pl.scenario = '回访' OR pl.scenario = '咨询')\n" +
+//                ") t WHERE t.rn = 1 AND si1.scustid = t.partyid\n" +
+//                ");\n" +
+//                "\t\n" +
+//                "\t\n" +
+//                "\t--77\t是否关注官微\tLabel73\t关注官微\t无\t0\n" +
+//                "\t--UPDATE shanglifeecif.Individual si1 SET si1.Label73 = '关注官微'\n" +
+//                "\t--WHERE si1.idcard IN (SELECT a.certificate_no FROM account a) \n" +
+//                "\t--OR si1.passport IN (SELECT a.certificate_no FROM account a) \n" +
+//                "\t--OR si1.Dlicense IN  (SELECT a.certificate_no FROM account a) \n" +
+//                "\t--OR si1.othernumber IN (SELECT a.certificate_no FROM account a);\n" +
+//                "\n" +
+//                "\t--78\t是否注册官微\tLabel74\t注册官微\t无\t0\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label74 = '注册官微'\n" +
+//                "\tWHERE si1.idcard IN (SELECT a.certificate_no FROM dsj.account a WHERE a.account_status = 0) \n" +
+//                "\t\tOR si1.passport IN (SELECT a.certificate_no FROM dsj.account a WHERE a.account_status = 0) \n" +
+//                "\t\tOR si1.Dlicense IN  (SELECT a.certificate_no FROM dsj.account a WHERE a.account_status = 0) \n" +
+//                "\t\tOR si1.othernumber IN (SELECT a.certificate_no FROM dsj.account a WHERE a.account_status = 0);\n" +
+//                "\t\t\n" +
+//                "\n" +
+//                "\t\tUPDATE shanglifeecif.Individual si1 SET si1.label76 = '丈夫生日临近' WHERE si1.scustid IN (\n" +
+//                "\tSELECT sis.indid1 FROM shanglifeecif.indrelationship sis LEFT JOIN shanglifeecif.individual si ON sis.indid2 = si.scustid\n" +
+//                "\t\tWHERE sis.rstype = '配偶' AND DATEDIFF(to_char(si.birthday,\"2021-MM-dd\"),to_char(SYSDATE,\"2021-MM-dd\"))<=5 AND \n" +
+//                "\t\tDATEDIFF(to_char(si.birthday,\"2021-MM-dd\"),to_char(SYSDATE,\"2021-MM-dd\"))>0 AND sis.role2 = '丈夫'\n" +
+//                "\t);\n" +
+//                "UPDATE shanglifeecif.Individual si1 SET si1.label76 = '妻子生日临近' WHERE si1.scustid IN (\n" +
+//                "\tSELECT sis.indid1 FROM shanglifeecif.indrelationship sis LEFT JOIN shanglifeecif.individual si ON sis.indid2 = si.scustid\n" +
+//                "\t\tWHERE sis.rstype = '配偶' AND DATEDIFF(to_char(si.birthday,\"2021-MM-dd\"),to_char(SYSDATE,\"2021-MM-dd\"))<=5 AND \n" +
+//                "\t\tDATEDIFF(to_char(si.birthday,\"2021-MM-dd\"),to_char(SYSDATE,\"2021-MM-dd\"))>0 AND sis.role2 = '妻子'\n" +
+//                "\t);\n" +
+//                "\t--\t本人生日提醒\tLabel77\t本人生日临近\t\t客户生日-当前日期<5\n" +
+//                "\t--UPDATE shanglifeecif.Individual si1 SET si1.label77 = '本人生日临近' WHERE DATEDIFF(to_char(SYSDATE,\"2021-MM-dd\"),to_char(si1.birthday,\"2021-MM-dd\"))<=5 AND \n" +
+//                "\t\t--DATEDIFF(to_char(SYSDATE,\"2021-MM-dd\"),to_char(si1.birthday,\"2021-MM-dd\"))>0;\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label77 = '本人生日临近' WHERE DATEDIFF(to_char(si1.birthday,\"2021-MM-dd\"),to_char(SYSDATE,\"2021-MM-dd\"))<=5 AND \n" +
+//                "\t\tDATEDIFF(to_char(si1.birthday,\"2021-MM-dd\"),to_char(SYSDATE,\"2021-MM-dd\"))>0;\n" +
+//                "\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label78 = '父亲生日临近' WHERE si1.scustid IN (\n" +
+//                "\tSELECT sis.indid1 FROM shanglifeecif.indrelationship sis LEFT JOIN shanglifeecif.individual si ON sis.indid2 = si.scustid\n" +
+//                "\t\tWHERE sis.rstype = '父母' AND DATEDIFF(to_char(si.birthday,\"2021-MM-dd\"),to_char(SYSDATE,\"2021-MM-dd\"))<=5 AND \n" +
+//                "\t\tDATEDIFF(to_char(si.birthday,\"2021-MM-dd\"),to_char(SYSDATE,\"2021-MM-dd\"))>0 AND sis.role2 = '父亲'\n" +
+//                "\t);\n" +
+//                "\n" +
+//                "UPDATE shanglifeecif.Individual si1 SET si1.label78 = '母亲生日临近' WHERE si1.scustid IN (\n" +
+//                "\tSELECT sis.indid1 FROM shanglifeecif.indrelationship sis LEFT JOIN shanglifeecif.individual si ON sis.indid2 = si.scustid\n" +
+//                "\t\tWHERE sis.rstype = '父母' AND DATEDIFF(to_char(si.birthday,\"2021-MM-dd\"),to_char(SYSDATE,\"2021-MM-dd\"))<=5 AND \n" +
+//                "\t\tDATEDIFF(to_char(si.birthday,\"2021-MM-dd\"),to_char(SYSDATE,\"2021-MM-dd\"))>0 AND sis.role2 = '母亲'\n" +
+//                "\t);\n" +
+//                "\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label79 = '儿子生日临近' WHERE si1.scustid IN (\n" +
+//                "\t\tSELECT sis.indid1 FROM shanglifeecif.indrelationship sis LEFT JOIN shanglifeecif.individual si ON sis.indid2 = si.scustid\n" +
+//                "\t\t\tWHERE sis.rstype = '子女' AND DATEDIFF(to_char(si.birthday,\"2021-MM-dd\"),to_char(SYSDATE,\"2021-MM-dd\"))<=5 AND \n" +
+//                "\t\t\tDATEDIFF(to_char(si.birthday,\"2021-MM-dd\"),to_char(SYSDATE,\"2021-MM-dd\"))>0 AND sis.role2 = '儿子'\n" +
+//                "\t);\n" +
+//                "\n" +
+//                "UPDATE shanglifeecif.Individual si1 SET si1.label79 = '女儿生日临近' WHERE si1.scustid IN (\n" +
+//                "\t\tSELECT sis.indid1 FROM shanglifeecif.indrelationship sis LEFT JOIN shanglifeecif.individual si ON sis.indid2 = si.scustid\n" +
+//                "\t\t\tWHERE sis.rstype = '子女' AND DATEDIFF(to_char(si.birthday,\"2021-MM-dd\"),to_char(SYSDATE,\"2021-MM-dd\"))<=5 AND \n" +
+//                "\t\t\tDATEDIFF(to_char(si.birthday,\"2021-MM-dd\"),to_char(SYSDATE,\"2021-MM-dd\"))>0 AND sis.role2 = '女儿'\n" +
+//                "\t);\n" +
+//                "\t--69\t近期咨询过产品\tlabel80\t7天内呼入咨询过,呼叫中心服务记录、咨询转办单提取关键字段(包含产品咨询)或服务记录中包含保单基本信息、投保咨询\t近期咨询产品\t\n" +
+//                "\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label80 = '近期咨询过产品' WHERE si1.scustid IN (\n" +
+//                "\t\tSELECT dp.customerno FROM dsj.policy_information dp WHERE dp.contno IN (\n" +
+//                "\t\tSELECT rm.contnos FROM dsj.cc_record_main rm WHERE (rm.reasonsecondname LIKE '%保单基本信息%' OR rm.reasonsecondname LIKE '%投保咨询%')\n" +
+//                "\t\tand rm.contnos IS not NULL AND DATEDIFF(SYSDATE,rm.starttime) < 7 )\n" +
+//                "\t);\n" +
+//                "\n" +
+//                "\t--70\t近期咨询过理赔\tlabel81\t7天内呼入咨询过,呼叫中心服务记录、咨询转办单提取关键字段(包含理赔咨询)或服务记录、咨询转办单中包含理赔字段\t近期咨询理赔\t\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label81 = '近期咨询过理赔' WHERE si1.scustid IN (\n" +
+//                "\t\tSELECT dp.customerno FROM dsj.policy_information dp WHERE dp.contno IN (\n" +
+//                "\t\tSELECT rm.contnos FROM dsj.cc_record_main rm WHERE rm.reasonsecondname LIKE '%理赔%'\n" +
+//                "\t\tand rm.contnos IS not NULL AND DATEDIFF(SYSDATE,rm.starttime) < 7)\n" +
+//                "\t);\n" +
+//                "\t\n" +
+//                "\t--75\t续期临期未缴费\tlabel88\t续期缴费期到宽限期未交费,续期缴费日期-当前日期<5\t续期临期未缴费\t\n" +
+//                "\t\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label88 = '续期临期未缴费' WHERE si1.scustid IN (\n" +
+//                "\t\tSELECT p.customerno FROM dsj.policy_information p WHERE p.appflag = '有效'AND p.payintv = '期缴' AND p.payendyear<>p.paycount  AND \n" +
+//                "\t\tDATEDIFF(p.paytodate,to_char(SYSDATE,'yyyy-MM-dd HH:mm:ss.S')) > 0 and DATEDIFF(p.paytodate,to_char(SYSDATE,'yyyy-MM-dd HH:mm:ss.S')) < 5\n" +
+//                "\t);\n" +
+//                "\t--76\t续期到期未缴费\tlabel89\t过了续期宽限期,仍未缴费\t续期到期未缴费\t\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label89 = '续期到期未缴费' WHERE si1.scustid IN (\n" +
+//                "\t\tSELECT p.customerno FROM dsj.policy_information p WHERE p.appflag = '有效'AND p.payintv = '期缴' AND p.payendyear<>p.paycount  AND \n" +
+//                "\t\tto_char(SYSDATE,'yyyy-MM-dd HH:mm:ss.S') > DATE_ADD(p.paytodate, 60)\n" +
+//                "\t);\n" +
+//                "\n" +
+//                "\t\t\n" +
+//                "\t--93\t失效客户\tLabel91\t失效客户\t所有保单都是失效状态\t客户名下所有保单均失效的客户\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label91 = '失效客户' WHERE si1.scustid IN (SELECT temp.customerno FROM (\n" +
+//                "\tSELECT count(*) AS tnum,max(t.customerno) AS customerno,max(t.pnum) AS pnum FROM (\n" +
+//                "\tSELECT p.customerno,count(*) AS pnum FROM  dsj.policy_information p WHERE p.appflag <> '有效' GROUP BY p.customerno \n" +
+//                "\t) t LEFT JOIN dsj.policy_information pi ON pi.customerno = t.customerno\n" +
+//                "\tGROUP BY pi.customerno\n" +
+//                "\t) temp WHERE temp.tnum = temp.pnum);\n" +
+//                "\t\n" +
+//                "\t--失效原因 label92\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label92 = (\n" +
+//                "\tSELECT '有'||t.terminatestate||'保单' FROM (\n" +
+//                "\t\tSELECT row_number()over(partition by p.customerno order by p.polapplydate desc) rn,p.customerno,p.terminatestate FROM dsj.policy_information p \n" +
+//                "\t\tWHERE p.appflag = '失效'\n" +
+//                "\t) t WHERE t.rn = 1 AND si1.scustid = t.customerno\n" +
+//                ");\n" +
+//                "\t--\t终止客户\tlabel93\t客户的所有保单缴费期满且承保期限已满正常终止的客户\t终止客户\t\n" +
+//                "\t--UPDATE shanglifeecif.Individual si1 SET si1.Label93 = '终止客户' WHERE si1.scustid IN (SELECT temp.customerno FROM (\n" +
+//                "\t--SELECT count(*) AS tnum,max(t.customerno) AS customerno,max(t.pnum) AS pnum FROM (\n" +
+//                "\t--SELECT p.customerno,count(*) AS pnum FROM  dsj.policy_information p WHERE p.appflag = '终止' AND p.enddate < to_char(SYSDATE,'yyyy-MM-dd HH:mm:ss.S') GROUP BY p.customerno \n" +
+//                "\t--) t LEFT JOIN dsj.policy_information pi ON pi.customerno = t.customerno\n" +
+//                "\t--GROUP BY pi.customerno\n" +
+//                "\t--) temp WHERE temp.tnum = temp.pnum);\n" +
+//                "\t--终止原因\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label94 = (\n" +
+//                "\tSELECT '有'||t.terminatestate||'保单' FROM (\n" +
+//                "\t\tSELECT row_number()over(partition by p.customerno order by p.polapplydate desc) rn,p.customerno,p.terminatestate FROM dsj.policy_information p \n" +
+//                "\t\tWHERE p.appflag = '终止'\n" +
+//                "\t) t WHERE t.rn = 1 AND si1.scustid = t.customerno\n" +
+//                ");\n" +
+//                "\t--81\t上年续期交费情况\tlabel95\t相对于上一年的交费日期和实收日期,提前X天交费、滞后X天交费、宽限期外交费、失效客户\t提前X天交费、滞后X天交费、宽限期外交费\t\n" +
+//                "\t--UPDATE shanglifeecif.Individual si1 SET si1.Label95 = (\n" +
+//                "\t--SELECT \n" +
+//                "\t--CASE \n" +
+//                "\t\t\n" +
+//                "\t--\tWHEN temp.dnum<0 THEN '上一年提前'||abs(temp.dnum)||'天交费'\n" +
+//                "\t--\tWHEN temp.dnum>0 THEN '上一年滞后'||temp.dnum||'天交费'\n" +
+//                "\t--\tWHEN temp.toconfdate > temp.kxdate THEN '上一年宽限期外交费'\n" +
+//                "\t--END\t\n" +
+//                "\t--\tFROM (\n" +
+//                "\t--\t\tSELECT row_number()over(PARTITION BY t.appntno ORDER BY t.confdate DESC) rn,t.appntno,t.paydate as topaydate,t.confdate as toconfdate,DATE_ADD(t.paydate,60) as --kxdate,tt.paydate as lastpaydate,tt.confdate AS lastconfdate,DATEDIFF(to_char(t.confdate,'0000-MM-dd'),to_char(tt.confdate,'0000-MM-dd')) AS dnum FROM (\n" +
+//                "\t--\t\tSELECT row_number()OVER(PARTITION BY ln.contno ORDER BY ln.paydate DESC) rd,ln.* FROM dsj.ljapayperson ln \n" +
+//                "\t--\t\tWHERE ln.confdate IS NOT NULL AND ln.paydate IS NOT null\n" +
+//                "\t--\t) t LEFT JOIN (\n" +
+//                "\t--\t\tSELECT row_number()OVER(PARTITION BY ln2.contno ORDER BY ln2.paydate DESC) rd,ln2.* FROM dsj.ljapayperson ln2\n" +
+//                "\t--\t\tWHERE ln2.confdate IS NOT NULL AND ln2.paydate IS NOT null AND ln2.paycount > 1\n" +
+//                "\t--\t) tt ON t.contno = tt.contno AND t.rd = tt.rd - 1 WHERE t.rd = 1 AND tt.rd = 2 \n" +
+//                "\t--\t) temp WHERE temp.dnum <> 0 AND temp.rn = 1 AND si1.scustid = temp.appntno\n" +
+//                "--) WHERE 1 = 1;\n" +
+//                "\t--UPDATE shanglifeecif.Individual si1 SET si1.Label95 = (\n" +
+//                "\t--\tSELECT\n" +
+//                "\t--\t\tCASE \n" +
+//                "\t--\t\tWHEN t.dnum<0 THEN '提前'||abs(t.dnum)||'天交费'\n" +
+//                "\t--\t\tWHEN t.dnum>0 AND t.dnum<=60 THEN '滞后'||t.dnum||'天交费'\n" +
+//                "\t--\t\tWHEN t.dnum>60 THEN '宽限期外交费'\n" +
+//                "\t--\t\tEND\n" +
+//                "\t--\tFROM (\n" +
+//                "\t--\t\tSELECT row_number()over(PARTITION BY p.customerno ORDER BY p.confdate DESC) rn,p.customerno,DATEDIFF(to_char(p.confdate,'0000-MM-dd'),to_char(p.polapplydate,'0000-MM-dd')) AS dnum FROM dsj.policy_information p \n" +
+//                "\t--\t\tWHERE p.appflag = '有效' AND p.payintv = '期缴'\n" +
+//                "\t--\t) t WHERE t.dnum <> 0 AND t.rn = 1 AND si1.scustid = t.customerno\n" +
+//                "\t--) WHERE 1 = 1;\n" +
+//                "\t\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label95 = (\n" +
+//                "\tSELECT  \n" +
+//                "\t\tCASE\n" +
+//                "\t\t\tWHEN t.dnum=0 THEN '上一年如期缴费'\n" +
+//                "\t\t\tWHEN t.dnum<0 THEN '上一年提前'||abs(t.dnum)||'天交费'\n" +
+//                "\t\t\tWHEN t.dnum>0 AND t.dnum<=60 THEN '上一年滞后'||t.dnum||'天交费'\n" +
+//                "\t\t\tWHEN t.dnum>60 THEN '上一年宽限期外交费'\n" +
+//                "\t\tEND\n" +
+//                "\tFROM (\n" +
+//                "\t\tSELECT \n" +
+//                "\t\trow_number()over(PARTITION BY l.appntno ORDER BY l.confdate DESC) rn,l.appntno,DATEDIFF(to_char(l.confdate,'0000-MM-dd'),to_char(l.curpaytodate,'0000-MM-dd')) AS dnum \n" +
+//                "\t\tFROM dsj.ljapayperson l WHERE l.paycount > 1 AND YEAR(l.confdate) = YEAR(sysdate) - 1\n" +
+//                "\t) t WHERE  t.rn = 1 AND t.appntno = si1.scustid\n" +
+//                "\t) WHERE 1 = 1;\n" +
+//                "\t\n" +
+//                "\t\n" +
+//                "\t--98\t大龄\tLabel96\t大龄 来电客户年龄50岁以上\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label96 = '大龄'  where si1.scustid IN (\n" +
+//                "\n" +
+//                "\tSELECT p.customerno FROM dsj.policy_information p WHERE p.contno IN (\n" +
+//                "\t\tSELECT contnos from dsj.cc_record_main\n" +
+//                "\t)\n" +
+//                ") AND TRUNC(months_between(sysdate, si1.birthday)/12)>=50 AND TRUNC(months_between(sysdate, si1.birthday)/12)<60;\n" +
+//                "\t--99\t高龄\tLabel97\t高龄\t\t来电客户年龄60岁以上\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label97 = '高龄' where si1.scustid IN (\n" +
+//                "\n" +
+//                "\tSELECT p.customerno FROM dsj.policy_information p WHERE p.contno IN (\n" +
+//                "\t\tSELECT contnos from dsj.cc_record_main\n" +
+//                "\t)\n" +
+//                ") AND TRUNC(months_between(sysdate, si1.birthday)/12)>=60;\n" +
+//                "\t--100\t敏感职业\tLabel100\t敏感职业\t\t投保人职业为记者、律师、公务员、媒体、金融行业\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label100 = (CASE WHEN si1.occupation like '%记者%' OR si1.occupation like '%律师%' OR si1.occupation like '%公务员%' OR  si1.occupation like '%媒体%' OR  si1.occupation like '%金融行业%' THEN '敏感职业' END ) WHERE 1 = 1;\n" +
+//                "    --102\t公司销售人员\tLabel100\t公司销售人员\t姓名与保单经办人一致\t客户为公司销售人员\n" +
+//                "\t--103\t长通话\tLabel101\t长通话\t\"contnos为客户的保单号 select (select lo.call_length from ucc_rms_recorderlog lo where lo.call_id=m.call_id) as lenth from cc_record_main m\n" +
+//                "\t--where m.contnos='2019082000110188'\"\t平均通话时长超过10分钟\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label101 = (\n" +
+//                "\tSELECT '长通话' FROM (\n" +
+//                "\tSELECT \n" +
+//                "\t\tt.contnos,\n" +
+//                "\t\trow_number()OVER(PARTITION BY p.customerno) rn,\n" +
+//                "\t\tp.customerno\n" +
+//                "\tFROM (\n" +
+//                "\t\tSELECT (sum(lo.call_length)/count(*)) AS avgcalltime,m.contnos from dsj.cc_record_main m \n" +
+//                "\t\tLEFT JOIN  dsj.ucc_rms_recorderlog lo ON m.call_id = lo.call_id\n" +
+//                "\t\tWHERE m.contnos IS NOT NULL AND lo.call_length IS NOT NULL\n" +
+//                "\t\tGROUP BY m.contnos\n" +
+//                "\t) t  LEFT JOIN dsj.policy_information p ON t.contnos = p.contno\n" +
+//                "\n" +
+//                "\tWHERE t.avgcalltime>600\n" +
+//                "\t\n" +
+//                "\t) temp WHERE temp.customerno IS NOT NULL AND temp.rn = 1 AND si1.scustid = temp.customerno\n" +
+//                ");\n" +
+//                "\n" +
+//                "\t--105\t要求较多\tLabel103\t要求较多\t\"policyno为客户的保单号 flowid like'ZX%'转办标志 Z select (select r.idname from cc_swf_sort r where r.id=f.complaintProject) as --swfName --from cc_swfflowmain f where f.policyno='2020021500000456' and flowid like'ZX%'\"\t每次来电均下转办单的\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label103 = '要求较多' WHERE si1.scustid IN (\n" +
+//                "\t\tSELECT p.customerno FROM dsj.policy_information p WHERE p.contno IN (\n" +
+//                "\t\t\tSELECT temp.policyno FROM (\n" +
+//                "\t\t\t\tSELECT t.policyno,max(t.mnum) mnum,max(t.fnum) fnum FROM (\n" +
+//                "\t\t\t\t\tSELECT m.contnos policyno,count(*) AS mnum,'' AS fnum FROM dsj.cc_record_main m WHERE m.contnos IS NOT NULL GROUP BY m.contnos\n" +
+//                "\t\t\t\t\tUNION \n" +
+//                "\t\t\t\t\tSELECT f.policyno,'' AS mnum,count(*) AS fnum FROM  dsj.cc_swfflowmain f WHERE f.modelno = 1 GROUP BY f.policyno \n" +
+//                "\t\t\t\t)t GROUP BY t.policyno\n" +
+//                "\t\t\t) temp WHERE (temp.fnum/temp.mnum)>0.7\n" +
+//                "\t\t) \n" +
+//                "\t);\n" +
+//                "\t--106\t易投诉升级\tLabel104\t易投诉升级\t\"flowid like'ZX%'转办标志 Z select (select r.idname from cc_swf_sort r where r.id=f.complaintProject and r.idname='投诉') as swfName --from cc_swfflowmain f where f.policyno='2020021500000456' and flowid like'ZX%'\"\t咨询转办单项目为投诉\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label104 = '易投诉升级' WHERE si1.scustid IN (\n" +
+//                "\t\tSELECT p.customerno FROM dsj.policy_information p WHERE p.contno IN (\n" +
+//                "\t\t\tSELECT temp.policyno FROM (\n" +
+//                "\t\t\t\tSELECT t.policyno,max(t.mnum) mnum,max(t.fnum) fnum FROM (\n" +
+//                "\t\t\t\t\tSELECT m.contnos policyno,count(*) AS mnum,'' AS fnum FROM dsj.cc_record_main m WHERE m.contnos IS NOT NULL GROUP BY m.contnos\n" +
+//                "\t\t\t\t\tUNION \n" +
+//                "\t\t\t\t\tSELECT f.policyno,'' AS mnum,count(*) AS fnum FROM  dsj.cc_swfflowmain f,dsj.cc_swf_sort r WHERE r.id=f.complaintProject and f.modelno = 1 AND r.idname='投诉' GROUP BY f.policyno \n" +
+//                "\t\t\t\t)t GROUP BY t.policyno\n" +
+//                "\t\t\t) temp WHERE temp.mnum = temp.fnum\n" +
+//                "\t\t)\n" +
+//                "\t);\n" +
+//                "\t--107\t高频投诉\tLabel105\t高频投诉\t\"select count(1) from cc_action_data_complaints c where c.productno='2018110400035608'\"\t--半年之内来过两次以上投诉的,投诉受理日期间隔<180天,且投诉次数>2\n" +
+//                "\t--UPDATE shanglifeecif.Individual si1 SET si1.Label105 = '高频投诉' WHERE si1.scustid in\n" +
+//                "\t--(SELECT p.customerno FROM dsj.policy_information p WHERE p.contno IN \n" +
+//                "\t--(SELECT temp.productno FROM (\n" +
+//                "\t\t\n" +
+//                "\t\t--SELECT t.productno,t.sinserttime,\n" +
+//                "\t\t--(SELECT tt.inserttime FROM (SELECT cad.inserttime,row_number()OVER(PARTITION BY cad.productno ORDER BY cad.inserttime) rownum,cad.productno FROM dsj.cc_action_complaints --ca,dsj.cc_action_data_complaints cad \n" +
+//                "\t\t\t--WHERE  cad.complaintsid=ca.complaintsid AND cad.productno IS NOT NULL) tt WHERE tt.productno = t.productno AND tt.rownum = t.rn+1) AS esinserttime\n" +
+//                "\t\t\t-- FROM \n" +
+//                "\t\t\t--(\n" +
+//                "\t\t\t--\tselect cd.productno,row_number()OVER(PARTITION BY cd.productno ORDER BY cd.inserttime) rn,cd.inserttime AS sinserttime\n" +
+//                "\t\t\t--\tfrom dsj.cc_action_complaints c,dsj.cc_action_data_complaints cd WHERE  cd.complaintsid=c.complaintsid AND cd.productno IS NOT NULL\n" +
+//                "\t\t\t--) t\n" +
+//                "\t--) temp WHERE temp.esinserttime IS NOT NULL AND DATEDIFF(temp.esinserttime,temp.sinserttime) < 180));\n" +
+//                "    UPDATE shanglifeecif.Individual si1 SET si1.Label105 = '高频投诉' WHERE si1.scustid in (\n" +
+//                "\t\tSELECT t.customerno FROM (\n" +
+//                "\t\t\tSELECT \n" +
+//                "\t\t\t\t\trow_number()OVER(PARTITION BY t1.customerno ORDER BY ca.inserttime) rownum,\n" +
+//                "\t\t\t\t\tt1.customerno,\n" +
+//                "\t\t\t\t\tt1.contno,\n" +
+//                "\t\t\t\t\tca.inserttime FROM (\n" +
+//                "\t\t\t\tSELECT \n" +
+//                "\t\t\t\t\tmax(p.customerno) customerno,\n" +
+//                "\t\t\t\t\tp.contno\n" +
+//                "\t\t\t\tFROM dsj.policy_information p GROUP BY p.contno\n" +
+//                "\t\t\t) t1 LEFT JOIN dsj.cc_action_complaints ca ON t1.contno = ca.productnos\n" +
+//                "\t\t\t\n" +
+//                "\t\t) t LEFT JOIN (\n" +
+//                "\t\t\t\tSELECT \n" +
+//                "\t\t\t\t\trow_number()OVER(PARTITION BY t1.customerno ORDER BY ca.inserttime) rownum,\n" +
+//                "\t\t\t\t\tt1.customerno,\n" +
+//                "\t\t\t\t\tt1.contno,\n" +
+//                "\t\t\t\t\tca.inserttime FROM (\n" +
+//                "\t\t\t\tSELECT \n" +
+//                "\t\t\t\t\tmax(p.customerno) customerno,\n" +
+//                "\t\t\t\t\tp.contno\n" +
+//                "\t\t\t\tFROM dsj.policy_information p GROUP BY p.contno\n" +
+//                "\t\t\t) t1 LEFT JOIN dsj.cc_action_complaints ca ON t1.contno = ca.productnos\n" +
+//                "\t\t) tt ON t.customerno = tt.customerno AND t.rownum = tt.rownum+1\n" +
+//                "\t\tWHERE  DATEDIFF(tt.inserttime,t.inserttime) < 180\n" +
+//                "\t);\n" +
+//                "    \n" +
+//                "    --SELECT c.productno,c.inserttime FROM cc_action_data_complaints c  WHERE c.productno IS NOT NULL GROUP BY c.productno\n" +
+//                "\t--108\t重大投诉影响\tLabel106\t重大投诉影响\t投诉来源\t投诉来源是保监局、保监会、媒体转办的\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label106 = (\n" +
+//                "\n" +
+//                "\tSELECT \n" +
+//                "\t\tCASE \n" +
+//                "\t\t\tWHEN tt.complaintsSource LIKE '%保监会%' THEN '重大投诉' \n" +
+//                "\t\t\tWHEN tt.complaintsSource LIKE '%保监局%' THEN '重大投诉' \n" +
+//                "\t\t\tWHEN tt.complaintsSource LIKE '%媒体转办%' THEN '重大投诉' END FROM (\n" +
+//                "\t\n" +
+//                "\t\tSELECT pi.customerno,max(complaintsSource) AS complaintsSource FROM (\n" +
+//                "\t\n" +
+//                "\t\tselect group_concat((case c.complaintsSource \n" +
+//                "\t\t         when '911' then '来电'\n" +
+//                "\t\t         when '912' then '来访'\n" +
+//                "\t\t         when '913' then '来函'\n" +
+//                "\t\t         when '914' then '保监会转办'\n" +
+//                "\t\t         when '919' then '保监局转办'\n" +
+//                "\t\t         when '915' then '媒体转办'\n" +
+//                "\t\t         when '916' then '同业公会'\n" +
+//                "\t\t         when '917' then '其他转办'\n" +
+//                "\t\t         when '918' then '呼出'\n" +
+//                "\t\t         else c.complaintsSource END),',') as complaintsSource,p.contno from dsj.cc_action_complaints c,dsj.cc_action_data_complaints cd,dsj.policy_information p\n" +
+//                "\t\t         \n" +
+//                "\t\twhere cd.complaintsid=c.complaintsid AND p.contno = cd.productno GROUP BY p.contno\n" +
+//                "\n" +
+//                "\t\t) t LEFT JOIN dsj.policy_information pi ON t.contno = pi.contno GROUP BY pi.customerno\n" +
+//                "\t\n" +
+//                "\t) tt WHERE tt.customerno = si1.scustid\n" +
+//                "\n" +
+//                ");\n" +
+//                "\t\n" +
+//                "\t--109\t高金额\tLabel107\t高金额\t\t关于高金额的指标,鉴于大数据无法计算件均保费,调整逻辑如下:\n" +
+//                "\t\t--根据业绩归属渠道、缴费方式、以及期缴保费划分如下\n" +
+//                "\t\t--02个险渠道            期缴 大于20000以上 \n" +
+//                "\t\t--03银保渠道            期缴 大于50000以上\n" +
+//                "\t\t--06健康险               期缴 大于 20000以上 \n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label107 = '高金额' \n" +
+//                "\t\tWHERE si1.scustid IN (SELECT p.customerno FROM dsj.policy_information p WHERE \n" +
+//                "\t\tp.appflag = '有效' AND p.payintv = '期缴' and\n" +
+//                "\t\t((p.salecom = '03' AND p.prem>50000) OR (p.salecom = '02' AND p.prem>20000) OR (p.salecom = '06' AND p.prem>20000)));\n" +
+//                "\t\t\n" +
+//                "\t--最近理赔结案\tlabel108\t最近15天做过理赔,当前日期-理赔结案日期<15天\t最近理赔结案\t\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label108 = '最近理赔结案' WHERE si1.scustid IN (\n" +
+//                "\t\tSELECT c.insuredno FROM dsj.INSURANCE_CLAIM c WHERE DATEDIFF(to_char(SYSDATE,'yyyy-MM-dd HH:mm:ss.S'),c.endcasedate) < 15\n" +
+//                "\t);\t\n" +
+//                "\t--111\t理赔报案追踪\tLabel109\t理赔报案追踪\t\t理赔状态为报案状态,且理赔报案日-当前日期<30天\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label109 = '理赔报案追踪' WHERE si1.scustid IN (SELECT p.customerno FROM dsj.policy_information p WHERE p.appflag = '有效' and p.contno IN (SELECT c.CONTNO FROM dsj.insurance_claim c WHERE c.LLCLAIMSTATE = '报案' AND DATEDIFF(sysdate(), c.RPTDATE) <30) );\n" +
+//                "\t--112\t理赔处理中\tLabel110\t理赔处理中\t\t理赔状态为受理或立案\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label110 = '理赔处理中' WHERE si1.scustid IN (\n" +
+//                "\t\tSELECT p.customerno FROM dsj.policy_information p WHERE p.appflag = '有效' and p.contno IN (SELECT c.contno FROM dsj.INSURANCE_CLAIM c WHERE c.llclaimstate = '受理' OR c.llclaimstate = '立案')\n" +
+//                "\t);\n" +
+//                "\t\n" +
+//                "\t--最近保全完成\tlabel111\t最近15天做过保全,来电日期-保全申请日期<15天\t最近保全完成\t\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label111 = '最近保全完成' WHERE si1.scustid IN (\n" +
+//                "\t\tSELECT p.customerno FROM dsj.policy_information p WHERE p.contno IN (\n" +
+//                "\t\t\tSELECT l.contno FROM dsj.lpedoritem l WHERE DATEDIFF(to_char(SYSDATE,'yyyy-MM-dd HH:mm:ss.S'),l.edorappdate) < 15 AND l.edorstate = '0'\n" +
+//                "\t\t)\n" +
+//                "\t);\n" +
+//                "\t--115\t生存金未领\tLabel113\t生存金未领\t判断逻辑不详\t生存金领取方式为自动转账、存在生存金且未领取\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label113 = '生存金未领' WHERE si1.scustid IN (\n" +
+//                "\tSELECT p.customerno FROM dsj.policy_information p WHERE p.appflag = '有效' and p.contno IN (\n" +
+//                "\t\tSELECT contno FROM dsj.Lcinsureacc WHERE acctype = '005' and   insuaccbala>0\n" +
+//                "\t) \n" +
+//                ");\n" +
+//                "\t--117\t红利垫缴还款\tLabel115\t红利垫缴还款\t判断逻辑不详\t存在红利,且红利已经垫交保单还款\n" +
+//                "\t\tUPDATE shanglifeecif.Individual si1 SET si1.label115 = '红利垫缴还款' WHERE si1.scustid IN (\n" +
+//                "\t\tSELECT p.customerno FROM dsj.policy_information p WHERE p.appflag = '有效' and p.contno IN (\n" +
+//                "\t\t\tSELECT a.contno FROM dsj.LOLOANDETAIL a,dsj.LDCode1 b WHERE \n" +
+//                "\t\t\tb.codetype='lnmoneytype' AND b.code=a.finfeetype and b.code1=a.moneytype\n" +
+//                "\t\t\tAND ((a.finfeetype = 'HL' AND a.moneytype = 'SX') OR (a.finfeetype = 'SC' AND a.moneytype = 'HK'))\n" +
+//                "\t\t) \n" +
+//                "\t);\n" +
+//                "\t--\t宽限期\tlabel117\t宽限日末日-当前日期<3天\t宽限期\t\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.label117 = '宽限期' WHERE si1.scustid IN (\n" +
+//                "\n" +
+//                "\tSELECT p.customerno FROM dsj.policy_information p WHERE p.payintv= '期缴' AND p.appflag='有效' AND p.payendyear!=p.paycount and \n" +
+//                "\tDATEDIFF(DATE_ADD(p.paytodate, 60),to_char(SYSDATE,'yyyy-MM-dd HH:mm:ss.S')) > 0 AND DATEDIFF(DATE_ADD(p.paytodate, 60),to_char(SYSDATE,'yyyy-MM-dd HH:mm:ss.S')) < 3\n" +
+//                ");\n" +
+//                "\t\n" +
+//                "\t--122\t重点银行\tLabel120\t重点银行\t判断逻辑不详\t保单的销售渠道网点为招商银行\n" +
+//                "\tUPDATE shanglifeecif.Individual si1 SET si1.Label120 = '重点银行' WHERE \n" +
+//                "\tsi1.scustid IN (SELECT p.customerno  FROM dsj.policy_information p WHERE p.AGENTCOM LIKE '%招商银行%');\n" +
+//                "\t\n" +
+//                "\tdbms_output.put_line('updateindividuallable函数跑批完成!');\n" +
+//                "\tEXCEPTION\n" +
+//                "\t\t\tWHEN HIVE_EXCEPTION THEN \n" +
+//                "\t\t\t\t INSERT INTO shanglifeecif.exception_log(log_id,log_code,log_msg,log_time) VALUES (to_char(sysdate(),'yyyyMMddHHmmss'),sqlcode(),sqlerrm(),sysdate());\n" +
+//                "\t\t\tWHEN Others THEN\n" +
+//                "\t\t\t\tINSERT INTO shanglifeecif.exception_log(log_id,log_code,log_msg,log_time) VALUES (to_char(sysdate(),'yyyyMMddHHmmss'),sqlcode(),sqlerrm(),sysdate());\t\n" +
+//                "\n" +
+//                "END";
+//
+//
+//    }
+
+
+}

+ 16 - 0
dgtis-modules/dgtis-modules-data/src/main/resources/rebel.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
+  Refer to https://manuals.jrebel.com/jrebel/standalone/config.html for more information.
+-->
+<application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_3.xsd">
+
+	<id>dgtis-modules-data</id>
+
+	<classpath>
+		<dir name="D:/ideaworkspaces/shanghairenshou/dgtis-modules/dgtis-modules-data/target/classes">
+		</dir>
+	</classpath>
+
+</application>

+ 7 - 0
dgtis-modules/dgtis-modules-system/src/main/java/com/dgtis/system/controller/SysUserController.java

@@ -133,10 +133,17 @@ public class SysUserController extends BaseController
         Set<String> roles = permissionService.getRolePermission(userId);
         // 权限集合
         Set<String> permissions = permissionService.getMenuPermission(userId);
+        SysUser sysUser = userService.selectUserById(userId);
+        String deptCode = "";
+        // “上海人寿”部门编号开发环境是null,生产环境是0。不是上海人寿部门的才分渠道
+        if(StringUtils.isNotEmpty( sysUser.getDept().getDeptCode()) && ! "0".equals(sysUser.getDept().getDeptCode())){
+            deptCode = sysUser.getDept().getDeptCode();
+        }
         AjaxResult ajax = AjaxResult.success();
         ajax.put("user", userService.selectUserById(userId));
         ajax.put("roles", roles);
         ajax.put("permissions", permissions);
+        ajax.put("deptCode", deptCode);
         return ajax;
     }
 

+ 1 - 1
dgtis-ui/package.json

@@ -41,7 +41,7 @@
   },
   "dependencies": {
     "@riophae/vue-treeselect": "0.4.0",
-    "axios": "0.18.1",
+    "axios": "^0.25.0",
     "clipboard": "2.0.4",
     "core-js": "3.6.5",
     "echarts": "4.2.1",

二進制
dgtis-ui/src/assets/image/profile.jpg


二進制
dgtis-ui/src/assets/image/profile2.jpg


+ 86 - 23
dgtis-ui/src/views/index.vue

@@ -255,6 +255,7 @@
   import BarChart3 from './dashboard/BarChart3'
   import PieChart from './dashboard/PieChart2'
   import { ageSexDis, riskcode, bdNumDis, tenYearsCustomers} from "@/api/index";
+  import { getInfo} from "@/api/login";
   export default {
     name: "Index",
     components: {
@@ -289,7 +290,7 @@
         // 近10年有效客户数
         barChartVistorsData:{
           yAxisName:'数量:个',
-          color:['#F29EC2','#7FE59A','#FAD889','#048EF3','#00C7FF'],
+          color:['#F29EC2','#7FE59A','#FAD889','#048ef3','#00C7FF'],
           xAxisData:[],
           seriesData:[]
         },
@@ -356,27 +357,7 @@
           }
         ],
         // 业绩归属选项
-        policybelongArr:[
-          {
-            value: '00',
-            label: '总部团险个单业务'
-          },{
-            value: '01',
-            label: '上分团险个单业务'
-          },{
-            value: '02',
-            label: '个险渠道'
-          },{
-            value: '03',
-            label: '银保渠道'
-          },{
-            value: '05',
-            label: '网销渠道'
-          },{
-            value: '06',
-            label: '健康险事业部'
-          }
-        ],
+        policybelongArr:[],
         conditionData:{
           education:'',
         },
@@ -395,10 +376,10 @@
           }
         },
         isFull:false,
+        deptCode:'',
       }
     },
     created() {
-
     },
     mounted() {
       var screenWidth = document.body.clientWidth;
@@ -408,8 +389,80 @@
       this.getAgeSexDis();
       this.getBdNumDis();
       this.getTenYearsCustomers();
+      this.getUserInfo();
     },
     methods: {
+      getPolicybelongArr( deptCode){
+        console.log("-------------");
+        console.log(deptCode);
+        console.log("-------------");
+
+      if(deptCode=='01'){
+          this.policybelongArr =   [
+            {
+              value: '01',
+              label: '上分团险个单业务'
+            }
+            ]
+        }else if(deptCode=='02'){
+          this.policybelongArr =    [
+            {
+              value: '02',
+              label: '个险渠道'
+            }
+          ]
+        }else if(deptCode=='03'){
+          this.policybelongArr =   [
+            {
+              value: '03',
+              label: '银保渠道'
+            }
+          ]
+        }else if(deptCode=='05'){
+          this.policybelongArr =    [
+            {
+              value: '05',
+              label: '网销渠道'
+            }
+          ]
+        }else if(deptCode=='06'){
+          this.policybelongArr =    [
+            {
+              value: '06',
+              label: '健康险事业部'
+            }
+          ]
+        }else if(deptCode=='07'){
+          this.policybelongArr =     [
+            {
+              value: '07',
+              label: '经代渠道'
+            }
+          ]
+        }else{
+          this.policybelongArr =   [
+            {
+              value: '00',
+              label: '总部团险个单业务'
+            },{
+              value: '01',
+              label: '上分团险个单业务'
+            },{
+              value: '02',
+              label: '个险渠道'
+            },{
+              value: '03',
+              label: '银保渠道'
+            },{
+              value: '05',
+              label: '网销渠道'
+            },{
+              value: '06',
+              label: '健康险事业部'
+            }
+          ]
+        }
+      },
       _$ (el) {
         try {
           var item = document.querySelectorAll(el);
@@ -515,6 +568,16 @@
                 }
             );
         },
+      getUserInfo(){
+        let that = this;
+        getInfo().then(response => {
+          console.log("response.deptCode"+response.deptCode);
+          that.deptCode =response.deptCode;
+            this.getPolicybelongArr(response.deptCode)
+
+          }
+        );
+      },
     }
   };
 </script>

+ 0 - 47
sql-achievement/存储过程/20220829升级/update.sql

@@ -904,54 +904,6 @@ FROM shanglifeecif.IndRelationShip sis ;
 
 
 
-dbms_output.put_line('init_indrelationship_main函数跑批完成!');
-EXCEPTION
-			WHEN HIVE_EXCEPTION THEN
-INSERT INTO shanglifeecif.exception_log(log_id,log_code,log_msg,log_time) VALUES (to_char(sysdate(),'yyyyMMddHHmmss'),sqlcode(),sqlerrm(),sysdate());
-WHEN Others THEN
-INSERT INTO shanglifeecif.exception_log(log_id,log_code,log_msg,log_time) VALUES (to_char(sysdate(),'yyyyMMddHHmmss'),sqlcode(),sqlerrm(),sysdate());
-
-END;
-
-CREATE OR REPLACE PROCEDURE shanglifeecif.init_indrelationship_main2( )
-              IS
-              DECLARE
-              s_count int
-BEGIN
-
-
-/**	*/
-
-insert into shanglifeecif.IndRelationShip(
-    irsid,
-    RSType,
-    IndID1,
-    Name1,
-    IDCard1,
-    Role1,
-    IndID2,
-    Name2,
-    IDCard2,
-    Role2
-)SELECT reflect("java.util.UUID", "randomUUID"),
-        CASE RSType
-            WHEN '父母' THEN '子女'
-            WHEN '子女' THEN '父母'
-            WHEN '祖孙、外祖孙' THEN '祖父母、外祖父母'
-            WHEN '祖父母、外祖父母' THEN '祖孙、外祖孙'
-            WHEN '配偶' THEN '配偶'
-            ELSE RSType
-            END,
-        IndID2,
-        Name2,
-        IDCard2,
-        Role2,
-        IndID1,
-        Name1,
-        IDCard1,
-        Role1
-FROM shanglifeecif.IndRelationShip sis ;
 dbms_output.put_line('init_indrelationship_main函数跑批完成!');
 EXCEPTION
 			WHEN HIVE_EXCEPTION THEN

文件差異過大導致無法顯示
+ 4389 - 0
sql-achievement/存储过程/生产环境/存储过程——new.sql