需提供结案日期
从保单主表(POLICY_INFORMATION)中获取投保人的上游客户号和五要素,得到$投保人列表$
code
SELECT CUSTOMERNO,NAME,sex,BIRTHDAY,IDTYPE,IDNO,min(CVALIDATE) FROM POLICY_INFORMATION GROUP BY CUSTOMERNO,NAME,sex,BIRTHDAY,IDTYPE,IDNO;
$被保人列表$
code
SELECT INSUREDNO,INSUREDNAME,INSUREDSEX,INSUREDBIRTHDAY,INSUREDIDTYPE,INSUREDIDNO,min(CVALIDATE) FROM POLICY_INFORMATION GROUP BY INSUREDNO,INSUREDNAME,INSUREDSEX,INSUREDBIRTHDAY,INSUREDIDTYPE,INSUREDIDNO;
$受益人列表$
,实际数据上游客户全为null,同时五要素不齐,故暂时不考虑code
SELECT BENEFICIARY_CUSTOMERNO,BENEFICIARY_NAME,BENEFICIARY_IDTYPE,BENEFICIARY_IDNO FROM HEALTH_INSURANCE_LISTING GROUP BY BENEFICIARY_CUSTOMERNO,BENEFICIARY_NAME,BENEFICIARY_IDTYPE,BENEFICIARY_IDNO;
$投保人列表$
,$被保人列表$
合并去重,得到$投被保人列表$
,并按保单生效日期(CVALIDATE)从早到晚排序(客户号生成规则之一)$投被保人列表$
code
select CLASS_VALUE,CONTRIBUTION_VALUE,AWARDED3,AWARDED2,AWARDED1,TOTAL_VALUE from T_CUSTOMER_CLASS where CUSTOMER_ID = 上游客户号
code
select APPNTHOMEADDRESS,APPNTOCCUPATIONCODE,APPNTOCCUPATIONNAME from HEALTH_INSURANCE_LISTING where APPNTNO = 上游客户号 order by POLAPPLYDATE desc
code
INSERT INTO InsuranceArrangement(PolicyNo,PANo)
SELECT contno,prtno
FROM INSURANCEINFO
POLICY_INFORMATION_tmp
code
insert into POLICY_INFORMATION_tmp(contno,CVALIDATE,ENDDATE)
SELECT contno,max(CVALIDATE),max(ENDDATE)
ROM POLICY_INFORMATION
GROUP BY contno
POLICY_INFORMATION_tmp
中投保人(ApplicantID),主被保险人(InsuredID)为individual表的个体ID(IndID),可根据POLICY_INFORMATION.CUSTOMERNO关联individual上游客户号(SCustID),得到IndID,支持update,临时表设置为ORC事务表
code
UPDATE POLICY_INFORMATION_tmp
SET ApplicantID =
(SELECT ApplicantID
FROM individual
WHERE (POLICY_INFORMATION_tmp.CUSTOMERNO = individual.SCustID))
WHERE 1=1;
code2
UPDATE InsuranceArrangement
SET (PINDate,PMDate) =
(SELECT CVALIDATE,ENDDATE
FROM POLICY_INFORMATION_tmp
WHERE (POLICY_INFORMATION_tmp.contno = InsuranceArrangement.PolicyNo))
WHERE 1=1;
INSURANCE_CLAIM_tmp
code
insert into INSURANCE_CLAIM_tmp(ontno,clmno,RISKDATE,INSUREDNO,RPTDATE,LLOCCURREASON,RGTDATE,ACCIDENTDETAIL,LLCLAIMSTATE)
SELECT contno,clmno,max(RISKDATE),max(INSUREDNO),max(RPTDATE),max(LLOCCURREASON),max(RGTDATE),max(ACCIDENTDETAIL),max(LLCLAIMSTATE)
FROM INSURANCE_CLAIM GROUP BY contno,clmno
INSURANCE_CLAIM_tmp
中出险人为individual表的个体ID(IndID)将INSURANCE_CLAIM_tmp
相应字段直接插入到InsuranceClaimThread表中,字段映射详见模型文档。
目前主要有以下事件,一个事件一条记录,包括开始时间和结束时间
投保:参与方为投保人,Scenario='0001',SDate=InsuranceArrangement.PADate,EndDate=InsuranceArrangement.PISDate
保全:todo 等待上游提供数据字典
报案:参与方为报案人,Scenario='0003',SDate=InsuranceClaimThread.CNDate,EndDate= todo 等待上游提供结案日期字段
投诉:
咨询: