- ,( SELECT count(c.id_) FROM base_company_device_relation c WHERE c.device_id = a.id_ AND c.company_id = #{searchParams.isBoundCompanyId} and c.del_flag = 0) AS is_bind
+ ,( SELECT count(c.id_) FROM base_company_device_relation c WHERE c.device_id = a.id_ AND c.company_id = #{searchParams.isBoundCompanyId}) AS is_bind
</if>
<if test="searchParams.isBoundPersonId != null" >
,( SELECT count(c.id_) FROM base_person_device_relation c WHERE c.device_id = a.id_ AND c.person_id = #{searchParams.isBoundPersonId} and c.del_flag = 0) AS is_bind