外审查数据处理

--XSZD00982太原市迎泽区爱萍诊所处理 恢复


 update spls_ck set dwbh='DWI00003358' where dwbh='CWI00003358' and djbh not in ('XSAYMA00035515','XSDYMA00008608','XSAYMA00099536','XSDYMA00023350')

   update cwk set dwbh='DWI00003358' where dwbh='CWI00003358' and djbh not in ('XSAYMA00035515','XSDYMA00008608','XSAYMA00099536','XSDYMA00023350')

   update pf_ckhz set dwbh='DWI00003358' where dwbh='CWI00003358' and djbh not in ('XSAYMA00035515','XSDYMA00008608','XSAYMA00099536','XSDYMA00023350')


--XSZD00982太原市迎泽区爱萍诊所处理 隐藏


 update spls_ck set dwbh='CWI00003358' where dwbh='DWI00003358' and djbh not in ('XSAYMA00035515','XSDYMA00008608','XSAYMA00099536','XSDYMA00023350')

   update cwk set dwbh='CWI00003358' where dwbh='DWI00003358' and djbh not in ('XSAYMA00035515','XSDYMA00008608','XSAYMA00099536','XSDYMA00023350')

   update pf_ckhz set dwbh='CWI00003358' where dwbh='DWI00003358' and djbh not in ('XSAYMA00035515','XSDYMA00008608','XSAYMA00099536','XSDYMA00023350')



--对保险品种明细数据恢复


select * into fr_jh_rkmx20170304 From jh_rkmx where spid like 'APH%'


update spls_rk set spid=replace(spid,'APH','SPH') where left(spid,3)<>'SPH'

update jh_rkmx set spid=replace(spid,'APH','SPH') where left(spid,3)<>'SPH'


--对保险品种明细数据隐藏

update b set b.spid=a.spid from spls_rk b,fr_spls_rk20170123 a where a.plh=b.plh

update b set b.spid=a.spid from jh_rkmx b,fr_jh_rkmx20170304 a where a.djbh=b.djbh and a.dj_sn=b.dj_sn


--对保险单据汇总项数据恢复

insert into cwk

select * from fr_cwk20170210 where djbh not in('JHCYMA00003021')

insert into jh_rkhz

select * from fr_jh_rkhz20170210 where djbh not in('JHCYMA00003021')


update cwk set je=-2418.81,she=-411.19,hsje=-2830.00,chbje=-2418.81 where djbh='JHCYMA00003021'

update jh_rkhz set je=-2418.81,she=-411.19,hsje=-2830.00,chbje=-2418.81 where djbh='JHCYMA00003021'


--对保险单据汇总项数据隐藏

update cwk set je=-1208.55,she=-205.45,hsje=-1414,chbje=-1208.55 where djbh='JHCYMA00003021'

update jh_rkhz set je=-1208.55,she=-205.45,hsje=-1414,chbje=-1208.55 where djbh='JHCYMA00003021'

delete jh_rkhz where djbh in (select djbh from fr_spls_rk20170123) and djbh not in('JHCYMA00003021')

delete cwk where djbh in (select djbh from fr_spls_rk20170123) and djbh not in('JHCYMA00003021')


--对爱萍诊所wlzhk数据恢复

update wlzhk set dwbh=replace(dwbh,'CWI','DWI') where left(dwbh,3)<>'DWI'

--对保险单据wlzhk数据恢复

update wlzhk set dwbh=replace(dwbh,'EWI','DWI') where left(dwbh,3)<>'DWI'


wlzhk统一隐藏

update b set b.dwbh=a.dwbh from wlzhk b,fr_wlzhk20170123 a where a.plh=b.plh