<?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="com.pcloud.book.applet.mapper.AppletFootstepRecordMapper">
  <resultMap id="BaseResultMap" type="com.pcloud.book.applet.entity.AppletFootstepRecord">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="record_types" jdbcType="VARCHAR" property="recordTypes" />
    <result column="type_name" jdbcType="VARCHAR" property="typeName" />
    <result column="wechat_user_id" jdbcType="BIGINT" property="wechatUserId" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="from_type" jdbcType="INTEGER" property="fromType" />
  </resultMap>
  <sql id="Base_Column_List">
    id, record_types, type_name, wechat_user_id, create_time, from_type
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from applet_footstep_record
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from applet_footstep_record
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.pcloud.book.applet.entity.AppletFootstepRecord">
    insert into applet_footstep_record (id, record_types, type_name,
      wechat_user_id, create_time, from_type
      )
    values (#{id,jdbcType=BIGINT}, #{recordTypes,jdbcType=VARCHAR}, #{typeName,jdbcType=VARCHAR},
      #{wechatUserId,jdbcType=BIGINT}, NOW(), #{fromType,jdbcType=INTEGER}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.pcloud.book.applet.entity.AppletFootstepRecord">
    insert into applet_footstep_record
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="recordTypes != null">
        record_types,
      </if>
      <if test="typeName != null">
        type_name,
      </if>
      <if test="wechatUserId != null">
        wechat_user_id,
      </if>
        create_time,
      <if test="fromType != null">
        from_type,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="recordTypes != null">
        #{recordTypes,jdbcType=VARCHAR},
      </if>
      <if test="typeName != null">
        #{typeName,jdbcType=VARCHAR},
      </if>
      <if test="wechatUserId != null">
        #{wechatUserId,jdbcType=BIGINT},
      </if>
      NOW(),
      <if test="fromType != null">
        #{fromType,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.pcloud.book.applet.entity.AppletFootstepRecord">
    update applet_footstep_record
    <set>
      <if test="recordTypes != null">
        record_types = #{recordTypes,jdbcType=VARCHAR},
      </if>
      <if test="typeName != null">
        type_name = #{typeName,jdbcType=VARCHAR},
      </if>
      <if test="wechatUserId != null">
        wechat_user_id = #{wechatUserId,jdbcType=BIGINT},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="fromType != null">
        from_type = #{fromType,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.pcloud.book.applet.entity.AppletFootstepRecord">
    update applet_footstep_record
    set record_types = #{recordTypes,jdbcType=VARCHAR},
      type_name = #{typeName,jdbcType=VARCHAR},
      wechat_user_id = #{wechatUserId,jdbcType=BIGINT},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      from_type = #{fromType,jdbcType=INTEGER}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>