create or replace view vw_bq_zgys_ydhl as
select B.ZWXM00,B.XKH000,B.PYSM00,B.WBSM00,B.YGBH00,A.BMBH00,A.XTDM00 from XT_YHBMQX A,BM_YGBM00 B where A.YGBH00=B.YGBH00 
and TO_DATE(A.KSRQ00||A.KSSJ00,'YYYYMMDDHH24:MI:SS') <= sysdate
and (A.JSRQ00 is null or trim(A.JSRQ00) is null or (TO_DATE(A.JSRQ00||A.JSSJ00,'YYYYMMDDHH24:MI:SS') >= sysdate)) and B.YGXZ00 in ('0','1','2')and B.CZBZ00 <>'2';
