<?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.goafanti.common.dao.PersonnelEntryMapper">
  <resultMap id="BaseResultMap" type="com.goafanti.common.model.PersonnelEntry">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Apr 24 11:14:15 CST 2020.
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="school" jdbcType="VARCHAR" property="school" />
    <result column="education" jdbcType="VARCHAR" property="education" />
    <result column="major" jdbcType="VARCHAR" property="major" />
    <result column="title" jdbcType="VARCHAR" property="title" />
    <result column="entry_remarks" jdbcType="VARCHAR" property="entryRemarks" />
    <result column="annex_url" jdbcType="VARCHAR" property="annexUrl" />
    <result column="annex_name" jdbcType="VARCHAR" property="annexName" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Apr 24 11:14:15 CST 2020.
    -->
    <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">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Apr 24 11:14:15 CST 2020.
    -->
    <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">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Apr 24 11:14:15 CST 2020.
    -->
    id, school, education, major, title, entry_remarks, annex_url, annex_name, create_time
  </sql>
  <select id="selectByExample" parameterType="com.goafanti.common.model.PersonnelEntryExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Apr 24 11:14:15 CST 2020.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from personnel_entry
    <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">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Apr 24 11:14:15 CST 2020.
    -->
    select 
    <include refid="Base_Column_List" />
    from personnel_entry
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Apr 24 11:14:15 CST 2020.
    -->
    delete from personnel_entry
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.goafanti.common.model.PersonnelEntryExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Apr 24 11:14:15 CST 2020.
    -->
    delete from personnel_entry
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.goafanti.common.model.PersonnelEntry">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Apr 24 11:14:15 CST 2020.
    -->
    insert into personnel_entry (id, school, education, 
      major, title, entry_remarks, 
      annex_url, annex_name, create_time
      )
    values (#{id,jdbcType=INTEGER}, #{school,jdbcType=VARCHAR}, #{education,jdbcType=VARCHAR}, 
      #{major,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{entryRemarks,jdbcType=VARCHAR}, 
      #{annexUrl,jdbcType=VARCHAR}, #{annexName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.goafanti.common.model.PersonnelEntry">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Apr 24 11:14:15 CST 2020.
    -->
    insert into personnel_entry
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="school != null">
        school,
      </if>
      <if test="education != null">
        education,
      </if>
      <if test="major != null">
        major,
      </if>
      <if test="title != null">
        title,
      </if>
      <if test="entryRemarks != null">
        entry_remarks,
      </if>
      <if test="annexUrl != null">
        annex_url,
      </if>
      <if test="annexName != null">
        annex_name,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="school != null">
        #{school,jdbcType=VARCHAR},
      </if>
      <if test="education != null">
        #{education,jdbcType=VARCHAR},
      </if>
      <if test="major != null">
        #{major,jdbcType=VARCHAR},
      </if>
      <if test="title != null">
        #{title,jdbcType=VARCHAR},
      </if>
      <if test="entryRemarks != null">
        #{entryRemarks,jdbcType=VARCHAR},
      </if>
      <if test="annexUrl != null">
        #{annexUrl,jdbcType=VARCHAR},
      </if>
      <if test="annexName != null">
        #{annexName,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.goafanti.common.model.PersonnelEntryExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Apr 24 11:14:15 CST 2020.
    -->
    select count(*) from personnel_entry
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Apr 24 11:14:15 CST 2020.
    -->
    update personnel_entry
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.school != null">
        school = #{record.school,jdbcType=VARCHAR},
      </if>
      <if test="record.education != null">
        education = #{record.education,jdbcType=VARCHAR},
      </if>
      <if test="record.major != null">
        major = #{record.major,jdbcType=VARCHAR},
      </if>
      <if test="record.title != null">
        title = #{record.title,jdbcType=VARCHAR},
      </if>
      <if test="record.entryRemarks != null">
        entry_remarks = #{record.entryRemarks,jdbcType=VARCHAR},
      </if>
      <if test="record.annexUrl != null">
        annex_url = #{record.annexUrl,jdbcType=VARCHAR},
      </if>
      <if test="record.annexName != null">
        annex_name = #{record.annexName,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Apr 24 11:14:15 CST 2020.
    -->
    update personnel_entry
    set id = #{record.id,jdbcType=INTEGER},
      school = #{record.school,jdbcType=VARCHAR},
      education = #{record.education,jdbcType=VARCHAR},
      major = #{record.major,jdbcType=VARCHAR},
      title = #{record.title,jdbcType=VARCHAR},
      entry_remarks = #{record.entryRemarks,jdbcType=VARCHAR},
      annex_url = #{record.annexUrl,jdbcType=VARCHAR},
      annex_name = #{record.annexName,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PersonnelEntry">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Apr 24 11:14:15 CST 2020.
    -->
    update personnel_entry
    <set>
      <if test="school != null">
        school = #{school,jdbcType=VARCHAR},
      </if>
      <if test="education != null">
        education = #{education,jdbcType=VARCHAR},
      </if>
      <if test="major != null">
        major = #{major,jdbcType=VARCHAR},
      </if>
      <if test="title != null">
        title = #{title,jdbcType=VARCHAR},
      </if>
      <if test="entryRemarks != null">
        entry_remarks = #{entryRemarks,jdbcType=VARCHAR},
      </if>
      <if test="annexUrl != null">
        annex_url = #{annexUrl,jdbcType=VARCHAR},
      </if>
      <if test="annexName != null">
        annex_name = #{annexName,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.PersonnelEntry">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Apr 24 11:14:15 CST 2020.
    -->
    update personnel_entry
    set school = #{school,jdbcType=VARCHAR},
      education = #{education,jdbcType=VARCHAR},
      major = #{major,jdbcType=VARCHAR},
      title = #{title,jdbcType=VARCHAR},
      entry_remarks = #{entryRemarks,jdbcType=VARCHAR},
      annex_url = #{annexUrl,jdbcType=VARCHAR},
      annex_name = #{annexName,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>