WHERE c.deleted = 0 AND ( c.province_code = #{regionCode} OR c.city_code = #{regionCode} OR c.district_code = #{regionCode} ) AND c.name LIKE CONCAT('%', #{name}, '%') AND c.contact_phone LIKE CONCAT('%', #{phone}, '%') AND pa.agent_name LIKE CONCAT('%', #{agentName}, '%') AND c.created_at >= #{createdFrom} AND c.created_at <= #{createdTo} AND c.status = #{status}