<?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.cku.dao.CkuMatchProjectMapper" >
  <resultMap id="BaseResultMap" type="com.cku.model.CkuMatchProject" >
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="protect_name" property="protectName" jdbcType="VARCHAR" />
    <result column="match_id" property="matchId" jdbcType="INTEGER" />
    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, protect_name, match_id, create_time
  </sql>
  <!-- 根据赛事id获取赛事项目 zhuoHeng-->
	<select id="getEventProject" resultMap="BaseResultMap" parameterType="java.lang.Long">
			select 
	    <include refid="Base_Column_List" />
	    	from cku_match_project
	    	where match_id = #{id,jdbcType=INTEGER}
	</select>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    from cku_match_project
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from cku_match_project
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.cku.model.CkuMatchProject" >
    insert into cku_match_project (id, protect_name, match_id, 
      create_time)
    values (#{id,jdbcType=INTEGER}, #{protectName,jdbcType=VARCHAR}, #{matchId,jdbcType=INTEGER}, 
      #{createTime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.cku.model.CkuMatchProject" >
    insert into cku_match_project
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="protectName != null" >
        protect_name,
      </if>
      <if test="matchId != null" >
        match_id,
      </if>
      <if test="createTime != null" >
        create_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=INTEGER},
      </if>
      <if test="protectName != null" >
        #{protectName,jdbcType=VARCHAR},
      </if>
      <if test="matchId != null" >
        #{matchId,jdbcType=INTEGER},
      </if>
      <if test="createTime != null" >
        #{createTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.cku.model.CkuMatchProject" >
    update cku_match_project
    <set >
      <if test="protectName != null" >
        protect_name = #{protectName,jdbcType=VARCHAR},
      </if>
      <if test="matchId != null" >
        match_id = #{matchId,jdbcType=INTEGER},
      </if>
      <if test="createTime != null" >
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.cku.model.CkuMatchProject" >
    update cku_match_project
    set protect_name = #{protectName,jdbcType=VARCHAR},
      match_id = #{matchId,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>