gy_ksdm
create or replace view gy_ksdm as
select id_no as ksdm,
Translate(na USING CHAR_CS) as ksmc,
rownum as plsx,
case to_char(SD_DEPTP) when '10' then 'Y' else 'N' end ZYSY,
case to_char(SD_DEPTP) when '13' then 'Y' else 'N' end as BQSY,
case to_char(SD_DEPTP) when '10' then 'Y' else 'Y' end as YJSY,
case when exists(select 1 FROM prd_his.HI_BD_DEP_MED a where a.id_dep = b.id_dep and instr(a.sds_depvistp_cd,'111')>0) then 'Y' else 'N' end as MZSY,
(select id_no from prd_bbp.hi_sys_dep a where a.id_dep = b.id_par) as SJKS,
'01' as YYDM,
py as pydm
from prd_bbp.hi_sys_dep b where id_tet ='EZYL' and fg_active ='1' AND ID_NO IS NOT NULL;

浙公网安备 33010602011771号