<dtml-comment>
title:
connection_id:cmf_activity_sql_connection
max_rows:1000
max_cache:0
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>method_id
message_uid
path
tag
count
serialization_tag
</params>
SELECT
<dtml-if expr="count">
    COUNT(*) AS uid_count
<dtml-else>
    *
</dtml-if>
FROM
    message_queue
WHERE
    processing_node > -10
<dtml-if expr="method_id is not None">
    AND method_id IN (
<dtml-in method_id><dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in>
    )
</dtml-if>
<dtml-if expr="message_uid is not None">AND uid = <dtml-sqlvar message_uid type="int"> </dtml-if>
<dtml-if expr="path is not None">
    AND path IN ( 
<dtml-in path><dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in>
    )
</dtml-if>
<dtml-if expr="tag is not None">
    AND tag IN (
<dtml-in tag><dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in>
    )
</dtml-if>
<dtml-if expr="serialization_tag is not None">
    AND processing_node > -1
    AND serialization_tag = <dtml-sqlvar serialization_tag type="string">
</dtml-if>
