<?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.koobietech.eas.mbg.mapper.EasArcTlsStudentsMapper">
  <resultMap id="BaseResultMap" type="com.koobietech.eas.mbg.model.EasArcTlsStudents">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="archive_number" jdbcType="VARCHAR" property="archiveNumber" />
    <result column="student_number" jdbcType="VARCHAR" property="studentNumber" />
    <result column="student_name" jdbcType="VARCHAR" property="studentName" />
    <result column="gender" jdbcType="CHAR" property="gender" />
    <result column="birthdate" jdbcType="DATE" property="birthdate" />
    <result column="address" jdbcType="VARCHAR" property="address" />
    <result column="phone" jdbcType="VARCHAR" property="phone" />
    <result column="email" jdbcType="VARCHAR" property="email" />
    <result column="enrollment_date" jdbcType="DATE" property="enrollmentDate" />
    <result column="graduation_date" jdbcType="DATE" property="graduationDate" />
    <result column="grade" jdbcType="INTEGER" property="grade" />
    <result column="major" jdbcType="VARCHAR" property="major" />
    <result column="minor" jdbcType="VARCHAR" property="minor" />
    <result column="university" jdbcType="VARCHAR" property="university" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
    <result column="admissions_id" jdbcType="INTEGER" property="admissionsId" />
    <result column="manager_id" jdbcType="INTEGER" property="managerId" />
    <result column="create_uid" jdbcType="INTEGER" property="createUid" />
    <result column="student_idnumber" jdbcType="VARCHAR" property="studentIdnumber" />
    <result column="graduation" jdbcType="CHAR" property="graduation" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <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 close=")" collection="criterion.value" item="listItem" open="(" 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="(" prefixOverrides="and" suffix=")">
            <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 close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    id, archive_number, student_number, student_name, gender, birthdate, address, phone, 
    email, enrollment_date, graduation_date, grade, major, minor, university, create_time, 
    modify_time, admissions_id, manager_id, create_uid, student_idnumber, graduation
  </sql>
  <select id="selectByExample" parameterType="com.koobietech.eas.mbg.model.EasArcTlsStudentsExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from eas_arc_tls_students
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from eas_arc_tls_students
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from eas_arc_tls_students
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.koobietech.eas.mbg.model.EasArcTlsStudentsExample">
    delete from eas_arc_tls_students
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.koobietech.eas.mbg.model.EasArcTlsStudents">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into eas_arc_tls_students (archive_number, student_number, student_name, 
      gender, birthdate, address, 
      phone, email, enrollment_date, 
      graduation_date, grade, major, 
      minor, university, create_time, 
      modify_time, admissions_id, manager_id, 
      create_uid, student_idnumber, graduation
      )
    values (#{archiveNumber,jdbcType=VARCHAR}, #{studentNumber,jdbcType=VARCHAR}, #{studentName,jdbcType=VARCHAR}, 
      #{gender,jdbcType=CHAR}, #{birthdate,jdbcType=DATE}, #{address,jdbcType=VARCHAR}, 
      #{phone,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{enrollmentDate,jdbcType=DATE}, 
      #{graduationDate,jdbcType=DATE}, #{grade,jdbcType=INTEGER}, #{major,jdbcType=VARCHAR}, 
      #{minor,jdbcType=VARCHAR}, #{university,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
      #{modifyTime,jdbcType=TIMESTAMP}, #{admissionsId,jdbcType=INTEGER}, #{managerId,jdbcType=INTEGER}, 
      #{createUid,jdbcType=INTEGER}, #{studentIdnumber,jdbcType=VARCHAR}, #{graduation,jdbcType=CHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.koobietech.eas.mbg.model.EasArcTlsStudents">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into eas_arc_tls_students
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="archiveNumber != null">
        archive_number,
      </if>
      <if test="studentNumber != null">
        student_number,
      </if>
      <if test="studentName != null">
        student_name,
      </if>
      <if test="gender != null">
        gender,
      </if>
      <if test="birthdate != null">
        birthdate,
      </if>
      <if test="address != null">
        address,
      </if>
      <if test="phone != null">
        phone,
      </if>
      <if test="email != null">
        email,
      </if>
      <if test="enrollmentDate != null">
        enrollment_date,
      </if>
      <if test="graduationDate != null">
        graduation_date,
      </if>
      <if test="grade != null">
        grade,
      </if>
      <if test="major != null">
        major,
      </if>
      <if test="minor != null">
        minor,
      </if>
      <if test="university != null">
        university,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="modifyTime != null">
        modify_time,
      </if>
      <if test="admissionsId != null">
        admissions_id,
      </if>
      <if test="managerId != null">
        manager_id,
      </if>
      <if test="createUid != null">
        create_uid,
      </if>
      <if test="studentIdnumber != null">
        student_idnumber,
      </if>
      <if test="graduation != null">
        graduation,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="archiveNumber != null">
        #{archiveNumber,jdbcType=VARCHAR},
      </if>
      <if test="studentNumber != null">
        #{studentNumber,jdbcType=VARCHAR},
      </if>
      <if test="studentName != null">
        #{studentName,jdbcType=VARCHAR},
      </if>
      <if test="gender != null">
        #{gender,jdbcType=CHAR},
      </if>
      <if test="birthdate != null">
        #{birthdate,jdbcType=DATE},
      </if>
      <if test="address != null">
        #{address,jdbcType=VARCHAR},
      </if>
      <if test="phone != null">
        #{phone,jdbcType=VARCHAR},
      </if>
      <if test="email != null">
        #{email,jdbcType=VARCHAR},
      </if>
      <if test="enrollmentDate != null">
        #{enrollmentDate,jdbcType=DATE},
      </if>
      <if test="graduationDate != null">
        #{graduationDate,jdbcType=DATE},
      </if>
      <if test="grade != null">
        #{grade,jdbcType=INTEGER},
      </if>
      <if test="major != null">
        #{major,jdbcType=VARCHAR},
      </if>
      <if test="minor != null">
        #{minor,jdbcType=VARCHAR},
      </if>
      <if test="university != null">
        #{university,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="modifyTime != null">
        #{modifyTime,jdbcType=TIMESTAMP},
      </if>
      <if test="admissionsId != null">
        #{admissionsId,jdbcType=INTEGER},
      </if>
      <if test="managerId != null">
        #{managerId,jdbcType=INTEGER},
      </if>
      <if test="createUid != null">
        #{createUid,jdbcType=INTEGER},
      </if>
      <if test="studentIdnumber != null">
        #{studentIdnumber,jdbcType=VARCHAR},
      </if>
      <if test="graduation != null">
        #{graduation,jdbcType=CHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.koobietech.eas.mbg.model.EasArcTlsStudentsExample" resultType="java.lang.Long">
    select count(*) from eas_arc_tls_students
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update eas_arc_tls_students
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.archiveNumber != null">
        archive_number = #{record.archiveNumber,jdbcType=VARCHAR},
      </if>
      <if test="record.studentNumber != null">
        student_number = #{record.studentNumber,jdbcType=VARCHAR},
      </if>
      <if test="record.studentName != null">
        student_name = #{record.studentName,jdbcType=VARCHAR},
      </if>
      <if test="record.gender != null">
        gender = #{record.gender,jdbcType=CHAR},
      </if>
      <if test="record.birthdate != null">
        birthdate = #{record.birthdate,jdbcType=DATE},
      </if>
      <if test="record.address != null">
        address = #{record.address,jdbcType=VARCHAR},
      </if>
      <if test="record.phone != null">
        phone = #{record.phone,jdbcType=VARCHAR},
      </if>
      <if test="record.email != null">
        email = #{record.email,jdbcType=VARCHAR},
      </if>
      <if test="record.enrollmentDate != null">
        enrollment_date = #{record.enrollmentDate,jdbcType=DATE},
      </if>
      <if test="record.graduationDate != null">
        graduation_date = #{record.graduationDate,jdbcType=DATE},
      </if>
      <if test="record.grade != null">
        grade = #{record.grade,jdbcType=INTEGER},
      </if>
      <if test="record.major != null">
        major = #{record.major,jdbcType=VARCHAR},
      </if>
      <if test="record.minor != null">
        minor = #{record.minor,jdbcType=VARCHAR},
      </if>
      <if test="record.university != null">
        university = #{record.university,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.modifyTime != null">
        modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.admissionsId != null">
        admissions_id = #{record.admissionsId,jdbcType=INTEGER},
      </if>
      <if test="record.managerId != null">
        manager_id = #{record.managerId,jdbcType=INTEGER},
      </if>
      <if test="record.createUid != null">
        create_uid = #{record.createUid,jdbcType=INTEGER},
      </if>
      <if test="record.studentIdnumber != null">
        student_idnumber = #{record.studentIdnumber,jdbcType=VARCHAR},
      </if>
      <if test="record.graduation != null">
        graduation = #{record.graduation,jdbcType=CHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update eas_arc_tls_students
    set id = #{record.id,jdbcType=INTEGER},
      archive_number = #{record.archiveNumber,jdbcType=VARCHAR},
      student_number = #{record.studentNumber,jdbcType=VARCHAR},
      student_name = #{record.studentName,jdbcType=VARCHAR},
      gender = #{record.gender,jdbcType=CHAR},
      birthdate = #{record.birthdate,jdbcType=DATE},
      address = #{record.address,jdbcType=VARCHAR},
      phone = #{record.phone,jdbcType=VARCHAR},
      email = #{record.email,jdbcType=VARCHAR},
      enrollment_date = #{record.enrollmentDate,jdbcType=DATE},
      graduation_date = #{record.graduationDate,jdbcType=DATE},
      grade = #{record.grade,jdbcType=INTEGER},
      major = #{record.major,jdbcType=VARCHAR},
      minor = #{record.minor,jdbcType=VARCHAR},
      university = #{record.university,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
      admissions_id = #{record.admissionsId,jdbcType=INTEGER},
      manager_id = #{record.managerId,jdbcType=INTEGER},
      create_uid = #{record.createUid,jdbcType=INTEGER},
      student_idnumber = #{record.studentIdnumber,jdbcType=VARCHAR},
      graduation = #{record.graduation,jdbcType=CHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.koobietech.eas.mbg.model.EasArcTlsStudents">
    update eas_arc_tls_students
    <set>
      <if test="archiveNumber != null">
        archive_number = #{archiveNumber,jdbcType=VARCHAR},
      </if>
      <if test="studentNumber != null">
        student_number = #{studentNumber,jdbcType=VARCHAR},
      </if>
      <if test="studentName != null">
        student_name = #{studentName,jdbcType=VARCHAR},
      </if>
      <if test="gender != null">
        gender = #{gender,jdbcType=CHAR},
      </if>
      <if test="birthdate != null">
        birthdate = #{birthdate,jdbcType=DATE},
      </if>
      <if test="address != null">
        address = #{address,jdbcType=VARCHAR},
      </if>
      <if test="phone != null">
        phone = #{phone,jdbcType=VARCHAR},
      </if>
      <if test="email != null">
        email = #{email,jdbcType=VARCHAR},
      </if>
      <if test="enrollmentDate != null">
        enrollment_date = #{enrollmentDate,jdbcType=DATE},
      </if>
      <if test="graduationDate != null">
        graduation_date = #{graduationDate,jdbcType=DATE},
      </if>
      <if test="grade != null">
        grade = #{grade,jdbcType=INTEGER},
      </if>
      <if test="major != null">
        major = #{major,jdbcType=VARCHAR},
      </if>
      <if test="minor != null">
        minor = #{minor,jdbcType=VARCHAR},
      </if>
      <if test="university != null">
        university = #{university,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="modifyTime != null">
        modify_time = #{modifyTime,jdbcType=TIMESTAMP},
      </if>
      <if test="admissionsId != null">
        admissions_id = #{admissionsId,jdbcType=INTEGER},
      </if>
      <if test="managerId != null">
        manager_id = #{managerId,jdbcType=INTEGER},
      </if>
      <if test="createUid != null">
        create_uid = #{createUid,jdbcType=INTEGER},
      </if>
      <if test="studentIdnumber != null">
        student_idnumber = #{studentIdnumber,jdbcType=VARCHAR},
      </if>
      <if test="graduation != null">
        graduation = #{graduation,jdbcType=CHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.koobietech.eas.mbg.model.EasArcTlsStudents">
    update eas_arc_tls_students
    set archive_number = #{archiveNumber,jdbcType=VARCHAR},
      student_number = #{studentNumber,jdbcType=VARCHAR},
      student_name = #{studentName,jdbcType=VARCHAR},
      gender = #{gender,jdbcType=CHAR},
      birthdate = #{birthdate,jdbcType=DATE},
      address = #{address,jdbcType=VARCHAR},
      phone = #{phone,jdbcType=VARCHAR},
      email = #{email,jdbcType=VARCHAR},
      enrollment_date = #{enrollmentDate,jdbcType=DATE},
      graduation_date = #{graduationDate,jdbcType=DATE},
      grade = #{grade,jdbcType=INTEGER},
      major = #{major,jdbcType=VARCHAR},
      minor = #{minor,jdbcType=VARCHAR},
      university = #{university,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      modify_time = #{modifyTime,jdbcType=TIMESTAMP},
      admissions_id = #{admissionsId,jdbcType=INTEGER},
      manager_id = #{managerId,jdbcType=INTEGER},
      create_uid = #{createUid,jdbcType=INTEGER},
      student_idnumber = #{studentIdnumber,jdbcType=VARCHAR},
      graduation = #{graduation,jdbcType=CHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>