select COUNT(id)
from house_info_config hic
where
(hic.ip_start <![CDATA[<=]]> #{ipend} AND hic.ip_end <![CDATA[>=]]> #{ipend})
OR
(hic.ip_start <![CDATA[>=]]> #{ipstart} AND hic.ip_end <![CDATA[<=]]> #{ipend})
OR
(hic.ip_start <![CDATA[<=]]> #{ipstart} AND hic.ip_end <![CDATA[>=]]> #{ipstart})