CREATE OR REPLACE PROCEDURE shanglifeecif.insuranceclaimthread_main() -- �������洢����
IS    
BEGIN
	insert into shanglifeecif.insuranceclaimthread (
		icthreadid ,--'��������Id',1
		crno ,--'������',2
		--companyno ,-- '��˾����',
		policyno ,--'���յ��� INSURANCE_CLAIM.CONTNO',3
		--applicantid ,--'Ͷ����ID',
		--appname ,--'Ͷ��������',
		--appphone ,--'Ͷ�����ֻ�',
		--appcertid ,--'Ͷ����֤������ INSURANCE_CLAIM.RISKDATE',
		cnno ,--'������',4
		losstime ,-- '��ʧ����ʱ��',5
		--rpid ,-- '������',
		rpname ,--'����������',6
		--rpphone ,-- '�����˵绰',
		--lpid ,--'������	����INSURANCE_CLAIM.INSUREDNO��ȡindid',
		lpscutid,--'���������οͻ���7
		lpname ,-- '����������',
		cndate ,--'�������� INSURANCE_CLAIM.RPTDATE',
		lossdescribe ,-- '��ʧԭ�� ����������ԭ��:INSURANCE_CLAIM.LLOCCURREASON',
		crdate ,-- '�������� INSURANCE_CLAIM.RGTDATE',
		cndescribe ,--'�������� INSURANCE_CLAIM.ACCIDENTDETAIL',
		claimstatus ,--'����״̬ ������״̬�����磺¼�롢��������',
		csdate ,--'����״̬����',
		relationship ,-- '������������˹�ϵ',
		ccno ,-- '�ⰸ�� AUDIT_CLAIM_INSURANCE.CLMNO',
		ccstatus ,--'�ⰸ״̬',
		--ccsdate ,-- '�ⰸ״̬����',
		productid ,--'���ִ���	INSURANCE_CLAIM_HEALTH.RISKCODE',
		productname, --'��������	INSURANCE_CLAIM_HEALTH.RISKNAME',
		ccamt ,--'�⸶���	INSURANCE_CLAIM_HEALTH.realpay',
		--branchcode,-- '��������',
		claimcasestatus ,--'����״̬INSURANCE_CLAIM_HEALTH.LLCLAIMSTATE',
		accidenttype,
		created_by ,
		created_time 
		-- updated_time,
		-- updated_by
	) select 
   		row_number()over(),--1
   		trim(rgtno) as rgtno,--2
		trim(contno) as contno,--3
		trim(rptno) as rptno,--������4
		trim(riskdate) as riskdate,--��ʧ������ʱ��5
		trim(rptorname) as rptorname,--����������6
   		trim(INSUREDNO) as INSUREDNO,--������ ���οͻ���
   		trim(INSUREDNAME) as INSUREDNAME,
		trim(rptdate) as rptdate,
		trim(lloccurreason) as lloccurreason,
		trim(rgtdate) as rgtdate,
		trim(accidentdetail) as accidentdetail,--��������
		trim(llclaimstate) as llclaimstate,
		trim(auditdate) as auditdate,--��������
		trim(relation) as relation,
		trim(clmno) as clmno,--�ⰸ��
		trim(llgettype) as llgettype,--�ⰸ״̬
		trim(riskcode) as riskcode,
		trim(riskname) as riskname,
		realpay,
		trim(llclaimstate) as llclaimstate,--����״̬
		trim(accidenttype) as accidenttype,
		'admin',
		sysdate()
	from shanghailifeecif.INSURANCE_CLAIM where contno is not null 

END;