select t1.tnoticeid, t1.ftype, t1.ftitle, t1.fsummary, t1.checkdate, t1.fisontop,t2.description as fcolor
from DSBCRM..tnotice t1
left join DSBCRM..ttypedetail t2 on t1.siteid=t2.siteid and t1.ftype=t2.fvalue and t2.ftype='¹«¸æ°å¿é'
where t1.siteid = $siteid$ and t1.fstatus='·¢²¼' and t1.fbegdate<=getdate() and t1.fenddate>=getdate() and $where$
and exists(select *from tnotice_users where siteid=t1.siteid and tnoticeid=t1.tnoticeid and tenterprise_userid=$tenterprise_userid$)