and exists ( select 1 from xm_group_user gu where gu.userid=#{compete} and (gu.project_id=res.project_id or gu.product_id=res.product_id))
and (res.handler_userid=#{compete} or res.create_userid=#{compete} or exists ( select 1 from xm_group_user gu where gu.userid=#{compete} and (gu.project_id=res.project_id or gu.product_id=res.product_id)))
</if>
</if>
<iftest="key != null and key !='' "> and res.name like #{key} </if>
<iftest="key != null and key !='' "> and res.name like #{key} </if>
<iftest="work != null and work != ''"> and res.status in ('1','2','3','4','7') </if>
<iftest="work != null and work != ''"> and res.status in ('1','2','3','4','7') </if>