<?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.AlgorithmMapper">
  <resultMap id="BaseResultMap" type="io.renren.modules.sys.entity.algs.Algorithm">
    <id column="algorithm_id" jdbcType="BIGINT" property="algorithmId" />
    <result column="algorithm_name" jdbcType="VARCHAR" property="algorithmName" />
    <result column="category_id" jdbcType="BIGINT" property="categoryId" />
    <result column="number" jdbcType="BIGINT" property="number" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="uid" jdbcType="BIGINT" property="uid" />
    <result column="frame_id" jdbcType="BIGINT" property="frameId" />
    <result column="dfs_url" jdbcType="VARCHAR" property="dfsUrl" />
  </resultMap>
  <sql id="Base_Column_List">
    algorithm_id, algorithm_name, category_id, number, remark, uid, frame_id, dfs_url
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from algorithm
    where algorithm_id = #{algorithmId,jdbcType=BIGINT}
  </select>
  <select id="selectByAlgName" parameterType="java.lang.String" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from algorithm
    where algorithm_name = #{algorithmName,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from algorithm
    where algorithm_id = #{algorithmId,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="io.renren.modules.sys.entity.algs.Algorithm">
    insert into algorithm (algorithm_id, algorithm_name, category_id,
      number, remark, uid,
      frame_id, dfs_url)
    values (#{algorithmId,jdbcType=BIGINT}, #{algorithmName,jdbcType=VARCHAR}, #{categoryId,jdbcType=BIGINT},
      #{number,jdbcType=BIGINT}, #{remark,jdbcType=VARCHAR}, #{uid,jdbcType=BIGINT},
      #{frameId,jdbcType=BIGINT}, #{dfsUrl,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="io.renren.modules.sys.entity.algs.Algorithm">
    insert into algorithm
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="algorithmId != null">
        algorithm_id,
      </if>
      <if test="algorithmName != null">
        algorithm_name,
      </if>
      <if test="categoryId != null">
        category_id,
      </if>
      <if test="number != null">
        number,
      </if>
      <if test="remark != null">
        remark,
      </if>
      <if test="uid != null">
        uid,
      </if>
      <if test="frameId != null">
        frame_id,
      </if>
      <if test="dfsUrl != null">
        dfs_url,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="algorithmId != null">
        #{algorithmId,jdbcType=BIGINT},
      </if>
      <if test="algorithmName != null">
        #{algorithmName,jdbcType=VARCHAR},
      </if>
      <if test="categoryId != null">
        #{categoryId,jdbcType=BIGINT},
      </if>
      <if test="number != null">
        #{number,jdbcType=BIGINT},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="uid != null">
        #{uid,jdbcType=BIGINT},
      </if>
      <if test="frameId != null">
        #{frameId,jdbcType=BIGINT},
      </if>
      <if test="dfsUrl != null">
        #{dfsUrl,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="io.renren.modules.sys.entity.algs.Algorithm">
    update algorithm
    <set>
      <if test="algorithmName != null">
        algorithm_name = #{algorithmName,jdbcType=VARCHAR},
      </if>
      <if test="categoryId != null">
        category_id = #{categoryId,jdbcType=BIGINT},
      </if>
      <if test="number != null">
        number = #{number,jdbcType=BIGINT},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="uid != null">
        uid = #{uid,jdbcType=BIGINT},
      </if>
      <if test="frameId != null">
        frame_id = #{frameId,jdbcType=BIGINT},
      </if>
      <if test="dfsUrl != null">
        dfs_url = #{dfsUrl,jdbcType=VARCHAR},
      </if>
    </set>
    where algorithm_id = #{algorithmId,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="io.renren.modules.sys.entity.algs.Algorithm">
    update algorithm
    set algorithm_name = #{algorithmName,jdbcType=VARCHAR},
      category_id = #{categoryId,jdbcType=BIGINT},
      number = #{number,jdbcType=BIGINT},
      remark = #{remark,jdbcType=VARCHAR},
      uid = #{uid,jdbcType=BIGINT},
      frame_id = #{frameId,jdbcType=BIGINT},
      dfs_url = #{dfsUrl,jdbcType=VARCHAR}
    where algorithm_id = #{algorithmId,jdbcType=BIGINT}
  </update>
</mapper>