<?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="io.renren.modules.sys.dao.algs.VersionMapper">
  <resultMap id="BaseResultMap" type="io.renren.modules.sys.entity.algs.Version">
    <id column="version_id" jdbcType="BIGINT" property="versionId" />
    <result column="algorithm_id" jdbcType="BIGINT" property="algorithmId" />
    <result column="version_status" jdbcType="TINYINT" property="versionStatus" />
    <result column="creation_time" jdbcType="TIMESTAMP" property="creationTime" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="dfs_url" jdbcType="VARCHAR" property="dfsUrl" />
    <result column="output_url" jdbcType="VARCHAR" property="outputUrl" />
    <result column="fatherversion_id" jdbcType="BIGINT" property="fatherversionId" />
    <result column="version_name" jdbcType="VARCHAR" property="versionName" />
    <result column="delete_status" jdbcType="TINYINT" property="deleteStatus" />
  </resultMap>
  <sql id="Base_Column_List">
    version_id, algorithm_id, version_status, creation_time, remark, dfs_url, output_url,
    fatherversion_id, version_name, delete_status
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from version
    where version_id = #{versionId,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from version
    where version_id = #{versionId,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="io.renren.modules.sys.entity.algs.Version">
    insert into version (version_id, algorithm_id, version_status,
      creation_time, remark, dfs_url,
      output_url, fatherversion_id, version_name,
      delete_status)
    values (#{versionId,jdbcType=BIGINT}, #{algorithmId,jdbcType=BIGINT}, #{versionStatus,jdbcType=TINYINT},
      #{creationTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{dfsUrl,jdbcType=VARCHAR},
      #{outputUrl,jdbcType=VARCHAR}, #{fatherversionId,jdbcType=BIGINT}, #{versionName,jdbcType=VARCHAR},
      #{deleteStatus,jdbcType=TINYINT})
  </insert>
  <insert id="insertSelective" parameterType="io.renren.modules.sys.entity.algs.Version">
    insert into version
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="versionId != null">
        version_id,
      </if>
      <if test="algorithmId != null">
        algorithm_id,
      </if>
      <if test="versionStatus != null">
        version_status,
      </if>
      <if test="creationTime != null">
        creation_time,
      </if>
      <if test="remark != null">
        remark,
      </if>
      <if test="dfsUrl != null">
        dfs_url,
      </if>
      <if test="outputUrl != null">
        output_url,
      </if>
      <if test="fatherversionId != null">
        fatherversion_id,
      </if>
      <if test="versionName != null">
        version_name,
      </if>
      <if test="deleteStatus != null">
        delete_status,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="versionId != null">
        #{versionId,jdbcType=BIGINT},
      </if>
      <if test="algorithmId != null">
        #{algorithmId,jdbcType=BIGINT},
      </if>
      <if test="versionStatus != null">
        #{versionStatus,jdbcType=TINYINT},
      </if>
      <if test="creationTime != null">
        #{creationTime,jdbcType=TIMESTAMP},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="dfsUrl != null">
        #{dfsUrl,jdbcType=VARCHAR},
      </if>
      <if test="outputUrl != null">
        #{outputUrl,jdbcType=VARCHAR},
      </if>
      <if test="fatherversionId != null">
        #{fatherversionId,jdbcType=BIGINT},
      </if>
      <if test="versionName != null">
        #{versionName,jdbcType=VARCHAR},
      </if>
      <if test="deleteStatus != null">
        #{deleteStatus,jdbcType=TINYINT},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="io.renren.modules.sys.entity.algs.Version">
    update version
    <set>
      <if test="algorithmId != null">
        algorithm_id = #{algorithmId,jdbcType=BIGINT},
      </if>
      <if test="versionStatus != null">
        version_status = #{versionStatus,jdbcType=TINYINT},
      </if>
      <if test="creationTime != null">
        creation_time = #{creationTime,jdbcType=TIMESTAMP},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="dfsUrl != null">
        dfs_url = #{dfsUrl,jdbcType=VARCHAR},
      </if>
      <if test="outputUrl != null">
        output_url = #{outputUrl,jdbcType=VARCHAR},
      </if>
      <if test="fatherversionId != null">
        fatherversion_id = #{fatherversionId,jdbcType=BIGINT},
      </if>
      <if test="versionName != null">
        version_name = #{versionName,jdbcType=VARCHAR},
      </if>
      <if test="deleteStatus != null">
        delete_status = #{deleteStatus,jdbcType=TINYINT},
      </if>
    </set>
    where version_id = #{versionId,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="io.renren.modules.sys.entity.algs.Version">
    update version
    set algorithm_id = #{algorithmId,jdbcType=BIGINT},
      version_status = #{versionStatus,jdbcType=TINYINT},
      creation_time = #{creationTime,jdbcType=TIMESTAMP},
      remark = #{remark,jdbcType=VARCHAR},
      dfs_url = #{dfsUrl,jdbcType=VARCHAR},
      output_url = #{outputUrl,jdbcType=VARCHAR},
      fatherversion_id = #{fatherversionId,jdbcType=BIGINT},
      version_name = #{versionName,jdbcType=VARCHAR},
      delete_status = #{deleteStatus,jdbcType=TINYINT}
    where version_id = #{versionId,jdbcType=BIGINT}
  </update>
</mapper>