<?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.AlgorithmTemplateMapper">
  <resultMap id="BaseResultMap" type="io.renren.modules.sys.entity.algs.AlgorithmTemplate">
    <id column="tmp_id" jdbcType="INTEGER" property="tmpId" />
    <result column="tmp_name" jdbcType="VARCHAR" property="tmpName" />
    <result column="category_id" jdbcType="BIGINT" property="categoryId" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="uid" jdbcType="BIGINT" property="uid" />
    <result column="dfs_url" jdbcType="VARCHAR" property="dfsUrl" />
  </resultMap>
  <sql id="Base_Column_List">
    tmp_id, tmp_name, category_id, remark, uid, dfs_url
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from algorithm_template
    where tmp_id = #{tmpId,jdbcType=INTEGER}
  </select>
  <select id="selectByTmpName" parameterType="java.lang.String" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from algorithm_template
    where tmp_name = #{tmpName,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from algorithm_template
    where tmp_id = #{tmpId,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="io.renren.modules.sys.entity.algs.AlgorithmTemplate">
    insert into algorithm_template (tmp_id, tmp_name, category_id,
      remark, uid, dfs_url)
    values (#{tmpId,jdbcType=INTEGER}, #{tmpName,jdbcType=VARCHAR}, #{categoryId,jdbcType=VARCHAR},
      #{remark,jdbcType=VARCHAR}, #{uid,jdbcType=BIGINT}, #{dfsUrl,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="io.renren.modules.sys.entity.algs.AlgorithmTemplate">
    insert into algorithm_template
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="tmpId != null">
        tmp_id,
      </if>
      <if test="tmpName != null">
        tmp_name,
      </if>
      <if test="categoryId != null">
        category_id,
      </if>
      <if test="remark != null">
        remark,
      </if>
      <if test="uid != null">
        uid,
      </if>
      <if test="dfsUrl != null">
        dfs_url,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="tmpId != null">
        #{tmpId,jdbcType=INTEGER},
      </if>
      <if test="tmpName != null">
        #{tmpName,jdbcType=VARCHAR},
      </if>
      <if test="categoryId != null">
        #{category_id,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="uid != null">
        #{uid,jdbcType=BIGINT},
      </if>
      <if test="dfsUrl != null">
        #{dfsUrl,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="io.renren.modules.sys.entity.algs.AlgorithmTemplate">
    update algorithm_template
    <set>
      <if test="tmpName != null">
        tmp_name = #{tmpName,jdbcType=VARCHAR},
      </if>
      <if test="categoryId != null">
        category_id = #{categoryId,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="uid != null">
        uid = #{uid,jdbcType=BIGINT},
      </if>
      <if test="dfsUrl != null">
        dfs_url = #{dfsUrl,jdbcType=VARCHAR},
      </if>
    </set>
    where tmp_id = #{tmpId,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="io.renren.modules.sys.entity.algs.AlgorithmTemplate">
    update algorithm_template
    set tmp_name = #{tmpName,jdbcType=VARCHAR},
      category_id = #{categoryId,jdbcType=VARCHAR},
      remark = #{remark,jdbcType=VARCHAR},
      uid = #{uid,jdbcType=BIGINT},
      dfs_url = #{dfsUrl,jdbcType=VARCHAR}
    where tmp_id = #{tmpId,jdbcType=INTEGER}
  </update>
</mapper>