select zyid,dqksmc,brid,zycs,brxm,xb,ch,ryzd,ryrq,cyrq,zgysmc,nl,icuks ,GROUP_CONCAT(yzxmmc) yzxmmc FROM
(
select zyid,dqksmc,brid,zycs,brxm,xb,ch,ryzd,ryrq,cyrq,zgysmc,nl,icuks , yzxmmc FROM
(
select a.yzxmmc,b.* FROM
(
select zyid,brid,zycs,yzxmmc from jk_his_zybryzxxb where c_lz='1' and
((yzxmmc LIKE '呼吸机辅助呼吸%' or yzxmmc='有创呼吸机辅助呼吸') or yzxmmc='动脉、深静脉置管护理' or (yzxmmc like '%留置导尿%' or yzxmmc like '%留置尿管%'))
) a,
(
select a.*,b.icuks from
(
select DISTINCT zyid,dqksmc,brid,zycs,brxm,xb,ch,ryzd,date_format(ryrq,'%Y-%m-%d') ryrq, date_format(cyrq,'%Y-%m-%d') cyrq,zgysmc,nl from jk_his_zybrcryxxb
) a,(select dept_name,icuks from sys_dept where icuks=1) b where a.dqksmc=b.dept_name
) b where a.zyid=b.zyid ) a GROUP BY zyid,dqksmc,brid,zycs,brxm,xb,ch,ryzd,ryrq,cyrq,zgysmc,nl,icuks,yzxmmc
) c GROUP BY zyid,dqksmc,brid,zycs,brxm,xb,ch,ryzd,ryrq,cyrq,zgysmc,nl,icuks