From 56008e5f28dd54025e11a6e988fbc09e66a3ebe8 Mon Sep 17 00:00:00 2001
From: liyj <1003249715@qq.com>
Date: Mon, 02 Sep 2024 12:20:24 +0800
Subject: [PATCH] 1、附件管理模块修改

---
 dyh-service/dyh-sys/src/main/java/cn/huge/module/file/dao/mapper/xml/FileInfoMapper.xml |   44 +++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 43 insertions(+), 1 deletions(-)

diff --git a/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/dao/mapper/xml/FileInfoMapper.xml b/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/dao/mapper/xml/FileInfoMapper.xml
index 0800d8d..7c4b6fd 100644
--- a/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/dao/mapper/xml/FileInfoMapper.xml
+++ b/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> 
\ No newline at end of file

--
Gitblit v1.8.0