|
@@ -0,0 +1,319 @@
|
|
|
|
+<?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.steerinfo.ftp.uploadfile.mapper.UploadFileMapper">
|
|
|
|
+ <resultMap id="BaseResultMap" type="com.steerinfo.ftp.uploadfile.model.UploadFile">
|
|
|
|
+ <id column="ID" jdbcType="VARCHAR" property="id" />
|
|
|
|
+ <result column="FILE_NAME" jdbcType="VARCHAR" property="fileName" />
|
|
|
|
+ <result column="FILE_URL" jdbcType="VARCHAR" property="fileUrl" />
|
|
|
|
+ <result column="TYPE" jdbcType="VARCHAR" property="type" />
|
|
|
|
+ <result column="UPLOAD_TIME" jdbcType="TIMESTAMP" property="uploadTime" />
|
|
|
|
+ <result column="CREATE_MAN" jdbcType="VARCHAR" property="createMan" />
|
|
|
|
+ <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
|
+ <result column="UPDATE_MAN" jdbcType="VARCHAR" property="updateMan" />
|
|
|
|
+ <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
|
|
|
|
+ </resultMap>
|
|
|
|
+ <sql id="columns">
|
|
|
|
+ ID, FILE_NAME, FILE_URL, TYPE, UPLOAD_TIME, CREATE_MAN, CREATE_TIME, UPDATE_MAN,
|
|
|
|
+ UPDATE_TIME
|
|
|
|
+ </sql>
|
|
|
|
+ <sql id="columns_alias">
|
|
|
|
+ t.ID, t.FILE_NAME, t.FILE_URL, t.TYPE, t.UPLOAD_TIME, t.CREATE_MAN, t.CREATE_TIME,
|
|
|
|
+ t.UPDATE_MAN, t.UPDATE_TIME
|
|
|
|
+ </sql>
|
|
|
|
+ <sql id="select">
|
|
|
|
+ SELECT <include refid="columns"/> FROM UPLOAD_FILE
|
|
|
|
+ </sql>
|
|
|
|
+ <sql id="select_alias">
|
|
|
|
+ SELECT <include refid="columns_alias"/> FROM UPLOAD_FILE t
|
|
|
|
+ </sql>
|
|
|
|
+ <sql id="where">
|
|
|
|
+ <where>
|
|
|
|
+ <if test="id != null and id != ''">
|
|
|
|
+ and ID = #{id}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="fileName != null and fileName != ''">
|
|
|
|
+ and FILE_NAME = #{fileName}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="fileUrl != null and fileUrl != ''">
|
|
|
|
+ and FILE_URL = #{fileUrl}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="type != null and type != ''">
|
|
|
|
+ and TYPE = #{type}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="uploadTime != null">
|
|
|
|
+ and TO_CHAR(UPLOAD_TIME,'yyyy-MM-dd') = #{uploadTime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createMan != null and createMan != ''">
|
|
|
|
+ and CREATE_MAN = #{createMan}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createTime != null">
|
|
|
|
+ and TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = #{createTime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateMan != null and updateMan != ''">
|
|
|
|
+ and UPDATE_MAN = #{updateMan}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateTime != null">
|
|
|
|
+ and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ </sql>
|
|
|
|
+ <sql id="whereLike">
|
|
|
|
+ <where>
|
|
|
|
+ <if test="id != null and id != ''">
|
|
|
|
+ and ID LIKE '%${id}%'
|
|
|
|
+ </if>
|
|
|
|
+ <if test="fileName != null and fileName != ''">
|
|
|
|
+ and FILE_NAME LIKE '%${fileName}%'
|
|
|
|
+ </if>
|
|
|
|
+ <if test="fileUrl != null and fileUrl != ''">
|
|
|
|
+ and FILE_URL LIKE '%${fileUrl}%'
|
|
|
|
+ </if>
|
|
|
|
+ <if test="type != null and type != ''">
|
|
|
|
+ and TYPE LIKE '%${type}%'
|
|
|
|
+ </if>
|
|
|
|
+ <if test="uploadTime != null">
|
|
|
|
+ and TO_CHAR(UPLOAD_TIME,'yyyy-MM-dd') = #{uploadTime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createMan != null and createMan != ''">
|
|
|
|
+ and CREATE_MAN LIKE '%${createMan}%'
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createTime != null">
|
|
|
|
+ and TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = #{createTime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateMan != null and updateMan != ''">
|
|
|
|
+ and UPDATE_MAN LIKE '%${updateMan}%'
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateTime != null">
|
|
|
|
+ and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ </sql>
|
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
|
|
+ delete from UPLOAD_FILE
|
|
|
|
+ where ID = #{id,jdbcType=VARCHAR}
|
|
|
|
+ </delete>
|
|
|
|
+ <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
|
|
|
|
+ delete from UPLOAD_FILE
|
|
|
|
+ where 1!=1
|
|
|
|
+ <if test="fileName != null and fileName != ''">
|
|
|
|
+ or FILE_NAME = #{fileName}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="fileUrl != null and fileUrl != ''">
|
|
|
|
+ or FILE_URL = #{fileUrl}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="type != null and type != ''">
|
|
|
|
+ or TYPE = #{type}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="uploadTime != null">
|
|
|
|
+ or TO_CHAR(UPLOAD_TIME,'yyyy-MM-dd') = '#{uploadTime}'
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createMan != null and createMan != ''">
|
|
|
|
+ or CREATE_MAN = #{createMan}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createTime != null">
|
|
|
|
+ or TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = '#{createTime}'
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateMan != null and updateMan != ''">
|
|
|
|
+ or UPDATE_MAN = #{updateMan}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateTime != null">
|
|
|
|
+ or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
|
|
|
|
+ </if>
|
|
|
|
+ </delete>
|
|
|
|
+ <insert id="insert" parameterType="com.steerinfo.ftp.uploadfile.model.UploadFile">
|
|
|
|
+ insert into UPLOAD_FILE (ID, FILE_NAME, FILE_URL,
|
|
|
|
+ TYPE, UPLOAD_TIME, CREATE_MAN,
|
|
|
|
+ CREATE_TIME, UPDATE_MAN, UPDATE_TIME
|
|
|
|
+ )
|
|
|
|
+ values (#{id,jdbcType=VARCHAR}, #{fileName,jdbcType=VARCHAR}, #{fileUrl,jdbcType=VARCHAR},
|
|
|
|
+ #{type,jdbcType=VARCHAR}, #{uploadTime,jdbcType=TIMESTAMP}, #{createMan,jdbcType=VARCHAR},
|
|
|
|
+ #{createTime,jdbcType=TIMESTAMP}, #{updateMan,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}
|
|
|
|
+ )
|
|
|
|
+ </insert>
|
|
|
|
+ <insert id="insertSelective" parameterType="com.steerinfo.ftp.uploadfile.model.UploadFile">
|
|
|
|
+ insert into UPLOAD_FILE
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="id != null">
|
|
|
|
+ ID,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="fileName != null">
|
|
|
|
+ FILE_NAME,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="fileUrl != null">
|
|
|
|
+ FILE_URL,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="type != null">
|
|
|
|
+ TYPE,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="uploadTime != null">
|
|
|
|
+ UPLOAD_TIME,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createMan != null">
|
|
|
|
+ CREATE_MAN,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createTime != null">
|
|
|
|
+ CREATE_TIME,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateMan != null">
|
|
|
|
+ UPDATE_MAN,
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateTime != null">
|
|
|
|
+ UPDATE_TIME,
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="id != null">
|
|
|
|
+ #{id,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="fileName != null">
|
|
|
|
+ #{fileName,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="fileUrl != null">
|
|
|
|
+ #{fileUrl,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="type != null">
|
|
|
|
+ #{type,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="uploadTime != null">
|
|
|
|
+ #{uploadTime,jdbcType=TIMESTAMP},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createMan != null">
|
|
|
|
+ #{createMan,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createTime != null">
|
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateMan != null">
|
|
|
|
+ #{updateMan,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateTime != null">
|
|
|
|
+ #{updateTime,jdbcType=TIMESTAMP},
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
|
|
+ </insert>
|
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.steerinfo.ftp.uploadfile.model.UploadFile">
|
|
|
|
+ update UPLOAD_FILE
|
|
|
|
+ set FILE_NAME = #{fileName,jdbcType=VARCHAR},
|
|
|
|
+ FILE_URL = #{fileUrl,jdbcType=VARCHAR},
|
|
|
|
+ TYPE = #{type,jdbcType=VARCHAR},
|
|
|
|
+ UPLOAD_TIME = #{uploadTime,jdbcType=TIMESTAMP},
|
|
|
|
+ CREATE_MAN = #{createMan,jdbcType=VARCHAR},
|
|
|
|
+ CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
+ UPDATE_MAN = #{updateMan,jdbcType=VARCHAR},
|
|
|
|
+ UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP}
|
|
|
|
+ where ID = #{id,jdbcType=VARCHAR}
|
|
|
|
+ </update>
|
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ftp.uploadfile.model.UploadFile">
|
|
|
|
+ update UPLOAD_FILE
|
|
|
|
+ <set>
|
|
|
|
+ <if test="fileName != null">
|
|
|
|
+ FILE_NAME = #{fileName,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="fileUrl != null">
|
|
|
|
+ FILE_URL = #{fileUrl,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="type != null">
|
|
|
|
+ TYPE = #{type,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="uploadTime != null">
|
|
|
|
+ UPLOAD_TIME = #{uploadTime,jdbcType=TIMESTAMP},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createMan != null">
|
|
|
|
+ CREATE_MAN = #{createMan,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createTime != null">
|
|
|
|
+ CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateMan != null">
|
|
|
|
+ UPDATE_MAN = #{updateMan,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateTime != null">
|
|
|
|
+ UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
|
+ </if>
|
|
|
|
+ </set>
|
|
|
|
+ where ID = #{id,jdbcType=VARCHAR}
|
|
|
|
+ </update>
|
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
|
+ <include refid="select"/>
|
|
|
|
+ where ID = #{id,jdbcType=VARCHAR}
|
|
|
|
+ </select>
|
|
|
|
+ <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
|
|
|
|
+ <include refid="select"/>
|
|
|
|
+ <include refid="where"/>
|
|
|
|
+ </select>
|
|
|
|
+ <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
|
|
|
|
+ <include refid="select"/>
|
|
|
|
+ <include refid="whereLike"/>
|
|
|
|
+ </select>
|
|
|
|
+ <insert id="batchInsert" parameterType="java.util.List">
|
|
|
|
+ insert into UPLOAD_FILE
|
|
|
|
+ (ID,
|
|
|
|
+ FILE_NAME, FILE_URL, TYPE,
|
|
|
|
+ UPLOAD_TIME, CREATE_MAN, CREATE_TIME,
|
|
|
|
+ UPDATE_MAN, UPDATE_TIME)
|
|
|
|
+ ( <foreach collection="list" item="item" separator="union all">
|
|
|
|
+ select
|
|
|
|
+ #{item.id,jdbcType=VARCHAR},
|
|
|
|
+ #{item.fileName,jdbcType=VARCHAR}, #{item.fileUrl,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR},
|
|
|
|
+ #{item.uploadTime,jdbcType=TIMESTAMP}, #{item.createMan,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
|
|
|
|
+ #{item.updateMan,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP} from dual
|
|
|
|
+ </foreach> )
|
|
|
|
+ </insert>
|
|
|
|
+ <update id="batchUpdate" parameterType="java.util.List">
|
|
|
|
+ update UPLOAD_FILE
|
|
|
|
+ set
|
|
|
|
+ ID=
|
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.id,jdbcType=VARCHAR}
|
|
|
|
+ </foreach>
|
|
|
|
+ ,FILE_NAME=
|
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.fileName,jdbcType=VARCHAR}
|
|
|
|
+ </foreach>
|
|
|
|
+ ,FILE_URL=
|
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.fileUrl,jdbcType=VARCHAR}
|
|
|
|
+ </foreach>
|
|
|
|
+ ,TYPE=
|
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.type,jdbcType=VARCHAR}
|
|
|
|
+ </foreach>
|
|
|
|
+ ,UPLOAD_TIME=
|
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.uploadTime,jdbcType=TIMESTAMP}
|
|
|
|
+ </foreach>
|
|
|
|
+ ,CREATE_MAN=
|
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.createMan,jdbcType=VARCHAR}
|
|
|
|
+ </foreach>
|
|
|
|
+ ,CREATE_TIME=
|
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
|
|
|
|
+ </foreach>
|
|
|
|
+ ,UPDATE_MAN=
|
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.updateMan,jdbcType=VARCHAR}
|
|
|
|
+ </foreach>
|
|
|
|
+ ,UPDATE_TIME=
|
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
|
|
|
|
+ when #{item.id,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
|
|
|
|
+ </foreach>
|
|
|
|
+ where ID in
|
|
|
|
+ <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
|
|
|
|
+ #{item.id,jdbcType=VARCHAR}
|
|
|
|
+ </foreach>
|
|
|
|
+ </update>
|
|
|
|
+ <delete id="batchDelete" parameterType="java.util.List">
|
|
|
|
+ delete from UPLOAD_FILE
|
|
|
|
+ where ID in
|
|
|
|
+ <foreach collection="list" item="id" open="(" close=")" separator=",">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </delete>
|
|
|
|
+ <!-- 友情提示!!!-->
|
|
|
|
+ <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
|
|
|
|
+ <select id="getIdAndName" resultMap="BaseResultMap">
|
|
|
|
+ select distinct ID, FILE_NAME FROM UPLOAD_FILE
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+</mapper>
|