From 716f57dacce347ba154f3b6a994f4e383e3a97a4 Mon Sep 17 00:00:00 2001
From: liyj <1003249715@qq.com>
Date: Thu, 05 Sep 2024 11:15:38 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 dyh-service/dyh-sys/src/main/java/cn/huge/module/file/dao/mapper/xml/FileInfoMapper.xml |   81 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 81 insertions(+), 0 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 592b292..f789de2 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
@@ -11,6 +11,32 @@
 <mapper namespace="cn.huge.module.file.dao.mapper.FileInfoMapper">
     <!-- 结果集 -->
     <resultMap id="dataResult" type="cn.huge.module.file.domain.po.FileInfo">
+        <result property="id" column="id"/>
+        <result property="name" column="name"/>
+        <result property="trueName" column="true_name"/>
+        <result property="fileName" column="file_name"/>
+        <result property="suffix" column="suffix"/>
+        <result property="cat" column="cat"/>
+        <result property="size" column="size"/>
+        <result property="unit" column="unit"/>
+        <result property="md5Code" column="md5_code"/>
+        <result property="storeWay" column="store_way"/>
+        <result property="path" column="path"/>
+        <result property="fullPath" column="full_path"/>
+        <result property="showUrl" column="show_url"/>
+        <result property="downUrl" column="down_url"/>
+        <result property="zipUrl" column="zip_url"/>
+        <result property="deleteStatus" column="delete_status"/>
+        <result property="custId" column="cust_id"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="createTime" column="create_time"/>
+        <result property="ownerId" column="owner_id"/>
+        <result property="ownerCat" column="owner_cat"/>
+        <result property="ownerType" column="owner_type"/>
+        <result property="uploaderId" column="uploader_id"/>
+        <result property="uploaderName" column="uploader_name"/>
+    </resultMap>
+    <resultMap id="fileResult" type="cn.huge.module.file.domain.po.FileInfo">
             <result property="id" column="id"/>
             <result property="name" column="name"/>
             <result property="trueName" column="true_name"/>
@@ -30,6 +56,11 @@
             <result property="custId" column="cust_id"/>
             <result property="updateTime" column="update_time"/>
             <result property="createTime" column="create_time"/>
+            <result property="ownerId" column="owner_id"/>
+            <result property="ownerCat" column="owner_cat"/>
+            <result property="ownerType" column="owner_type"/>
+            <result property="uploaderId" column="uploader_id"/>
+            <result property="uploaderName" column="uploader_name"/>
     </resultMap>
     <!-- 表 -->
     <sql id='table-name'>dyh_file_info</sql>
@@ -54,6 +85,28 @@
         cust_id,
         update_time,
         create_time
+    </sql>
+    <!-- 字段 -->
+    <sql id="column-part-t">
+        t1.id,
+        t1.name,
+        t1.true_name,
+        t1.file_name,
+        t1.suffix,
+        t1.cat,
+        t1.size,
+        t1.unit,
+        t1.md5_code,
+        t1.store_way,
+        t1.path,
+        t1.full_path,
+        t1.show_url,
+        t1.down_url,
+        t1.zip_url,
+        t1.delete_status,
+        t1.cust_id,
+        t1.update_time,
+        t1.create_time
     </sql>
     <!-- 更新实体字段 -->
     <sql id="set-part">
@@ -249,4 +302,32 @@
         <include refid="listFileByCatTerms-where-part"/>
     </select>
 
+    <!-- 根据多个编号查询 -->
+    <select id="listByids" resultMap="fileResult">
+        SELECT t2.owner_id, t2.owner_cat, t2.owner_type, t2.uploader_id, t2.uploader_name,
+        <include refid="column-part-t"/>
+        FROM dyh_file_info t1
+        LEFT JOIN dyh_file_relate t2 ON t1.id = t2.file_id
+        WHERE t2.main_id = #{mainId}
+        <if test="terms.ownerIds = null and terms.ownerIds =''">
+            and t2.owner_id in (${ownerIds})
+        </if>
+        <if test="terms.types = null and terms.types =''">
+            and t2.owner_type in (${types})
+        </if>
+
+
+
+    </select>
+
+    <!-- 根据多个编号查询 -->
+    <select id="listByIdsTypes" resultMap="fileResult">
+        SELECT t2.owner_id, t2.owner_cat, t2.owner_type, t2.uploader_id, t2.uploader_name,
+        <include refid="column-part-t"/>
+        FROM dyh_file_info t1
+        LEFT JOIN dyh_file_relate t2 ON t1.id = t2.file_id
+        WHERE t2.owner_id in (${ownerIds})
+        and t2.main_id = #{mainId}
+        and t2.owner_type in (${types})
+    </select>
 </mapper> 
\ No newline at end of file

--
Gitblit v1.8.0