|
@@ -0,0 +1,104 @@
|
|
|
+<?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.system.mapper.SysFileMapper">
|
|
|
+
|
|
|
+ <resultMap type="SysFile" id="SysFileResult">
|
|
|
+ <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="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="selectSysFileVo">
|
|
|
+ select id, file_id, upload_name, upload_type, upload_path, upload_format, new_upload_name, del_flag, file_business_id, create_by, create_time, update_by, update_time from sys_file
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectSysFileList" parameterType="SysFile" resultMap="SysFileResult">
|
|
|
+ <include refid="selectSysFileVo"/>
|
|
|
+ <where>
|
|
|
+ <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="uploadFormat != null and uploadFormat != ''"> and upload_format = #{uploadFormat}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectSysFileById" parameterType="String" resultMap="SysFileResult">
|
|
|
+ <include refid="selectSysFileVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertSysFile" parameterType="SysFile">
|
|
|
+ insert into sys_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="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="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="updateSysFile" parameterType="SysFile">
|
|
|
+ update sys_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="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="deleteSysFileById" parameterType="String">
|
|
|
+ delete from sys_file where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteSysFileByIds" parameterType="String">
|
|
|
+ delete from sys_file where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|