<?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.AlgTrainLogMapper">
    <resultMap id="BaseResultMap" type="io.renren.modules.sys.entity.algs.AlgTrainLog">
        <id column="algorithm_training_log_id" jdbcType="BIGINT" property="algorithmTrainingLogId" />
        <result column="algorithm_training_id" jdbcType="BIGINT" property="algorithmTrainingId" />
        <result column="algorithm_training_log_content" jdbcType="LONGVARCHAR" property="algorithmTrainingLogContent" />
    </resultMap>
    <sql id="Base_Column_List">
      algorithm_training_log_id,algorithm_training_id,algorithm_training_log_content
    </sql>
    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from algorithm_training_log
        where algorithm_training_log_id = #{algorithmTrainingLogId,jdbcType=BIGINT}
    </select>
    <select id="selectByAlgTrainId" parameterType="java.lang.Long" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from algorithm_training_log
        where algorithm_training_id = #{algorithmTrainingId,jdbcType=BIGINT}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
      delete from algorithm_training_log
      where algorithm_training_log_id = #{algorithmTrainingLogId,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="io.renren.modules.sys.entity.algs.AlgTrainLog">
        insert into algorithm_training_log(algorithm_training_log_id,algorithm_training_id,algorithm_training_log_content)
        values (#{algorithmTrainingLogId,jdbcType=BIGINT},#{algorithmTrainingId,jdbcType=BIGINT},#{algorithmTrainingLogContent,jdbcType=LONGVARCHAR})
    </insert>
    <insert id="insertSelective" parameterType="io.renren.modules.sys.entity.algs.AlgTrainLog">
        insert into algorithm_training_log
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="algorithmTrainingLogId != null">
                algorithm_training_log_id,
            </if>
            <if test="algorithmTrainingId != null">
                algorithm_training_id,
            </if>
            <if test="algorithmTrainingLogContent != null">
                algorithm_training_log_content,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="algorithmTrainingLogId != null">
                #{algorithmTrainingLogId,jdbcType=BIGINT},
            </if>
            <if test="algorithmTrainingId != null">
                #{algorithmTrainingId,jdbcType=BIGINT},
            </if>
            <if test="algorithmTrainingLogContent != null">
                #{algorithmTrainingLogContent,jdbcType=LONGVARCHAR},
            </if>
        </trim>
    </insert>
</mapper>