<?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.community.huiju.dao.TpActivitySignInMapper">
  <resultMap id="BaseResultMap" type="com.community.huiju.model.TpActivitySignIn">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="community_id" jdbcType="INTEGER" property="communityId" />
    <result column="activity_id" jdbcType="INTEGER" property="activityId" />
    <result column="user_name" jdbcType="VARCHAR" property="userName" />
    <result column="user_role" jdbcType="VARCHAR" property="userRole" />
    <result column="building_info" jdbcType="VARCHAR" property="buildingInfo" />
    <result column="ta_user_id" jdbcType="INTEGER" property="taUserId" />
    <result column="user_tel" jdbcType="VARCHAR" property="userTel" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  </resultMap>
  <sql id="Base_Column_List">
    id, community_id, activity_id, user_name, user_role, building_info, ta_user_id, user_tel, 
    create_date
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tp_activity_sign_in
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tp_activity_sign_in
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.community.huiju.model.TpActivitySignIn">
    insert into tp_activity_sign_in (id, community_id, activity_id, 
      user_name, user_role, building_info, 
      ta_user_id, user_tel, create_date
      )
    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{activityId,jdbcType=INTEGER}, 
      #{userName,jdbcType=VARCHAR}, #{userRole,jdbcType=VARCHAR}, #{buildingInfo,jdbcType=VARCHAR}, 
      #{taUserId,jdbcType=INTEGER}, #{userTel,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.community.huiju.model.TpActivitySignIn">
    insert into tp_activity_sign_in
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="communityId != null">
        community_id,
      </if>
      <if test="activityId != null">
        activity_id,
      </if>
      <if test="userName != null">
        user_name,
      </if>
      <if test="userRole != null">
        user_role,
      </if>
      <if test="buildingInfo != null">
        building_info,
      </if>
      <if test="taUserId != null">
        ta_user_id,
      </if>
      <if test="userTel != null">
        user_tel,
      </if>
      <if test="createDate != null">
        create_date,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="communityId != null">
        #{communityId,jdbcType=INTEGER},
      </if>
      <if test="activityId != null">
        #{activityId,jdbcType=INTEGER},
      </if>
      <if test="userName != null">
        #{userName,jdbcType=VARCHAR},
      </if>
      <if test="userRole != null">
        #{userRole,jdbcType=VARCHAR},
      </if>
      <if test="buildingInfo != null">
        #{buildingInfo,jdbcType=VARCHAR},
      </if>
      <if test="taUserId != null">
        #{taUserId,jdbcType=INTEGER},
      </if>
      <if test="userTel != null">
        #{userTel,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        #{createDate,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpActivitySignIn">
    update tp_activity_sign_in
    <set>
      <if test="communityId != null">
        community_id = #{communityId,jdbcType=INTEGER},
      </if>
      <if test="activityId != null">
        activity_id = #{activityId,jdbcType=INTEGER},
      </if>
      <if test="userName != null">
        user_name = #{userName,jdbcType=VARCHAR},
      </if>
      <if test="userRole != null">
        user_role = #{userRole,jdbcType=VARCHAR},
      </if>
      <if test="buildingInfo != null">
        building_info = #{buildingInfo,jdbcType=VARCHAR},
      </if>
      <if test="taUserId != null">
        ta_user_id = #{taUserId,jdbcType=INTEGER},
      </if>
      <if test="userTel != null">
        user_tel = #{userTel,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        create_date = #{createDate,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpActivitySignIn">
    update tp_activity_sign_in
    set community_id = #{communityId,jdbcType=INTEGER},
      activity_id = #{activityId,jdbcType=INTEGER},
      user_name = #{userName,jdbcType=VARCHAR},
      user_role = #{userRole,jdbcType=VARCHAR},
      building_info = #{buildingInfo,jdbcType=VARCHAR},
      ta_user_id = #{taUserId,jdbcType=INTEGER},
      user_tel = #{userTel,jdbcType=VARCHAR},
      create_date = #{createDate,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>