From b6fa58652c12f0c61409cc44dfd8ad78f821b6c6 Mon Sep 17 00:00:00 2001
From: liyj <1003249715@qq.com>
Date: Wed, 11 Sep 2024 01:19:25 +0800
Subject: [PATCH] 1、流程bug修复
---
dyh-service/dyh-sys/src/main/java/cn/huge/module/file/dao/mapper/xml/FileInfoMapper.xml | 86 ++++++++++++++++++++++++++++++++++++++++--
1 files changed, 81 insertions(+), 5 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 7c4b6fd..5f4a18e 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">
@@ -212,10 +265,6 @@
</select>
- <!-- 查看附件组件-分类查询附件-结果集 -->
- <resultMap id="fileByCatDTO" type="cn.huge.module.file.domain.dto.FileForCatDTO">
-
- </resultMap>
<!-- 查看附件组件-分类查询附件 -->
<sql id="listFileByCatTerms-where-part">
<if test="terms != null">
@@ -243,7 +292,7 @@
</if>
</sql>
<!-- 查看附件组件-分类查询附件 -->
- <select id="listFileByCatTerms" resultMap="fileByCatDTO">
+ <select id="listFileByCatTerms" resultType="cn.huge.module.file.domain.dto.FileForCatDTO">
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,
@@ -253,4 +302,31 @@
<include refid="listFileByCatTerms-where-part"/>
</select>
+ <!-- 根据多个编号查询 -->
+ <select id="listFile" 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
+ t1.delete_status = 0
+ and t2.main_id = #{terms.mainId}
+ <if test="terms.ownerIds != null and terms.ownerIds !=''">
+ and t2.owner_id in (${terms.ownerIds})
+ </if>
+ <if test="terms.types != null and terms.types !=''">
+ and t2.owner_type in (${terms.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