|
@@ -0,0 +1,172 @@
|
|
|
+<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
+<!DOCTYPE mapper
|
|
|
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+<mapper namespace="com.ruoyi.tool.mapper.TUnifyFileMapper">
|
|
|
+
|
|
|
+ <resultMap type="TUnifyFile" id="TUnifyFileResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="fileId" column="file_id" />
|
|
|
+ <result property="uploadName" column="upload_name" />
|
|
|
+ <result property="uploadType" column="upload_type" />
|
|
|
+ <result property="uploadPath" column="upload_path" />
|
|
|
+ <result property="uploadFormat" column="upload_format" />
|
|
|
+ <result property="newUploadName" column="new_upload_name" />
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
+ <result property="fileBusinessId" column="file_business_id" />
|
|
|
+ <result property="object" column="object" />
|
|
|
+ <result property="bytes" column="bytes" />
|
|
|
+ <result property="created_at" column="created_at" />
|
|
|
+ <result property="filename" column="filename" />
|
|
|
+ <result property="purpose" column="purpose" />
|
|
|
+ <result property="status" column="status" />
|
|
|
+ <result property="status_details" column="status_details" />
|
|
|
+ <result property="content" column="content" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectTUnifyFileVo">
|
|
|
+ select id, file_id, upload_name, upload_type, upload_path, upload_format, new_upload_name, del_flag, object, bytes, created_at, filename, purpose, status, status_details, content, file_business_id, create_by, create_time, update_by, update_time from t_unify_file
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectTUnifyFileList" parameterType="TUnifyFile" resultMap="TUnifyFileResult">
|
|
|
+ <include refid="selectTUnifyFileVo"/>
|
|
|
+ <where>
|
|
|
+ del_flag = 0
|
|
|
+ <if test="fileId != null and fileId != ''"> and file_id = #{fileId}</if>
|
|
|
+ <if test="uploadName != null and uploadName != ''"> and upload_name like concat('%', #{uploadName}, '%')</if>
|
|
|
+ <if test="uploadType != null and uploadType != ''"> and upload_type = #{uploadType}</if>
|
|
|
+ <if test="uploadPath != null and uploadPath != ''"> and upload_path = #{uploadPath}</if>
|
|
|
+ <if test="uploadFormat != null and uploadFormat != ''"> and upload_format = #{uploadFormat}</if>
|
|
|
+ <if test="newUploadName != null and newUploadName != ''"> and new_upload_name like concat('%', #{newUploadName}, '%')</if>
|
|
|
+ <if test="fileBusinessId != null and fileBusinessId != ''"> and file_business_id = #{fileBusinessId}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectTUnifyFileById" parameterType="String" resultMap="TUnifyFileResult">
|
|
|
+ <include refid="selectTUnifyFileVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertTUnifyFile" parameterType="TUnifyFile">
|
|
|
+ insert into t_unify_file
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">id,</if>
|
|
|
+ <if test="fileId != null">file_id,</if>
|
|
|
+ <if test="uploadName != null">upload_name,</if>
|
|
|
+ <if test="uploadType != null">upload_type,</if>
|
|
|
+ <if test="uploadPath != null">upload_path,</if>
|
|
|
+ <if test="uploadFormat != null">upload_format,</if>
|
|
|
+ <if test="newUploadName != null">new_upload_name,</if>
|
|
|
+ <if test="delFlag != null">del_flag,</if>
|
|
|
+ <if test="fileBusinessId != null">file_business_id,</if>
|
|
|
+ <if test="object != null">object,</if>
|
|
|
+ <if test="bytes != null">bytes,</if>
|
|
|
+ <if test="created_at != null">created_at,</if>
|
|
|
+ <if test="filename != null">filename,</if>
|
|
|
+ <if test="purpose != null">purpose,</if>
|
|
|
+ <if test="status != null">status,</if>
|
|
|
+ <if test="status_details != null">status_details,</if>
|
|
|
+ <if test="content != null">content,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">#{id},</if>
|
|
|
+ <if test="fileId != null">#{fileId},</if>
|
|
|
+ <if test="uploadName != null">#{uploadName},</if>
|
|
|
+ <if test="uploadType != null">#{uploadType},</if>
|
|
|
+ <if test="uploadPath != null">#{uploadPath},</if>
|
|
|
+ <if test="uploadFormat != null">#{uploadFormat},</if>
|
|
|
+ <if test="newUploadName != null">#{newUploadName},</if>
|
|
|
+ <if test="delFlag != null">#{delFlag},</if>
|
|
|
+ <if test="fileBusinessId != null">#{fileBusinessId},</if>
|
|
|
+ <if test="object != null">#{object},</if>
|
|
|
+ <if test="bytes != null">#{bytes},</if>
|
|
|
+ <if test="created_at != null">#{created_at},</if>
|
|
|
+ <if test="filename != null">#{filename},</if>
|
|
|
+ <if test="purpose != null">#{purpose},</if>
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
+ <if test="status_details != null">#{status_details},</if>
|
|
|
+ <if test="content != null">#{content},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateTUnifyFile" parameterType="TUnifyFile">
|
|
|
+ update t_unify_file
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="fileId != null">file_id = #{fileId},</if>
|
|
|
+ <if test="uploadName != null">upload_name = #{uploadName},</if>
|
|
|
+ <if test="uploadType != null">upload_type = #{uploadType},</if>
|
|
|
+ <if test="uploadPath != null">upload_path = #{uploadPath},</if>
|
|
|
+ <if test="uploadFormat != null">upload_format = #{uploadFormat},</if>
|
|
|
+ <if test="newUploadName != null">new_upload_name = #{newUploadName},</if>
|
|
|
+ <if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
+ <if test="fileBusinessId != null">file_business_id = #{fileBusinessId},</if>
|
|
|
+ <if test="object != null">object = #{object},</if>
|
|
|
+ <if test="bytes != null">bytes = #{bytes},</if>
|
|
|
+ <if test="created_at != null">created_at = #{created_at},</if>
|
|
|
+ <if test="filename != null">filename = #{filename},</if>
|
|
|
+ <if test="purpose != null">purpose = #{purpose},</if>
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
+ <if test="status_details != null">status_details = #{status_details},</if>
|
|
|
+ <if test="content != null">content = #{content},</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="deleteTUnifyFileById" parameterType="String">
|
|
|
+ delete from t_unify_file where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteTUnifyFileByIds" parameterType="String">
|
|
|
+ delete from t_unify_file where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <update id="updateTUnifyFileByIds" parameterType="String">
|
|
|
+ update t_unify_file
|
|
|
+ set del_flag = 1
|
|
|
+ where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updateTUnifyFileBusinessIds" parameterType="String">
|
|
|
+ update t_unify_file
|
|
|
+ set del_flag = 1
|
|
|
+ where file_business_id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="selectTUnifyFileByBusinessIdList" parameterType="String" resultMap="TUnifyFileResult">
|
|
|
+ <include refid="selectTUnifyFileVo"/>
|
|
|
+ where file_business_id = #{fileBusinessId} and del_flag = 0
|
|
|
+ <if test="uploadType != null and uploadType != ''"> and upload_type = #{uploadType}</if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="listFileId" parameterType="String" resultMap="TUnifyFileResult">
|
|
|
+ <include refid="selectTUnifyFileVo"/>
|
|
|
+ where file_id = #{fileId} and del_flag = 0
|
|
|
+ order by create_time
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|