<?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.mwt.oes.dao.StudentPaperScoreMapper" >
  <resultMap id="BaseResultMap" type="com.mwt.oes.domain.StudentPaperScore" >
    <id column="score_id" property="scoreId" jdbcType="INTEGER" />
    <result column="score" property="score" jdbcType="INTEGER" />
    <result column="time_used" property="timeUsed" jdbcType="INTEGER" />
    <result column="start_time" property="startTime" jdbcType="TIMESTAMP" />
    <result column="end_time" property="endTime" jdbcType="TIMESTAMP" />
    <result column="sno" property="sno" jdbcType="CHAR" />
    <result column="paper_id" property="paperId" jdbcType="INTEGER" />
  </resultMap>
  <sql id="Example_Where_Clause" >
    <where >
      <foreach collection="oredCriteria" item="criteria" separator="or" >
        <if test="criteria.valid" >
          <trim prefix="(" suffix=")" prefixOverrides="and" >
            <foreach collection="criteria.criteria" item="criterion" >
              <choose >
                <when test="criterion.noValue" >
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue" >
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue" >
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue" >
                  and ${criterion.condition}
                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause" >
    <where >
      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
        <if test="criteria.valid" >
          <trim prefix="(" suffix=")" prefixOverrides="and" >
            <foreach collection="criteria.criteria" item="criterion" >
              <choose >
                <when test="criterion.noValue" >
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue" >
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue" >
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue" >
                  and ${criterion.condition}
                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List" >
    score_id, score, time_used, start_time, end_time, sno, paper_id
  </sql>
  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.mwt.oes.domain.StudentPaperScoreExample" >
    select
    <if test="distinct" >
      distinct
    </if>
    <include refid="Base_Column_List" />
    from student_paper_score
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null" >
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    from student_paper_score
    where score_id = #{scoreId,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from student_paper_score
    where score_id = #{scoreId,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.mwt.oes.domain.StudentPaperScoreExample" >
    delete from student_paper_score
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.mwt.oes.domain.StudentPaperScore" >
    insert into student_paper_score (score_id, score, time_used, 
      start_time, end_time, sno, 
      paper_id)
    values (#{scoreId,jdbcType=INTEGER}, #{score,jdbcType=INTEGER}, #{timeUsed,jdbcType=INTEGER}, 
      #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{sno,jdbcType=CHAR}, 
      #{paperId,jdbcType=INTEGER})
  </insert>
  <insert id="insertSelective" parameterType="com.mwt.oes.domain.StudentPaperScore" >
    insert into student_paper_score
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="scoreId != null" >
        score_id,
      </if>
      <if test="score != null" >
        score,
      </if>
      <if test="timeUsed != null" >
        time_used,
      </if>
      <if test="startTime != null" >
        start_time,
      </if>
      <if test="endTime != null" >
        end_time,
      </if>
      <if test="sno != null" >
        sno,
      </if>
      <if test="paperId != null" >
        paper_id,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="scoreId != null" >
        #{scoreId,jdbcType=INTEGER},
      </if>
      <if test="score != null" >
        #{score,jdbcType=INTEGER},
      </if>
      <if test="timeUsed != null" >
        #{timeUsed,jdbcType=INTEGER},
      </if>
      <if test="startTime != null" >
        #{startTime,jdbcType=TIMESTAMP},
      </if>
      <if test="endTime != null" >
        #{endTime,jdbcType=TIMESTAMP},
      </if>
      <if test="sno != null" >
        #{sno,jdbcType=CHAR},
      </if>
      <if test="paperId != null" >
        #{paperId,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.mwt.oes.domain.StudentPaperScoreExample" resultType="java.lang.Integer" >
    select count(*) from student_paper_score
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map" >
    update student_paper_score
    <set >
      <if test="record.scoreId != null" >
        score_id = #{record.scoreId,jdbcType=INTEGER},
      </if>
      <if test="record.score != null" >
        score = #{record.score,jdbcType=INTEGER},
      </if>
      <if test="record.timeUsed != null" >
        time_used = #{record.timeUsed,jdbcType=INTEGER},
      </if>
      <if test="record.startTime != null" >
        start_time = #{record.startTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.endTime != null" >
        end_time = #{record.endTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.sno != null" >
        sno = #{record.sno,jdbcType=CHAR},
      </if>
      <if test="record.paperId != null" >
        paper_id = #{record.paperId,jdbcType=INTEGER},
      </if>
    </set>
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map" >
    update student_paper_score
    set score_id = #{record.scoreId,jdbcType=INTEGER},
      score = #{record.score,jdbcType=INTEGER},
      time_used = #{record.timeUsed,jdbcType=INTEGER},
      start_time = #{record.startTime,jdbcType=TIMESTAMP},
      end_time = #{record.endTime,jdbcType=TIMESTAMP},
      sno = #{record.sno,jdbcType=CHAR},
      paper_id = #{record.paperId,jdbcType=INTEGER}
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.mwt.oes.domain.StudentPaperScore" >
    update student_paper_score
    <set >
      <if test="score != null" >
        score = #{score,jdbcType=INTEGER},
      </if>
      <if test="timeUsed != null" >
        time_used = #{timeUsed,jdbcType=INTEGER},
      </if>
      <if test="startTime != null" >
        start_time = #{startTime,jdbcType=TIMESTAMP},
      </if>
      <if test="endTime != null" >
        end_time = #{endTime,jdbcType=TIMESTAMP},
      </if>
      <if test="sno != null" >
        sno = #{sno,jdbcType=CHAR},
      </if>
      <if test="paperId != null" >
        paper_id = #{paperId,jdbcType=INTEGER},
      </if>
    </set>
    where score_id = #{scoreId,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.mwt.oes.domain.StudentPaperScore" >
    update student_paper_score
    set score = #{score,jdbcType=INTEGER},
      time_used = #{timeUsed,jdbcType=INTEGER},
      start_time = #{startTime,jdbcType=TIMESTAMP},
      end_time = #{endTime,jdbcType=TIMESTAMP},
      sno = #{sno,jdbcType=CHAR},
      paper_id = #{paperId,jdbcType=INTEGER}
    where score_id = #{scoreId,jdbcType=INTEGER}
  </update>
</mapper>