|
@@ -3196,7 +3196,7 @@ BEGIN
|
|
|
UPDATE shanglifeecif.customerno_salecom_relation si1 SET si1.label92 = (
|
|
|
SELECT '有'||t.terminatestate||'保单' FROM (
|
|
|
SELECT row_number()over(partition by p.customerno, p.salecom order by p.polapplydate desc) rn,p.customerno, p.salecom,p.terminatestate FROM dsj.policy_information p
|
|
|
- WHERE p.appflag = '失效'
|
|
|
+ WHERE p.appflag <> '有效'
|
|
|
) t WHERE t.rn = 1 AND si1.scustid = t.customerno and si1.salecom = t.salecom
|
|
|
);
|
|
|
|
|
@@ -4127,7 +4127,7 @@ UPDATE shanglifeecif.Individual si1 SET si1.label79 = '女儿生日临近' WHERE
|
|
|
UPDATE shanglifeecif.Individual si1 SET si1.label92 = (
|
|
|
SELECT '有'||t.terminatestate||'保单' FROM (
|
|
|
SELECT row_number()over(partition by p.customerno order by p.polapplydate desc) rn,p.customerno,p.terminatestate FROM dsj.policy_information p
|
|
|
- WHERE p.appflag = '失效'
|
|
|
+ WHERE p.appflag <> '有效'
|
|
|
) t WHERE t.rn = 1 AND si1.scustid = t.customerno
|
|
|
);
|
|
|
|