|
|
@@ -1,219 +0,0 @@
|
|
|
-<?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.usoftchina.smartschool.file.mapper.FileInfoMapper">
|
|
|
-
|
|
|
- <insert id="insert" parameterType="com.usoftchina.smartschool.file.po.FileInfo"
|
|
|
- useGeneratedKeys="true" keyProperty="id">
|
|
|
- insert into f_fileinfo(folder_id,name,full_path,mime,ext,type,size,company_id,
|
|
|
- creator_id,create_time,updater_id,update_time,deleted,deleter_id,delete_time)
|
|
|
- values (#{folderId,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{fullPath,jdbcType=VARCHAR},
|
|
|
- #{mime,jdbcType=VARCHAR},#{ext,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{size,jdbcType=BIGINT},
|
|
|
- #{companyId,jdbcType=BIGINT},#{creatorId,jdbcType=BIGINT},#{createTime,jdbcType=TIMESTAMP},
|
|
|
- #{updaterId,jdbcType=BIGINT},#{updateTime,jdbcType=TIMESTAMP},#{deleted,jdbcType=BOOLEAN},
|
|
|
- #{deleterId,jdbcType=BIGINT},#{deleteTime,jdbcType=TIMESTAMP})
|
|
|
- </insert>
|
|
|
- <insert id="insertSelective" parameterType="com.usoftchina.smartschool.file.po.FileInfo"
|
|
|
- useGeneratedKeys="true" keyProperty="id">
|
|
|
- insert into ac_account
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="folderId != null">
|
|
|
- folder_id,
|
|
|
- </if>
|
|
|
- <if test="name != null">
|
|
|
- name,
|
|
|
- </if>
|
|
|
- <if test="fullPath != null">
|
|
|
- full_path,
|
|
|
- </if>
|
|
|
- <if test="mime != null">
|
|
|
- mime,
|
|
|
- </if>
|
|
|
- <if test="ext != null">
|
|
|
- ext,
|
|
|
- </if>
|
|
|
- <if test="type != null">
|
|
|
- type,
|
|
|
- </if>
|
|
|
- <if test="size != null">
|
|
|
- size,
|
|
|
- </if>
|
|
|
- <if test="companyId != null">
|
|
|
- company_id,
|
|
|
- </if>
|
|
|
- <if test="creatorId != null">
|
|
|
- creator_id,
|
|
|
- </if>
|
|
|
- <if test="createTime != null">
|
|
|
- create_time,
|
|
|
- </if>
|
|
|
- <if test="updaterId != null">
|
|
|
- updater_id,
|
|
|
- </if>
|
|
|
- <if test="updateTime != null">
|
|
|
- update_time,
|
|
|
- </if>
|
|
|
- <if test="deleted != null">
|
|
|
- deleted,
|
|
|
- </if>
|
|
|
- <if test="deleterId != null">
|
|
|
- deleter_id,
|
|
|
- </if>
|
|
|
- <if test="deleteTime != null">
|
|
|
- delete_time,
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="folderId != null">
|
|
|
- #{folder_id,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="name != null">
|
|
|
- #{name,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="fullPath != null">
|
|
|
- #{full_path,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="mime != null">
|
|
|
- #{mime,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ext != null">
|
|
|
- #{ext,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="type != null">
|
|
|
- #{type,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="size != null">
|
|
|
- #{size,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="companyId != null">
|
|
|
- #{company_id,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="creatorId != null">
|
|
|
- #{creatorId,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="createTime != null">
|
|
|
- #{createTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="updaterId != null">
|
|
|
- #{updaterId,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="updateTime != null">
|
|
|
- #{updateTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="deleted != null">
|
|
|
- #{deleted,jdbcType=BOOLEAN},
|
|
|
- </if>
|
|
|
- <if test="deleterId != null">
|
|
|
- #{deleter_id,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="deleteTime != null">
|
|
|
- #{delete_time,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- </insert>
|
|
|
- <update id="updateByPrimaryKey" parameterType="com.usoftchina.smartschool.file.po.FileInfo">
|
|
|
- update f_fileinfo set
|
|
|
- folder_id=#{folderId,jdbcType=BIGINT},name=#{name,jdbcType=VARCHAR},full_path=#{fullPath,jdbcType=VARCHAR},
|
|
|
- mime=#{mime,jdbcType=VARCHAR},ext=#{ext,jdbcType=VARCHAR},type=#{type,jdbcType=VARCHAR},
|
|
|
- size=#{size,jdbcType=BIGINT},company_id=#{companyId,jdbcType=BIGINT},
|
|
|
- creator_id=#{creatorId,jdbcType=BIGINT},create_time=#{createTime,jdbcType=TIMESTAMP},
|
|
|
- updater_id=#{updaterId,jdbcType=BIGINT},update_time=#{updateTime,jdbcType=TIMESTAMP},
|
|
|
- deleted=#{deleted,jdbcType=BOOLEAN},deleter_id=#{deleterId,jdbcType=BIGINT},
|
|
|
- delete_time=#{deleteTime,jdbcType=TIMESTAMP} where id=#{id,jdbcType=BIGINT}
|
|
|
- </update>
|
|
|
- <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.smartschool.file.po.FileInfo">
|
|
|
- update f_fileinfo
|
|
|
- <set>
|
|
|
- <if test="folderId != null">
|
|
|
- folder_id=#{folderId,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="name != null">
|
|
|
- name=#{name,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="fullPath != null">
|
|
|
- full_path=#{fullPath,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="mime != null">
|
|
|
- mime=#{mime,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="ext != null">
|
|
|
- ext=#{ext,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="type != null">
|
|
|
- type=#{type,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="size != null">
|
|
|
- size=#{size,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="companyId != null">
|
|
|
- company_id=#{companyId,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="creatorId != null">
|
|
|
- creator_id=#{creatorId,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="createTime != null">
|
|
|
- create_time=#{createTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="updaterId != null">
|
|
|
- updater_id=#{updaterId,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="updateTime != null">
|
|
|
- update_time=#{updateTime,jdbcType=TIMESTAMP})
|
|
|
- </if>
|
|
|
- <if test="deleted != null">
|
|
|
- deleted=#{deleted,jdbcType=BOOLEAN},
|
|
|
- </if>
|
|
|
- <if test="deleterId != null">
|
|
|
- deleter_id=#{deleterId,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="deleteTime != null">
|
|
|
- delete_time=#{deleteTime,jdbcType=TIMESTAMP})
|
|
|
- </if>
|
|
|
- </set>
|
|
|
- where id=#{id,jdbcType=BIGINT}
|
|
|
- </update>
|
|
|
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
|
|
- delete from f_fileinfo where id=#{id}
|
|
|
- </delete>
|
|
|
-
|
|
|
- <resultMap id="BaseResultMap" type="com.usoftchina.smartschool.file.po.FileInfo">
|
|
|
- <id column="id" jdbcType="BIGINT" property="id"/>
|
|
|
- <result column="folder_id" jdbcType="BIGINT" property="folderId"/>
|
|
|
- <result column="name" jdbcType="VARCHAR" property="name"/>
|
|
|
- <result column="full_path" jdbcType="VARCHAR" property="fullPath"/>
|
|
|
- <result column="mime" jdbcType="VARCHAR" property="mime"/>
|
|
|
- <result column="ext" jdbcType="VARCHAR" property="ext"/>
|
|
|
- <result column="type" jdbcType="VARCHAR" property="type"/>
|
|
|
- <result column="size" jdbcType="BIGINT" property="size"/>
|
|
|
- <result column="company_id" jdbcType="INTEGER" property="companyId"/>
|
|
|
- <result column="creator_id" jdbcType="BIGINT" property="creatorId"/>
|
|
|
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
|
|
- <result column="updater_id" jdbcType="BIGINT" property="updaterId"/>
|
|
|
- <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
|
|
- <result column="deleted" jdbcType="BOOLEAN" property="deleted"/>
|
|
|
- <result column="deleter_id" jdbcType="BIGINT" property="deleterId"/>
|
|
|
- <result column="delete_time" jdbcType="TIMESTAMP" property="deleteTime"/>
|
|
|
- </resultMap>
|
|
|
- <sql id="baseColumns">
|
|
|
- f_fileinfo.id,f_fileinfo.folder_id,f_fileinfo.name,f_fileinfo.full_path,f_fileinfo.mime,f_fileinfo.ext,
|
|
|
- f_fileinfo.type,f_fileinfo.size,f_fileinfo.company_id,f_fileinfo.creator_id,f_fileinfo.create_time,
|
|
|
- f_fileinfo.updater_id,f_fileinfo.update_time,f_fileinfo.deleted,f_fileinfo.deleter_id,f_fileinfo.delete_time
|
|
|
- </sql>
|
|
|
-
|
|
|
- <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
|
|
- select <include refid="baseColumns"/> from f_fileinfo where id=#{id}
|
|
|
- </select>
|
|
|
- <select id="selectByFullPath" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
- select <include refid="baseColumns"/> from f_fileinfo where full_path=#{fullPath}
|
|
|
- </select>
|
|
|
- <select id="selectByFolderId" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
|
|
- select <include refid="baseColumns"/> from f_fileinfo where folder_id=#{folderId} order by id
|
|
|
- </select>
|
|
|
- <select id="selectVisibleByFolderId" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
|
|
- select <include refid="baseColumns"/> from f_fileinfo where folder_id=#{folderId}
|
|
|
- and deleted=false order by id
|
|
|
- </select>
|
|
|
- <select id="selectDeletedByFolderId" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
|
|
- select <include refid="baseColumns"/> from f_fileinfo where folder_id=#{folderId}
|
|
|
- and deleted=true order by id
|
|
|
- </select>
|
|
|
-</mapper>
|