create or replace view VW_BQ_BRWDXX
as
-- MODIFICATION HISTORY
-- Person      Date         Comments
-- huangjy     2019.12.05   create  for BQ-20191205-004
-- huangjy     2020.08.06   modify  by BQ-20200612-001
select
a.BRBSM0,
a.ID0000,
substr(SF_ZS_CSRQTONL_SYT(b.CSRQ00),1,10)  NL0000,
decode((select YYID00 from XT_YYXX00),'229112',SF_ZS_GETJYBRXX_LYYY(b.BRID00),(select BRXX00 from BM_BRXXB0 where BRID00=b.BRID00)) BRXX00,
(select BMMC00 from BM_BMBM00 where BMBH00=b.DQBQ00) BQMC00,
(select BMMC00 from BM_BMBM00 where BMBH00=b.DQKS00) KSMC00,
b."ZYID00",b."BRID00",b."MRN000",b."ZYH000",b."YBZYH0",b."XM0000",b."XB0000",b."CSRQ00",b."FBBH00",b."LBBH00",b."RYRQ00",b."RYSJ00",b."RYCZY0",
b."CZYXM0",b."RYZD00",b."RYSQK0",b."RYLB00",b."RYBQ00",b."RZKS00",b."RYCWH0",b."DQBQ00",b."DQKS00",b."RCYFH0",b."CYRQ00",b."CYSJ00",b."CYCZY0",
b."CYYGXM",b."ZZYS00",b."ZZYSXM",b."ZRYS00",b."ZRYSXM",b."SXYS00",b."SXYSXM",b."HLJBID",b."BRRYCS",b."BRZT00",b."CYDJRQ",b."CYDJSJ",b."SZYS00",
b."YBBRLB",b."YBLB00",b."SSMC00",b."RYZDMC",b."YBZYCS",b."CYXJ00",b."YBKH00",b."YSZID0",b."GSDJH0",b."ZGYS00",b."YKSH00",b."YYSZID",b."SJCYRQ",
b."ZKJCBZ",b."JCYBQH",b."JCYKSH",b."YBQH00",b."CYJSRQ",b."CYJSSJ",b."BAJSZT",b."SHBZH0",b."DQLJID",b."GMS000",b."YSQK00",b."ZRHS00",
b."DBLB00",b."DBLBMC",b."YBZXLB",b."DBZBM0",b."DBZMC0",b."DBZBL0",b."CSLX00",b."SYBQBM",b."FYHJJE",b."XSEBZ0",b."SYZYH0",b."YLZZDH",
b."ZYLSH0",b."CHSFXX",b."CHSQXX",b."CHXQXX",b."ZYQTXX",b."ZRZYLS",b."SFJKFP",b."TTZYH0",b."TTZYID",b."DWID00",b."TTLX00",b."SFJZFP",b."SFRJSS",b."BZBMLB"
from BQ_BRBSM0 a,ZY_BRXXB0 b where a.ZYID00=b.ZYID00 and a.SFYX00='1';