SP_ZY_KSSRHZ_RBB001 select decode(A.BMBH00,999999999,'',a.bmbh00) bmbh00,decode(A.BMBH00,999999999,'总 计',0,' ',NVL(B.YSZMC0,'无对应医生组')) BMMC00,A.XMHJ00,A.SFXM01, A.SFXM02,A.SFXM03,A.SFXM04,A.SFXM05,A.SFXM06,A.SFXM07,A.SFXM08,A.SFXM09,A.SFXM10,A.SFXM11,A.SFXM12, A.SFXM13,A.SFXM14,A.SFXM15,A.SFXM16,A.SFXM17,A.SFXM18,A.SFXM19,A.SFXM20, A.SFXM21,A.SFXM22,A.SFXM23,A.SFXM24,A.SFXM25,A.SFXM26,A.SFXM27,A.SFXM28,A.SFXM29,A.SFXM30,A.SFXM31, A.SFXM32,A.SFXM33,A.SFXM34,A.SFXM35,A.SFXM36,A.SFXM37,A.SFXM38,A.SFXM39,A.SFXM40,A.SFXM41,A.SFXM42, A.SFXM43,A.SFXM44,A.SFXM45,A.SFXM46,A.SFXM47,A.SFXM48,A.SFXM49,A.SFXM50,A.SFXM51,A.SFXM52,A.SFXM53, A.SFXM54,A.SFXM55,A.SFXM56,A.SFXM57,A.SFXM58,A.SFXM59,A.SFXM60,A.SFXM61,A.SFXM62,A.SFXM63,A.SFXM64, A.SFXM65,A.SFXM66,A.SFXM67,A.SFXM68,A.SFXM69,A.SFXM70,A.SFXM71,A.SFXM72,A.SFXM73,A.SFXM74,A.SFXM75, A.SFXM87,A.SFXM88,A.SFXM89,A.SFXM90,A.SFXM91,A.SFXM92,A.SFXM93,A.SFXM94,A.SFXM95,A.SFXM96,A.SFXM97,A.SFXM98 from BM_YYSFTJ A,ZS_YSZ000 B where A.BMBH00 = B.YSZID0(+) and A.ID0000 ='1188574.000000' order by B.XSXH00,B.YSZMC0,A.BMBH00 select sum(hjje00),yszmc0 from (select F.BH0000,decode('2','0',KDKS00,'1',ZXKS00,'2',nvl(A.YSZID0,0)) KSBH00, decode('0','0',sum(A.HJJE00),'1',sum(A.HJJE00-a.jzje00-a.gfje00),'2',sum(a.jzje00),sum(a.gfje00)) hjje00 from ZY_FYMX00 A,BM_FPXM00 F,BM_BRXXB0 D,IC_YBBRLB G,BM_BMBM00 H where A.KDKS00 = H.BMBH00 and A.ZYFPID = F.FPXMID and D.BRID00 = A.BRID00 and D.FBBH00 = G.FBBH00 and D.YBLB00 = G.YBLB00 and A.CZRQ00 >= '20200101' and A.CZRQ00 <= '20200131' and A.CZRQ00||A.CZSJ00 >= '20200101'||'00:00:00' and A.CZRQ00||A.CZSJ00 <= '20200131'||'23:59:59' and (('2'='0' and KDKS00='-1') or ('2'='1' and ZXKS00='-1') or '-1' = '-1') and (A.YSZID0='-1' or '-1'=-1) and (G.YBMC00='所有病人' or '所有病人' = '所有病人') and (H.YYID00 = '224466' or '224466' = '0') group by F.BH0000,decode('2','0',KDKS00,'1',ZXKS00,'2',nvl(A.YSZID0,0)) order by F.BH0000 ) a ,ZS_YSZ000 B where A.ksbh00 = B.YSZID0(+) group by yszmc0 select * from ZS_YSZ000 select * from ZY_FYMX00 a where a.YSZID0='0' and A.CZRQ00 >= '20200101' and A.CZRQ00 <= '20200131' and A.CZRQ00||A.CZSJ00 >= '20200101'||'00:00:00' and A.CZRQ00||A.CZSJ00 <= '20200131'||'23:59:59'