<query id="getFileListByTargetStatus" action="select">
    <tables>
        <table name="files" alias="files" />
        <table name="member" type="left join">
            <conditions>
                <condition operation="equal" column="files.member_srl" default="member.member_srl" />
            </conditions>
        </table>
        <table name="documents" type="left join">
            <conditions>
                <condition operation="equal" column="files.upload_target_srl" default="documents.document_srl" />
            </conditions>
        </table>
        <table name="comments" type="left join">
            <conditions>
                <condition operation="equal" column="files.upload_target_srl" default="comments.comment_srl" />
            </conditions>
        </table>
    </tables>
    <columns>
        <column name="files.*" />
    </columns>
    <conditions>
        <condition operation="in" column="files.module_srl" var="s_module_srl" />
        <condition operation="notin" column="files.module_srl" var="exclude_module_srl" pipe="and" />
        <condition operation="equal" column="files.isvalid" var="isvalid" pipe="and" />
        <condition operation="equal" column="files.direct_download" var="direct_download" pipe="and" />
		<condition operation="below" column="files.regdate" var="regdate_before" pipe="and" />
		<group pipe="and">
			<condition operation="in" column="documents.status" var="document_status" />
			<condition operation="null" column="documents.status" pipe="or" />
		</group>
		<group pipe="and">
			<condition operation="in" column="comments.is_secret" var="comment_is_secret" />
			<condition operation="null" column="comments.is_secret" pipe="or" />
		</group>
        <group pipe="and">
            <condition operation="search" column="files.source_filename" var="s_filename" pipe="or" />
            <condition operation="more" column="files.file_size" var="s_filesize_more" pipe="or" />
            <condition operation="less" column="files.file_size" var="s_filesize_less" pipe="or" />
            <condition operation="more" column="files.download_count" var="s_download_count" pipe="or" />
            <condition operation="like_prefix" column="files.regdate" var="s_regdate" pipe="or" />
            <condition operation="like_prefix" column="files.ipaddress" var="s_ipaddress" pipe="or" />
            <condition operation="search" column="member.user_id" var="s_user_id" pipe="or" />
            <condition operation="search" column="member.user_name" var="s_user_name" pipe="or" />
            <condition operation="search" column="member.nick_name" var="s_nick_name" pipe="or" />
        </group>
    </conditions>
    <navigation>
        <index var="sort_index" default="files.file_srl" order="desc" />
        <list_count var="list_count" default="20" />
        <page_count var="page_count" default="10" />
        <page var="page" default="1" />
    </navigation>
</query>
