From 2d27b24029adafdbfc5703b38a519d65beda6a68 Mon Sep 17 00:00:00 2001 From: heheng <heheng@123456> Date: 星期三, 20 十一月 2024 16:23:23 +0800 Subject: [PATCH] 更改 --- expert-system/src/main/resources/mapper/system/ProjectFileMapper.xml | 47 ++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 38 insertions(+), 9 deletions(-) diff --git a/expert-system/src/main/resources/mapper/system/ProjectFileMapper.xml b/expert-system/src/main/resources/mapper/system/ProjectFileMapper.xml index 7dfd6e8..aebc10a 100644 --- a/expert-system/src/main/resources/mapper/system/ProjectFileMapper.xml +++ b/expert-system/src/main/resources/mapper/system/ProjectFileMapper.xml @@ -28,7 +28,8 @@ <select id="selectProjectFileList" parameterType="ProjectFile" resultMap="ProjectFileResult"> <include refid="selectProjectFileVo"/> - <where> + <where> + and del_flag = 0 <if test="projectId != null "> and project_id = #{projectId}</if> <if test="module != null and module != ''"> and module = #{module}</if> <if test="filePath != null and filePath != ''"> and file_path = #{filePath}</if> @@ -82,6 +83,32 @@ </trim> </insert> + + + <insert id="insertProjectFiles" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id"> + insert into project_file + (project_id,module,file_path,file_url,file_name,file_suffix,file_desc,file_size,file_type,create_by) + values + <foreach collection="list" item="item" separator=","> + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="item.projectId != null">#{item.projectId},</if> + <if test="item.module != null and item.module != ''">#{item.module},</if> + <if test="item.filePath != null">#{item.filePath},</if> + <if test="item.fileUrl != null">#{item.fileUrl},</if> + <if test="item.fileName != null">#{item.fileName},</if> + <if test="item.fileSuffix != null">#{item.fileSuffix},</if> + <if test="item.fileDesc != null">#{item.fileDesc},</if> + <if test="item.fileSize != null">#{item.fileSize},</if> + <if test="item.fileType != null">#{item.fileType},</if> + <if test="item.createBy != null">#{item.createBy},</if> + </trim> + </foreach> + </insert> + + + + + <update id="updateProjectFile" parameterType="ProjectFile"> update project_file <trim prefix="SET" suffixOverrides=","> @@ -95,22 +122,24 @@ <if test="fileSize != null">file_size = #{fileSize},</if> <if test="fileType != null">file_type = #{fileType},</if> <if test="delFlag != null">del_flag = #{delFlag},</if> - <if test="createBy != null">create_by = #{createBy},</if> - <if test="createTime != null">create_time = #{createTime},</if> <if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateTime != null">update_time = #{updateTime},</if> </trim> where id = #{id} </update> - <delete id="deleteProjectFileById" parameterType="Long"> - delete from project_file where id = #{id} - </delete> + <update id="deleteProjectFileById" parameterType="Long"> + update project_file set del_flag = 1 where id = #{id} + </update> - <delete id="deleteProjectFileByIds" parameterType="String"> - delete from project_file where id in + <update id="deleteProjectFileByIdAndType" > + update project_file set del_flag = 1 where project_id = #{projectId} and module = #{module} + </update> + + <update id="deleteProjectFileByIds" parameterType="String"> + update project_file set del_flag = 1 where id in <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach> - </delete> + </update> </mapper> \ No newline at end of file -- Gitblit v1.9.2