forked from gzzfw/backEnd/gz-dyh

liyj
2024-09-02 56008e5f28dd54025e11a6e988fbc09e66a3ebe8
dyh-service/dyh-sys/src/main/java/cn/huge/module/file/dao/mapper/xml/FileInfoMapper.xml
@@ -126,7 +126,7 @@
                    and zip_url = #{terms.zipUrl}
                </if>
                <if test="terms.deleteStatus = null and terms.deleteStatus =''">
                    and delete_status = '0'
                    and delete_status = 0
                </if>
                <if test="terms.deleteStatus != null and terms.deleteStatus !=''">
                    and delete_status = #{terms.deleteStatus}
@@ -211,4 +211,46 @@
        limit #{page.offset}, #{page.size}
    </select>
    <!-- 查看附件组件-分类查询附件-结果集 -->
    <resultMap id="fileByCatDTO" type="cn.huge.module.file.domain.dto.FileForCatDTO">
    </resultMap>
    <!-- 查看附件组件-分类查询附件 -->
    <sql id="listFileByCatTerms-where-part">
        <if test="terms != null">
            <where>
                <if test="terms.mainId != null and terms.mainId !=''">
                    and t2.main_id = #{terms.mainId}
                </if>
                <if test="terms.ownerCat != null and terms.ownerCat !=''">
                    and t2.owner_cat = #{terms.ownerCat}
                </if>
                <if test="terms.uploaderType != null and terms.uploaderType !=''">
                    and t2.uploader_type = #{terms.uploaderType}
                </if>
                <if test="terms.createStart != null and terms.createStart !='' and terms.createEnd != null and terms.createEnd !=''">
                    and (DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.createStart}
                    and DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.createEnd})
                </if>
                <if test="terms.deleteStatus = null and terms.deleteStatus =''">
                    and delete_status = 0
                </if>
                <if test="terms.deleteStatus != null and terms.deleteStatus !=''">
                    and delete_status = #{terms.deleteStatus}
                </if>
            </where>
        </if>
    </sql>
    <!--  查看附件组件-分类查询附件  -->
    <select id="listFileByCatTerms" resultMap="fileByCatDTO">
        select t1.id, t1.name, t1.true_name as trueName,
        t1.suffix, t1.size, t1.unit, t1.show_url as showUrl, t1.down_url as downUrl,
        t2.owner_cat as ownerCat, t2.uploader_id as uploaderId, t2.uploader_name as uploaderName,
        t2.uploader_type as uploaderType, t2.create_time as uploadTime
        from dyh_file_info t1
        left join dyh_file_relate t2 on t1.id = t2.file_id
        <include refid="listFileByCatTerms-where-part"/>
    </select>
</mapper>