<?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.dataset.DataSetMapper">
  <resultMap id="BaseResultMap" type="io.renren.modules.sys.entity.dataset.DataSet">
    <id column="dataset_id" jdbcType="BIGINT" property="datasetId" />
    <result column="dataset_name" jdbcType="VARCHAR" property="datasetName" />
    <result column="category_id" jdbcType="BIGINT" property="categoryId" />
    <result column="dataset_status" jdbcType="TINYINT" property="datasetStatus" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="uid" jdbcType="BIGINT" property="uid" />
    <result column="dfs_url" jdbcType="VARCHAR" property="dfsUrl" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  </resultMap>
  <sql id="Base_Column_List">
    dataset_id, dataset_name, category_id, dataset_status, remark, uid, dfs_url,
    create_time
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from data_set
    where dataset_id = #{datasetId,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from data_set
    where dataset_id = #{datasetId,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="io.renren.modules.sys.entity.dataset.DataSet">
    insert into data_set (dataset_id, dataset_name, category_id,
      dataset_status, remark, uid,
       dfs_url, create_time)
    values (#{datasetId,jdbcType=BIGINT}, #{datasetName,jdbcType=VARCHAR}, #{categoryId,jdbcType=BIGINT},
      #{datasetStatus,jdbcType=TINYINT}, #{remark,jdbcType=VARCHAR}, #{uid,jdbcType=BIGINT},
      #{dfsUrl,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="io.renren.modules.sys.entity.dataset.DataSet">
    insert into data_set
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="datasetId != null">
        dataset_id,
      </if>
      <if test="datasetName != null">
        dataset_name,
      </if>
      <if test="categoryId != null">
        category_id,
      </if>
      <if test="datasetStatus != null">
        dataset_status,
      </if>
      <if test="remark != null">
        remark,
      </if>
      <if test="uid != null">
        uid,
      </if>
      <if test="dfsUrl != null">
        dfs_url,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="datasetId != null">
        #{datasetId,jdbcType=BIGINT},
      </if>
      <if test="datasetName != null">
        #{datasetName,jdbcType=VARCHAR},
      </if>
      <if test="categoryId != null">
        #{categoryId,jdbcType=BIGINT},
      </if>
      <if test="datasetStatus != null">
        #{datasetStatus,jdbcType=TINYINT},
      </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>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="io.renren.modules.sys.entity.dataset.DataSet">
    update data_set
    <set>
      <if test="datasetName != null">
        dataset_name = #{datasetName,jdbcType=VARCHAR},
      </if>
      <if test="categoryId != null">
        category_id = #{categoryId,jdbcType=BIGINT},
      </if>
      <if test="datasetStatus != null">
        dataset_status = #{datasetStatus,jdbcType=TINYINT},
      </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>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where dataset_id = #{datasetId,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="io.renren.modules.sys.entity.dataset.DataSet">
    update data_set
    set dataset_name = #{datasetName,jdbcType=VARCHAR},
      category_id = #{categoryId,jdbcType=BIGINT},
      dataset_status = #{datasetStatus,jdbcType=TINYINT},
      remark = #{remark,jdbcType=VARCHAR},
      uid = #{uid,jdbcType=BIGINT},
      dfs_url = #{dfsUrl,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
    where dataset_id = #{datasetId,jdbcType=BIGINT}
  </update>
</mapper>