select cbid, row_number() over(order by zxid) as xh ,xmid,zxid,bwid,bwcb,jbrid, replace(CONVERT(varchar(10),jbrq,111 ),'/','-')as jbrq, case cbzt when '1' then '启用' when '0' then '未启用' else '修改' end cbzt,shzt from jc_yscbfxb
select zxmid,row_number() over(order by xm.zzjgfhid,zxmmc) as xh,zxm.xmid,xmmc,zxmmc,htzj,zxm.fzrid,rs.ygmc, case flag when '0' then '启用' else '未启用' end flag,zxm.bz from jc_xmzxmb zxm left join v_jc_xmzzjg xm on zxm.xmid=xm.xmid left join rs_ygjbxxb rs on zxm.fzrid=rs.ygid