CREATE OR REPLACE PROCEDURE SP_ZS_BABLTJ_BLXXSYNC ( PZYID00 in number, PYGBH00 in number ) as -- MODIFICATION HISTORY -- Person Date Comments -- wuzy 2017.05.10 签收的时候同步 多条病理诊断录入数据(BA_BASBLB) for ZYDZBL-20170428-002 -- wuzy 2018.06.04 过程加上日志 SP_TransLog for ZYDZBL-20180531-002 COUNTER number(3); begin SP_TRANSLOG(sysdate,'SP_ZS_BABLTJ_BLXXSYNC',PYGBH00,0, 'SP_ZS_BABLTJ_BLXXSYNC('||to_char(PZYID00)||','||to_char(PYGBH00)); --同步病案室诊断修改界面-病理诊断数据 select count(*) into COUNTER from BA_BASBLB where LSH000=PZYID00 and ZT0000='0' and ZDLX00='0' and CZRLX0='1'; if COUNTER>0 then return; end if; insert into BA_BASBLB (ID0000,LSH000,ZYH000, BLZDBM,BLZD00, ZLBM00,ZLMC00,BLH000,ZDLX00,CZRLX0,SFZZD0,CJRQ00,CJSJ00) select SQ_BA_BASBLB_ID0000.NEXTVAL,LSH000,ZYH000, BLZDBM,BLZD00, ZLBM00,ZLMC00,BLH000, '0', '1',SFZZD0,to_char(sysdate,'YYYYMMDD'),to_char(sysdate,'HH24:MI:SS') from BA_BASBLB where LSH000=PZYID00 and ZT0000='0' and ZDLX00='0'and CZRLX0='0'; --同步医生原始诊断界面-病理诊断数据 select count(*) into COUNTER from BA_BASBLB where LSH000=PZYID00 and ZT0000='0' and ZDLX00='0' and CZRLX0='2'; if COUNTER>0 then return;-- delete from BA_BASBLB where LSH000=PZYID00 and ZT0000='0' and ZDLX00='0' and CZRLX0='2'; end if; insert into BA_BASBLB (ID0000,LSH000,ZYH000, BLZDBM,BLZD00, ZLBM00,ZLMC00,BLH000,ZDLX00,CZRLX0,SFZZD0,CJRQ00,CJSJ00) select SQ_BA_BASBLB_ID0000.NEXTVAL,LSH000,ZYH000, BLZDBM,BLZD00, ZLBM00,ZLMC00,BLH000, '0', '2',SFZZD0,to_char(sysdate,'YYYYMMDD'),to_char(sysdate,'HH24:MI:SS') from BA_BASBLB where LSH000=PZYID00 and ZT0000='0' and ZDLX00='0'and CZRLX0='0'; commit; end;