Newer
Older
huludao / src / main / resources / mapper / TaskFileMapper.xml
<?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.newfiber.api.pc.dao.TaskFileMapper">
  <resultMap id="BaseResultMap" type="com.newfiber.api.pc.model.entity.TaskFile">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="process_id" jdbcType="BIGINT" property="processId" />
    <result column="file_path" jdbcType="VARCHAR" property="filePath" />
    <result column="file_name" jdbcType="VARCHAR" property="fileName" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  </resultMap>
  <sql id="Base_Column_List">
    id, process_id, file_path, file_name, create_time
  </sql>

  <insert id="batchInsert">
    insert into task_file(process_id,file_path,file_name)
    values
    <foreach collection="taskFiles" item="item" index="index" separator=",">
      (#{item.processId},#{item.filePath},#{item.fileName})
    </foreach>
  </insert>

  <insert id="insertSelective" parameterType="com.newfiber.api.pc.model.entity.TaskFile">
    insert into task_file
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="processId != null">
        process_id,
      </if>
      <if test="filePath != null">
        file_path,
      </if>
      <if test="fileName != null">
        file_name,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="processId != null">
        #{processId,jdbcType=BIGINT},
      </if>
      <if test="filePath != null">
        #{filePath,jdbcType=VARCHAR},
      </if>
      <if test="fileName != null">
        #{fileName,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>

</mapper>