|
@@ -4064,28 +4064,16 @@ UPDATE shanglifeecif.Individual si1 SET si1.label77 = '本人生日临近' WHERE
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
--- UPDATE shanglifeecif.Individual si1 SET si1.label78 = '父亲生日临近' WHERE si1.scustid IN (
|
|
|
|
|
--- SELECT sis.indid1 FROM shanglifeecif.indrelationship sis LEFT JOIN shanglifeecif.individual si ON sis.indid2 = si.scustid
|
|
|
|
|
--- WHERE sis.rstype = '父母' AND DATEDIFF(to_char(si.birthday,"2022-MM-dd"),to_char(SYSDATE,"2022-MM-dd"))<=5 AND
|
|
|
|
|
--- DATEDIFF(to_char(si.birthday,"2022-MM-dd"),to_char(SYSDATE,"2022-MM-dd"))>0 AND sis.role2 = '父亲'
|
|
|
|
|
--- );
|
|
|
|
|
-
|
|
|
|
|
---UPDATE shanglifeecif.Individual si1 SET si1.label78 = '母亲生日临近' WHERE si1.scustid IN (
|
|
|
|
|
--- SELECT sis.indid1 FROM shanglifeecif.indrelationship sis LEFT JOIN shanglifeecif.individual si ON sis.indid2 = si.scustid
|
|
|
|
|
- -- WHERE sis.rstype = '父母' AND DATEDIFF(to_char(si.birthday,"2022-MM-dd"),to_char(SYSDATE,"2022-MM-dd"))<=5 AND
|
|
|
|
|
--- DATEDIFF(to_char(si.birthday,"2022-MM-dd"),to_char(SYSDATE,"2022-MM-dd"))>0 AND sis.role2 = '母亲'
|
|
|
|
|
--- );
|
|
|
|
|
|
|
+ UPDATE shanglifeecif.Individual si1 SET si1.label78 = '父亲生日临近' WHERE si1.scustid IN (
|
|
|
|
|
+ SELECT sis.indid1 FROM shanglifeecif.indrelationship sis LEFT JOIN shanglifeecif.individual si ON sis.indid2 = si.scustid
|
|
|
|
|
+ WHERE sis.rstype = '父母' AND DATEDIFF(to_char(si.birthday,"2022-MM-dd"),to_char(SYSDATE,"2022-MM-dd"))<=5 AND
|
|
|
|
|
+ DATEDIFF(to_char(si.birthday,"2022-MM-dd"),to_char(SYSDATE,"2022-MM-dd"))>0 AND sis.role2 = '父亲'
|
|
|
|
|
+ );
|
|
|
|
|
|
|
|
- UPDATE shanglifeecif.Individual si1 SET si1.label78 = (
|
|
|
|
|
- SELECT
|
|
|
|
|
- case max(p.insuredsex)
|
|
|
|
|
- when '0' then '父亲生日临近'
|
|
|
|
|
- when '1' then '母亲生日临近'
|
|
|
|
|
- end as s
|
|
|
|
|
- from dsj.POLICY_INFORMATION p
|
|
|
|
|
- where p.customerno = si1.scustid and p.salecom = si1.salecom
|
|
|
|
|
- and (p.RELATIONTOAPPNT = '父母' OR p.RELATIONTOAPPNT = '子女') and p.birthday > p.insuredbirthday -- 父母关系,并且投保人 > 被保人(也就是晚辈给长辈买保险,被保人是长辈)
|
|
|
|
|
- and (DATEDIFF(to_char(p.insuredbirthday,"2022-MM-dd"),to_char(SYSDATE,"2022-MM-dd")) between 1 and 5)
|
|
|
|
|
|
|
+UPDATE shanglifeecif.Individual si1 SET si1.label78 = '母亲生日临近' WHERE si1.scustid IN (
|
|
|
|
|
+ SELECT sis.indid1 FROM shanglifeecif.indrelationship sis LEFT JOIN shanglifeecif.individual si ON sis.indid2 = si.scustid
|
|
|
|
|
+ WHERE sis.rstype = '父母' AND DATEDIFF(to_char(si.birthday,"2022-MM-dd"),to_char(SYSDATE,"2022-MM-dd"))<=5 AND
|
|
|
|
|
+ DATEDIFF(to_char(si.birthday,"2022-MM-dd"),to_char(SYSDATE,"2022-MM-dd"))>0 AND sis.role2 = '母亲'
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
UPDATE shanglifeecif.Individual si1 SET si1.label79 = '儿子生日临近' WHERE si1.scustid IN (
|
|
UPDATE shanglifeecif.Individual si1 SET si1.label79 = '儿子生日临近' WHERE si1.scustid IN (
|