<query id="getDeclaredLatest" action="select">
    <tables>
		<table name="comments" />
		<table name="comment_declared" />
        <table name="comment_declared_log" />
    </tables>
    <columns>
        <column name="comment_declared_log.comment_srl" />
		<column name="count(*)" alias="declared_count" />
		<column name="max(comment_declared_log.regdate)" alias="latest_declared" />
    </columns>
    <conditions>
		<condition operation="equal" column="comments.comment_srl" default="comment_declared_log.comment_srl" />
		<condition operation="equal" column="comment_declared.comment_srl" default="comment_declared_log.comment_srl" pipe="and" />
		<condition operation="more" column="comment_declared.declared_count" default="1" pipe="and" />
        <condition operation="in" column="comment_declared_log.comment_srl" var="comment_srls" pipe="and" />
    </conditions>
    <groups>
        <group column="comment_declared_log.comment_srl" />
    </groups>
    <navigation>
        <index var="sort_index" default="latest_declared" order="order_type" />
        <list_count var="list_count" default="20" />
        <page_count var="page_count" default="10" />
        <page var="page" default="1" />
    </navigation>
</query>
