|
@@ -0,0 +1,156 @@
|
|
|
+<?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.zkqy.business.mapper.FileManagementMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.zkqy.business.entity.FileManagement" id="FileManagementResult">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="fileGroupKey" column="file_group_key"/>
|
|
|
+ <result property="originalFileName" column="original_file_name"/>
|
|
|
+ <result property="newFileName" column="new_file_name"/>
|
|
|
+ <result property="filePath" column="file_path"/>
|
|
|
+ <result property="fileType" column="file_type"/>
|
|
|
+ <result property="fileSize" column="file_size"/>
|
|
|
+ <result property="fileContent" column="file_content"/>
|
|
|
+ <result property="fileData" column="file_data"/>
|
|
|
+ <result property="fileDownloadUrl" column="file_download_url"/>
|
|
|
+ <result property="remark" column="remark"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="createById" column="create_by_id"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ <result property="updateById" column="update_by_id"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ <result property="delFlag" column="del_flag"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectFileManagementVo">
|
|
|
+ select id,
|
|
|
+ original_file_name,
|
|
|
+ new_file_name,
|
|
|
+ file_path,
|
|
|
+ file_type,
|
|
|
+ file_size,
|
|
|
+ file_content,
|
|
|
+ file_data,
|
|
|
+ file_download_url,
|
|
|
+ remark,
|
|
|
+ create_by,
|
|
|
+ create_by_id,
|
|
|
+ create_time,
|
|
|
+ update_by,
|
|
|
+ update_by_id,
|
|
|
+ update_time,
|
|
|
+ del_flag
|
|
|
+ from {DBNAME}.file_management
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectFileManagementList" parameterType="com.zkqy.business.entity.FileManagement"
|
|
|
+ resultMap="FileManagementResult">
|
|
|
+ <include refid="selectFileManagementVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="fileGroupKey != null and fileGroupKey != ''">and file_group_key = #{fileGroupKey}</if>
|
|
|
+ <if test="originalFileName != null and originalFileName != ''">and original_file_name like concat('%',
|
|
|
+ #{originalFileName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="newFileName != null and newFileName != ''">and new_file_name like concat('%', #{newFileName},
|
|
|
+ '%')
|
|
|
+ </if>
|
|
|
+ <if test="filePath != null and filePath != ''">and file_path = #{filePath}</if>
|
|
|
+ <if test="fileType != null and fileType != ''">and file_type = #{fileType}</if>
|
|
|
+ <if test="fileSize != null ">and file_size = #{fileSize}</if>
|
|
|
+ <if test="fileContent != null and fileContent != ''">and file_content = #{fileContent}</if>
|
|
|
+ <if test="fileData != null and fileData != ''">and file_data = #{fileData}</if>
|
|
|
+ <if test="fileDownloadUrl != null and fileDownloadUrl != ''">and file_download_url = #{fileDownloadUrl}
|
|
|
+ </if>
|
|
|
+ <if test="createById != null ">and create_by_id = #{createById}</if>
|
|
|
+ <if test="updateById != null ">and update_by_id = #{updateById}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectFileManagementById" parameterType="Long" resultMap="FileManagementResult">
|
|
|
+ <include refid="selectFileManagementVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertFileManagement" parameterType="com.zkqy.business.entity.FileManagement" useGeneratedKeys="true"
|
|
|
+ keyProperty="id">
|
|
|
+ insert into {DBNAME}.file_management
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="fileGroupKey != null">file_group_key,</if>
|
|
|
+ <if test="originalFileName != null">original_file_name,</if>
|
|
|
+ <if test="newFileName != null">new_file_name,</if>
|
|
|
+ <if test="filePath != null">file_path,</if>
|
|
|
+ <if test="fileType != null">file_type,</if>
|
|
|
+ <if test="fileSize != null">file_size,</if>
|
|
|
+ <if test="fileContent != null">file_content,</if>
|
|
|
+ <if test="fileData != null">file_data,</if>
|
|
|
+ <if test="fileDownloadUrl != null">file_download_url,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createById != null">create_by_id,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateById != null">update_by_id,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="delFlag != null">del_flag,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="fileGroupKey != null">#{fileGroupKey},</if>
|
|
|
+ <if test="originalFileName != null">#{originalFileName},</if>
|
|
|
+ <if test="newFileName != null">#{newFileName},</if>
|
|
|
+ <if test="filePath != null">#{filePath},</if>
|
|
|
+ <if test="fileType != null">#{fileType},</if>
|
|
|
+ <if test="fileSize != null">#{fileSize},</if>
|
|
|
+ <if test="fileContent != null">#{fileContent},</if>
|
|
|
+ <if test="fileData != null">#{fileData},</if>
|
|
|
+ <if test="fileDownloadUrl != null">#{fileDownloadUrl},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createById != null">#{createById},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateById != null">#{updateById},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="delFlag != null">#{delFlag},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateFileManagement" parameterType="com.zkqy.business.entity.FileManagement">
|
|
|
+ update {DBNAME}.file_management
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="fileGroupKey != null">file_group_key = #{fileGroupKey},</if>
|
|
|
+ <if test="originalFileName != null">original_file_name = #{originalFileName},</if>
|
|
|
+ <if test="newFileName != null">new_file_name = #{newFileName},</if>
|
|
|
+ <if test="filePath != null">file_path = #{filePath},</if>
|
|
|
+ <if test="fileType != null">file_type = #{fileType},</if>
|
|
|
+ <if test="fileSize != null">file_size = #{fileSize},</if>
|
|
|
+ <if test="fileContent != null">file_content = #{fileContent},</if>
|
|
|
+ <if test="fileData != null">file_data = #{fileData},</if>
|
|
|
+ <if test="fileDownloadUrl != null">file_download_url = #{fileDownloadUrl},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createById != null">create_by_id = #{createById},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateById != null">update_by_id = #{updateById},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteFileManagementById" parameterType="Long">
|
|
|
+ delete
|
|
|
+ from {DBNAME}.file_management
|
|
|
+ where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteFileManagementByIds" parameterType="String">
|
|
|
+ delete from {DBNAME}.file_management where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|