left join tab_enterprise b on a.collaboration_enterprise_id = b.enterprise_id
where a.enterprise_id = #{enterpriseId}
<iftest="search != null and search != '' ">
and (a.collaborator_name like concat('%', #{search}, '%') or a.phone like concat('%', #{search}, '%') or b.enterprise_name like concat('%', #{search}, '%') )
</if>
<iftest="appId != null and appId != '' ">
and a.app_id in (${appId})
</if>
<iftest="deleteFlag != null">
and a.delete_flag = #{deleteFlag}
</if>
<iftest="collaboratorIdList != null and collaboratorIdList.size() > 0">