mybaits mapper.xml的写法

用习惯了mybaits generator,好久不写mybaits,发现都不会写了,这里先放下些例子,以供以后用的时候参考
项目示例下载地址:
https://gitee.com/paincupid/simple-springmvc

mybaits config example

package com.paincupid.springmvc.persistence;

import com.paincupid.springmvc.domain.Student;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface StudentVoMapper {

    int insertStudentByVoMapper(Student student);

    List<Student> listStudentByClassNoAndSex(@Param("classNo") Integer classNo, @Param("sex") Boolean sex);

    Student getStudentById(Long id);

    int updateStudentNameById(@Param("id") Long id, @Param("name") String name);

    /**
     * If there is only 1 param, you do NOT need use @Param annotation
     * @param id
     * @return
     */
    int deleteStudentById(Long id);

    int updateStudent2ColumnVal(@Param("iq") Integer iq, @Param("cultivateHobby") String cultivateHobby);
}
<?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">
<!-- Important: StudentVoMapper's name must be the same as the Java file!!!!!!!!!   -->
<mapper namespace="com.paincupid.springmvc.persistence.StudentVoMapper">
    <resultMap id="BaseResultMap" type="com.paincupid.springmvc.domain.Student">
        <id column="id" jdbcType="BIGINT" property="id"/>
        <result column="name" jdbcType="VARCHAR" property="name"/>
        <result column="height" jdbcType="DOUBLE" property="height"/>
        <result column="class_no" jdbcType="INTEGER" property="classNo"/>
        <result column="sex" jdbcType="BIT" property="sex"/>
        <result column="iq" jdbcType="INTEGER" property="iq"/>
        <result column="focus" jdbcType="BIT" property="focus"/>
        <result column="cultivate_hobby" jdbcType="VARCHAR" property="cultivateHobby"/>
        <result column="phone" jdbcType="INTEGER" property="phone"/>
        <result column="address" jdbcType="VARCHAR" property="address"/>
        <result column="is_delete" jdbcType="BIT" property="isDelete"/>
        <result column="modifier" jdbcType="VARCHAR" property="modifier"/>
        <result column="gmt_create" jdbcType="DATE" property="gmtCreate"/>
        <result column="gmt_modified" jdbcType="DATE" property="gmtModified"/>
        <result column="bak" jdbcType="VARCHAR" property="bak"/>
    </resultMap>

    <insert id="insertStudentByVoMapper"
            keyColumn="id" keyProperty="id" parameterType="com.paincupid.springmvc.domain.Student"
            useGeneratedKeys="true">

        INSERT INTO t_student (name,class_no,is_delete,modifier,gmt_create, gmt_modified)
          VALUES (#{name},#{classNo},#{isDelete},#{modifier},#{gmtCreate},#{gmtModified});
    </insert>

    <select id="listStudentByClassNoAndSex" resultMap="BaseResultMap">
        select  *  from t_student   where class_no = #{classNo} and sex=#{sex,jdbcType=BIT}
    </select>

    <select id="getStudentById" resultMap="BaseResultMap" parameterType="Long">
        select  *  from t_student   where id=#{id}
    </select>

    <update id="updateStudentNameById" parameterType="Student">
        UPDATE t_student
        SET name = #{name}
        WHERE id = #{id}
    </update>

    <update id="updateStudent2ColumnVal">
        UPDATE t_student
        SET cultivate_hobby =  #{cultivateHobby}, focus = '1'
        WHERE iq > #{iq}
    </update>

    <delete id="deleteStudentById" parameterType="Long">
        DELETE from t_student WHERE id = #{id}
    </delete>
</mapper>

mybaits generator config example

package com.paincupid.springmvc.persistence;

import com.paincupid.springmvc.domain.Student;
import com.paincupid.springmvc.domain.StudentExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface StudentMapper {
    long countByExample(StudentExample example);

    int deleteByExample(StudentExample example);

    int deleteByPrimaryKey(Long id);

    int insert(Student record);

    int insertSelective(Student record);

    List<Student> selectByExample(StudentExample example);

    Student selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") Student record, @Param("example") StudentExample example);

    int updateByExample(@Param("record") Student record, @Param("example") StudentExample example);

    int updateByPrimaryKeySelective(Student record);

    int updateByPrimaryKey(Student record);
}
<?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.paincupid.springmvc.persistence.StudentMapper">
  <resultMap id="BaseResultMap" type="com.paincupid.springmvc.domain.Student">
    <!--          -->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="height" jdbcType="DOUBLE" property="height" />
    <result column="class_no" jdbcType="INTEGER" property="classNo" />
    <result column="sex" jdbcType="BIT" property="sex" />
    <result column="iq" jdbcType="INTEGER" property="iq" />
    <result column="focus" jdbcType="BIT" property="focus" />
    <result column="cultivate_hobby" jdbcType="VARCHAR" property="cultivateHobby" />
    <result column="phone" jdbcType="INTEGER" property="phone" />
    <result column="address" jdbcType="VARCHAR" property="address" />
    <result column="is_delete" jdbcType="BIT" property="isDelete" />
    <result column="modifier" jdbcType="VARCHAR" property="modifier" />
    <result column="gmt_create" jdbcType="DATE" property="gmtCreate" />
    <result column="gmt_modified" jdbcType="DATE" property="gmtModified" />
    <result column="bak" jdbcType="VARCHAR" property="bak" />
  </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, name, height, class_no, sex, iq, focus, cultivate_hobby, phone, address, is_delete,
    modifier, gmt_create, gmt_modified, bak
  </sql>
  <select id="selectByExample" parameterType="com.paincupid.springmvc.domain.StudentExample" resultMap="BaseResultMap">
    <!--          -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from t_student
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    <if test="limit != null">
      <if test="offset != null">
        limit ${offset}, ${limit}
      </if>
      <if test="offset == null">
        limit ${limit}
      </if>
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--          -->
    select
    <include refid="Base_Column_List" />
    from t_student
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--          -->
    delete from t_student
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.paincupid.springmvc.domain.StudentExample">
    <!--          -->
    delete from t_student
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.paincupid.springmvc.domain.Student" useGeneratedKeys="true">
    <!--          -->
    insert into t_student (name, height, class_no,
      sex, iq, focus, cultivate_hobby,
      phone, address, is_delete,
      modifier, gmt_create, gmt_modified,
      bak)
    values (#{name,jdbcType=VARCHAR}, #{height,jdbcType=DOUBLE}, #{classNo,jdbcType=INTEGER},
      #{sex,jdbcType=BIT}, #{iq,jdbcType=INTEGER}, #{focus,jdbcType=BIT}, #{cultivateHobby,jdbcType=VARCHAR},
      #{phone,jdbcType=INTEGER}, #{address,jdbcType=VARCHAR}, #{isDelete,jdbcType=BIT},
      #{modifier,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=DATE}, #{gmtModified,jdbcType=DATE},
      #{bak,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.paincupid.springmvc.domain.Student" useGeneratedKeys="true">
    <!--          -->
    insert into t_student
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="name != null">
        name,
      </if>
      <if test="height != null">
        height,
      </if>
      <if test="classNo != null">
        class_no,
      </if>
      <if test="sex != null">
        sex,
      </if>
      <if test="iq != null">
        iq,
      </if>
      <if test="focus != null">
        focus,
      </if>
      <if test="cultivateHobby != null">
        cultivate_hobby,
      </if>
      <if test="phone != null">
        phone,
      </if>
      <if test="address != null">
        address,
      </if>
      <if test="isDelete != null">
        is_delete,
      </if>
      <if test="modifier != null">
        modifier,
      </if>
      <if test="gmtCreate != null">
        gmt_create,
      </if>
      <if test="gmtModified != null">
        gmt_modified,
      </if>
      <if test="bak != null">
        bak,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="height != null">
        #{height,jdbcType=DOUBLE},
      </if>
      <if test="classNo != null">
        #{classNo,jdbcType=INTEGER},
      </if>
      <if test="sex != null">
        #{sex,jdbcType=BIT},
      </if>
      <if test="iq != null">
        #{iq,jdbcType=INTEGER},
      </if>
      <if test="focus != null">
        #{focus,jdbcType=BIT},
      </if>
      <if test="cultivateHobby != null">
        #{cultivateHobby,jdbcType=VARCHAR},
      </if>
      <if test="phone != null">
        #{phone,jdbcType=INTEGER},
      </if>
      <if test="address != null">
        #{address,jdbcType=VARCHAR},
      </if>
      <if test="isDelete != null">
        #{isDelete,jdbcType=BIT},
      </if>
      <if test="modifier != null">
        #{modifier,jdbcType=VARCHAR},
      </if>
      <if test="gmtCreate != null">
        #{gmtCreate,jdbcType=DATE},
      </if>
      <if test="gmtModified != null">
        #{gmtModified,jdbcType=DATE},
      </if>
      <if test="bak != null">
        #{bak,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.paincupid.springmvc.domain.StudentExample" resultType="java.lang.Long">
    <!--          -->
    select count(*) from t_student
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--          -->
    update t_student
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.name != null">
        name = #{record.name,jdbcType=VARCHAR},
      </if>
      <if test="record.height != null">
        height = #{record.height,jdbcType=DOUBLE},
      </if>
      <if test="record.classNo != null">
        class_no = #{record.classNo,jdbcType=INTEGER},
      </if>
      <if test="record.sex != null">
        sex = #{record.sex,jdbcType=BIT},
      </if>
      <if test="record.iq != null">
        iq = #{record.iq,jdbcType=INTEGER},
      </if>
      <if test="record.focus != null">
        focus = #{record.focus,jdbcType=BIT},
      </if>
      <if test="record.cultivateHobby != null">
        cultivate_hobby = #{record.cultivateHobby,jdbcType=VARCHAR},
      </if>
      <if test="record.phone != null">
        phone = #{record.phone,jdbcType=INTEGER},
      </if>
      <if test="record.address != null">
        address = #{record.address,jdbcType=VARCHAR},
      </if>
      <if test="record.isDelete != null">
        is_delete = #{record.isDelete,jdbcType=BIT},
      </if>
      <if test="record.modifier != null">
        modifier = #{record.modifier,jdbcType=VARCHAR},
      </if>
      <if test="record.gmtCreate != null">
        gmt_create = #{record.gmtCreate,jdbcType=DATE},
      </if>
      <if test="record.gmtModified != null">
        gmt_modified = #{record.gmtModified,jdbcType=DATE},
      </if>
      <if test="record.bak != null">
        bak = #{record.bak,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--          -->
    update t_student
    set id = #{record.id,jdbcType=BIGINT},
      name = #{record.name,jdbcType=VARCHAR},
      height = #{record.height,jdbcType=DOUBLE},
      class_no = #{record.classNo,jdbcType=INTEGER},
      sex = #{record.sex,jdbcType=BIT},
      iq = #{record.iq,jdbcType=INTEGER},
      focus = #{record.focus,jdbcType=BIT},
      cultivate_hobby = #{record.cultivateHobby,jdbcType=VARCHAR},
      phone = #{record.phone,jdbcType=INTEGER},
      address = #{record.address,jdbcType=VARCHAR},
      is_delete = #{record.isDelete,jdbcType=BIT},
      modifier = #{record.modifier,jdbcType=VARCHAR},
      gmt_create = #{record.gmtCreate,jdbcType=DATE},
      gmt_modified = #{record.gmtModified,jdbcType=DATE},
      bak = #{record.bak,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.paincupid.springmvc.domain.Student">
    <!--          -->
    update t_student
    <set>
      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="height != null">
        height = #{height,jdbcType=DOUBLE},
      </if>
      <if test="classNo != null">
        class_no = #{classNo,jdbcType=INTEGER},
      </if>
      <if test="sex != null">
        sex = #{sex,jdbcType=BIT},
      </if>
      <if test="iq != null">
        iq = #{iq,jdbcType=INTEGER},
      </if>
      <if test="focus != null">
        focus = #{focus,jdbcType=BIT},
      </if>
      <if test="cultivateHobby != null">
        cultivate_hobby = #{cultivateHobby,jdbcType=VARCHAR},
      </if>
      <if test="phone != null">
        phone = #{phone,jdbcType=INTEGER},
      </if>
      <if test="address != null">
        address = #{address,jdbcType=VARCHAR},
      </if>
      <if test="isDelete != null">
        is_delete = #{isDelete,jdbcType=BIT},
      </if>
      <if test="modifier != null">
        modifier = #{modifier,jdbcType=VARCHAR},
      </if>
      <if test="gmtCreate != null">
        gmt_create = #{gmtCreate,jdbcType=DATE},
      </if>
      <if test="gmtModified != null">
        gmt_modified = #{gmtModified,jdbcType=DATE},
      </if>
      <if test="bak != null">
        bak = #{bak,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.paincupid.springmvc.domain.Student">
    <!--          -->
    update t_student
    set name = #{name,jdbcType=VARCHAR},
      height = #{height,jdbcType=DOUBLE},
      class_no = #{classNo,jdbcType=INTEGER},
      sex = #{sex,jdbcType=BIT},
      iq = #{iq,jdbcType=INTEGER},
      focus = #{focus,jdbcType=BIT},
      cultivate_hobby = #{cultivateHobby,jdbcType=VARCHAR},
      phone = #{phone,jdbcType=INTEGER},
      address = #{address,jdbcType=VARCHAR},
      is_delete = #{isDelete,jdbcType=BIT},
      modifier = #{modifier,jdbcType=VARCHAR},
      gmt_create = #{gmtCreate,jdbcType=DATE},
      gmt_modified = #{gmtModified,jdbcType=DATE},
      bak = #{bak,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>
package com.paincupid.springmvc.domain;

import java.io.Serializable;
import java.util.Date;

public class Student implements Serializable {
    /**   id **/
    private Long id;

    /** 名称  name **/
    private String name;

    /** 身高  height **/
    private Double height;

    /** 所属班级  class_no **/
    private Integer classNo;

    /** 性别  sex **/
    private Boolean sex;

    /** 智商  iq **/
    private Integer iq;

    /** 是否特别关注  focus **/
    private Boolean focus;

    /** 培养兴趣  cultivate_hobby **/
    private String cultivateHobby;

    /** 电话号码  phone **/
    private Integer phone;

    /** 地址  address **/
    private String address;

    /** 是否删除  is_delete **/
    private Boolean isDelete;

    /** 修改人  modifier **/
    private String modifier;

    /** 创建时间  gmt_create **/
    private Date gmtCreate;

    /** 修改时间  gmt_modified **/
    private Date gmtModified;

    /**   bak **/
    private String bak;

    /**   tableName: t_student   **/
    private static final long serialVersionUID = 1L;

    /**     id   **/
    public Long getId() {
        return id;
    }

    /**     id   **/
    public void setId(Long id) {
        this.id = id;
    }

    /**   名称  name   **/
    public String getName() {
        return name;
    }

    /**   名称  name   **/
    public void setName(String name) {
        this.name = name;
    }

    /**   身高  height   **/
    public Double getHeight() {
        return height;
    }

    /**   身高  height   **/
    public void setHeight(Double height) {
        this.height = height;
    }

    /**   所属班级  class_no   **/
    public Integer getClassNo() {
        return classNo;
    }

    /**   所属班级  class_no   **/
    public void setClassNo(Integer classNo) {
        this.classNo = classNo;
    }

    /**   性别  sex   **/
    public Boolean getSex() {
        return sex;
    }

    /**   性别  sex   **/
    public void setSex(Boolean sex) {
        this.sex = sex;
    }

    /**   智商  iq   **/
    public Integer getIq() {
        return iq;
    }

    /**   智商  iq   **/
    public void setIq(Integer iq) {
        this.iq = iq;
    }

    /**   是否特别关注  focus   **/
    public Boolean getFocus() {
        return focus;
    }

    /**   是否特别关注  focus   **/
    public void setFocus(Boolean focus) {
        this.focus = focus;
    }

    /**   培养兴趣  cultivate_hobby   **/
    public String getCultivateHobby() {
        return cultivateHobby;
    }

    /**   培养兴趣  cultivate_hobby   **/
    public void setCultivateHobby(String cultivateHobby) {
        this.cultivateHobby = cultivateHobby;
    }

    /**   电话号码  phone   **/
    public Integer getPhone() {
        return phone;
    }

    /**   电话号码  phone   **/
    public void setPhone(Integer phone) {
        this.phone = phone;
    }

    /**   地址  address   **/
    public String getAddress() {
        return address;
    }

    /**   地址  address   **/
    public void setAddress(String address) {
        this.address = address;
    }

    /**   是否删除  is_delete   **/
    public Boolean getIsDelete() {
        return isDelete;
    }

    /**   是否删除  is_delete   **/
    public void setIsDelete(Boolean isDelete) {
        this.isDelete = isDelete;
    }

    /**   修改人  modifier   **/
    public String getModifier() {
        return modifier;
    }

    /**   修改人  modifier   **/
    public void setModifier(String modifier) {
        this.modifier = modifier;
    }

    /**   创建时间  gmt_create   **/
    public Date getGmtCreate() {
        return gmtCreate;
    }

    /**   创建时间  gmt_create   **/
    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    /**   修改时间  gmt_modified   **/
    public Date getGmtModified() {
        return gmtModified;
    }

    /**   修改时间  gmt_modified   **/
    public void setGmtModified(Date gmtModified) {
        this.gmtModified = gmtModified;
    }

    /**     bak   **/
    public String getBak() {
        return bak;
    }

    /**     bak   **/
    public void setBak(String bak) {
        this.bak = bak;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", height=").append(height);
        sb.append(", classNo=").append(classNo);
        sb.append(", sex=").append(sex);
        sb.append(", iq=").append(iq);
        sb.append(", focus=").append(focus);
        sb.append(", cultivateHobby=").append(cultivateHobby);
        sb.append(", phone=").append(phone);
        sb.append(", address=").append(address);
        sb.append(", isDelete=").append(isDelete);
        sb.append(", modifier=").append(modifier);
        sb.append(", gmtCreate=").append(gmtCreate);
        sb.append(", gmtModified=").append(gmtModified);
        sb.append(", bak=").append(bak);
        sb.append("]");
        return sb.toString();
    }
}
package com.paincupid.springmvc.domain;

import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;

public class StudentExample {
    /**   tableName: t_student   **/
    protecte
    `d String orderByClause;

    /**   tableName: t_student   **/
    protected boolean distinct;

    /**   tableName: t_student   **/
    protected List<Criteria> oredCriteria;

    private Integer limit;

    private Integer offset;

    public StudentExample() {
        oredCriteria = new ArrayList<Criteria>();
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    public void setLimit(Integer limit) {
        this.limit = limit;
    }

    public Integer getLimit() {
        return limit;
    }

    public void setOffset(Integer offset) {
        this.offset = offset;
    }

    public Integer getOffset() {
        return offset;
    }

    /** t_student **/
    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }

        protected void addCriterionForJDBCDate(String condition, Date value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            addCriterion(condition, new java.sql.Date(value.getTime()), property);
        }

        protected void addCriterionForJDBCDate(String condition, List<Date> values, String property) {
            if (values == null || values.size() == 0) {
                throw new RuntimeException("Value list for " + property + " cannot be null or empty");
            }
            List<java.sql.Date> dateList = new ArrayList<java.sql.Date>();
            Iterator<Date> iter = values.iterator();
            while (iter.hasNext()) {
                dateList.add(new java.sql.Date(iter.next().getTime()));
            }
            addCriterion(condition, dateList, property);
        }

        protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property);
        }

        public Criteria andIdIsNull() {
            addCriterion("id is null");
            return (Criteria) this;
        }

        public Criteria andIdIsNotNull() {
            addCriterion("id is not null");
            return (Criteria) this;
        }

        public Criteria andIdEqualTo(Long value) {
            addCriterion("id =", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotEqualTo(Long value) {
            addCriterion("id <>", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThan(Long value) {
            addCriterion("id >", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThanOrEqualTo(Long value) {
            addCriterion("id >=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThan(Long value) {
            addCriterion("id <", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThanOrEqualTo(Long value) {
            addCriterion("id <=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdIn(List<Long> values) {
            addCriterion("id in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotIn(List<Long> values) {
            addCriterion("id not in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdBetween(Long value1, Long value2) {
            addCriterion("id between", value1, value2, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotBetween(Long value1, Long value2) {
            addCriterion("id not between", value1, value2, "id");
            return (Criteria) this;
        }

        public Criteria andNameIsNull() {
            addCriterion("name is null");
            return (Criteria) this;
        }

        public Criteria andNameIsNotNull() {
            addCriterion("name is not null");
            return (Criteria) this;
        }

        public Criteria andNameEqualTo(String value) {
            addCriterion("name =", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameNotEqualTo(String value) {
            addCriterion("name <>", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameGreaterThan(String value) {
            addCriterion("name >", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameGreaterThanOrEqualTo(String value) {
            addCriterion("name >=", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameLessThan(String value) {
            addCriterion("name <", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameLessThanOrEqualTo(String value) {
            addCriterion("name <=", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameLike(String value) {
            addCriterion("name like", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameNotLike(String value) {
            addCriterion("name not like", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameIn(List<String> values) {
            addCriterion("name in", values, "name");
            return (Criteria) this;
        }

        public Criteria andNameNotIn(List<String> values) {
            addCriterion("name not in", values, "name");
            return (Criteria) this;
        }

        public Criteria andNameBetween(String value1, String value2) {
            addCriterion("name between", value1, value2, "name");
            return (Criteria) this;
        }

        public Criteria andNameNotBetween(String value1, String value2) {
            addCriterion("name not between", value1, value2, "name");
            return (Criteria) this;
        }

        public Criteria andHeightIsNull() {
            addCriterion("height is null");
            return (Criteria) this;
        }

        public Criteria andHeightIsNotNull() {
            addCriterion("height is not null");
            return (Criteria) this;
        }

        public Criteria andHeightEqualTo(Double value) {
            addCriterion("height =", value, "height");
            return (Criteria) this;
        }

        public Criteria andHeightNotEqualTo(Double value) {
            addCriterion("height <>", value, "height");
            return (Criteria) this;
        }

        public Criteria andHeightGreaterThan(Double value) {
            addCriterion("height >", value, "height");
            return (Criteria) this;
        }

        public Criteria andHeightGreaterThanOrEqualTo(Double value) {
            addCriterion("height >=", value, "height");
            return (Criteria) this;
        }

        public Criteria andHeightLessThan(Double value) {
            addCriterion("height <", value, "height");
            return (Criteria) this;
        }

        public Criteria andHeightLessThanOrEqualTo(Double value) {
            addCriterion("height <=", value, "height");
            return (Criteria) this;
        }

        public Criteria andHeightIn(List<Double> values) {
            addCriterion("height in", values, "height");
            return (Criteria) this;
        }

        public Criteria andHeightNotIn(List<Double> values) {
            addCriterion("height not in", values, "height");
            return (Criteria) this;
        }

        public Criteria andHeightBetween(Double value1, Double value2) {
            addCriterion("height between", value1, value2, "height");
            return (Criteria) this;
        }

        public Criteria andHeightNotBetween(Double value1, Double value2) {
            addCriterion("height not between", value1, value2, "height");
            return (Criteria) this;
        }

        public Criteria andClassNoIsNull() {
            addCriterion("class_no is null");
            return (Criteria) this;
        }

        public Criteria andClassNoIsNotNull() {
            addCriterion("class_no is not null");
            return (Criteria) this;
        }

        public Criteria andClassNoEqualTo(Integer value) {
            addCriterion("class_no =", value, "classNo");
            return (Criteria) this;
        }

        public Criteria andClassNoNotEqualTo(Integer value) {
            addCriterion("class_no <>", value, "classNo");
            return (Criteria) this;
        }

        public Criteria andClassNoGreaterThan(Integer value) {
            addCriterion("class_no >", value, "classNo");
            return (Criteria) this;
        }

        public Criteria andClassNoGreaterThanOrEqualTo(Integer value) {
            addCriterion("class_no >=", value, "classNo");
            return (Criteria) this;
        }

        public Criteria andClassNoLessThan(Integer value) {
            addCriterion("class_no <", value, "classNo");
            return (Criteria) this;
        }

        public Criteria andClassNoLessThanOrEqualTo(Integer value) {
            addCriterion("class_no <=", value, "classNo");
            return (Criteria) this;
        }

        public Criteria andClassNoIn(List<Integer> values) {
            addCriterion("class_no in", values, "classNo");
            return (Criteria) this;
        }

        public Criteria andClassNoNotIn(List<Integer> values) {
            addCriterion("class_no not in", values, "classNo");
            return (Criteria) this;
        }

        public Criteria andClassNoBetween(Integer value1, Integer value2) {
            addCriterion("class_no between", value1, value2, "classNo");
            return (Criteria) this;
        }

        public Criteria andClassNoNotBetween(Integer value1, Integer value2) {
            addCriterion("class_no not between", value1, value2, "classNo");
            return (Criteria) this;
        }

        public Criteria andSexIsNull() {
            addCriterion("sex is null");
            return (Criteria) this;
        }

        public Criteria andSexIsNotNull() {
            addCriterion("sex is not null");
            return (Criteria) this;
        }

        public Criteria andSexEqualTo(Boolean value) {
            addCriterion("sex =", value, "sex");
            return (Criteria) this;
        }

        public Criteria andSexNotEqualTo(Boolean value) {
            addCriterion("sex <>", value, "sex");
            return (Criteria) this;
        }

        public Criteria andSexGreaterThan(Boolean value) {
            addCriterion("sex >", value, "sex");
            return (Criteria) this;
        }

        public Criteria andSexGreaterThanOrEqualTo(Boolean value) {
            addCriterion("sex >=", value, "sex");
            return (Criteria) this;
        }

        public Criteria andSexLessThan(Boolean value) {
            addCriterion("sex <", value, "sex");
            return (Criteria) this;
        }

        public Criteria andSexLessThanOrEqualTo(Boolean value) {
            addCriterion("sex <=", value, "sex");
            return (Criteria) this;
        }

        public Criteria andSexIn(List<Boolean> values) {
            addCriterion("sex in", values, "sex");
            return (Criteria) this;
        }

        public Criteria andSexNotIn(List<Boolean> values) {
            addCriterion("sex not in", values, "sex");
            return (Criteria) this;
        }

        public Criteria andSexBetween(Boolean value1, Boolean value2) {
            addCriterion("sex between", value1, value2, "sex");
            return (Criteria) this;
        }

        public Criteria andSexNotBetween(Boolean value1, Boolean value2) {
            addCriterion("sex not between", value1, value2, "sex");
            return (Criteria) this;
        }

        public Criteria andIqIsNull() {
            addCriterion("iq is null");
            return (Criteria) this;
        }

        public Criteria andIqIsNotNull() {
            addCriterion("iq is not null");
            return (Criteria) this;
        }

        public Criteria andIqEqualTo(Integer value) {
            addCriterion("iq =", value, "iq");
            return (Criteria) this;
        }

        public Criteria andIqNotEqualTo(Integer value) {
            addCriterion("iq <>", value, "iq");
            return (Criteria) this;
        }

        public Criteria andIqGreaterThan(Integer value) {
            addCriterion("iq >", value, "iq");
            return (Criteria) this;
        }

        public Criteria andIqGreaterThanOrEqualTo(Integer value) {
            addCriterion("iq >=", value, "iq");
            return (Criteria) this;
        }

        public Criteria andIqLessThan(Integer value) {
            addCriterion("iq <", value, "iq");
            return (Criteria) this;
        }

        public Criteria andIqLessThanOrEqualTo(Integer value) {
            addCriterion("iq <=", value, "iq");
            return (Criteria) this;
        }

        public Criteria andIqIn(List<Integer> values) {
            addCriterion("iq in", values, "iq");
            return (Criteria) this;
        }

        public Criteria andIqNotIn(List<Integer> values) {
            addCriterion("iq not in", values, "iq");
            return (Criteria) this;
        }

        public Criteria andIqBetween(Integer value1, Integer value2) {
            addCriterion("iq between", value1, value2, "iq");
            return (Criteria) this;
        }

        public Criteria andIqNotBetween(Integer value1, Integer value2) {
            addCriterion("iq not between", value1, value2, "iq");
            return (Criteria) this;
        }

        public Criteria andFocusIsNull() {
            addCriterion("focus is null");
            return (Criteria) this;
        }

        public Criteria andFocusIsNotNull() {
            addCriterion("focus is not null");
            return (Criteria) this;
        }

        public Criteria andFocusEqualTo(Boolean value) {
            addCriterion("focus =", value, "focus");
            return (Criteria) this;
        }

        public Criteria andFocusNotEqualTo(Boolean value) {
            addCriterion("focus <>", value, "focus");
            return (Criteria) this;
        }

        public Criteria andFocusGreaterThan(Boolean value) {
            addCriterion("focus >", value, "focus");
            return (Criteria) this;
        }

        public Criteria andFocusGreaterThanOrEqualTo(Boolean value) {
            addCriterion("focus >=", value, "focus");
            return (Criteria) this;
        }

        public Criteria andFocusLessThan(Boolean value) {
            addCriterion("focus <", value, "focus");
            return (Criteria) this;
        }

        public Criteria andFocusLessThanOrEqualTo(Boolean value) {
            addCriterion("focus <=", value, "focus");
            return (Criteria) this;
        }

        public Criteria andFocusIn(List<Boolean> values) {
            addCriterion("focus in", values, "focus");
            return (Criteria) this;
        }

        public Criteria andFocusNotIn(List<Boolean> values) {
            addCriterion("focus not in", values, "focus");
            return (Criteria) this;
        }

        public Criteria andFocusBetween(Boolean value1, Boolean value2) {
            addCriterion("focus between", value1, value2, "focus");
            return (Criteria) this;
        }

        public Criteria andFocusNotBetween(Boolean value1, Boolean value2) {
            addCriterion("focus not between", value1, value2, "focus");
            return (Criteria) this;
        }

        public Criteria andCultivateHobbyIsNull() {
            addCriterion("cultivate_hobby is null");
            return (Criteria) this;
        }

        public Criteria andCultivateHobbyIsNotNull() {
            addCriterion("cultivate_hobby is not null");
            return (Criteria) this;
        }

        public Criteria andCultivateHobbyEqualTo(String value) {
            addCriterion("cultivate_hobby =", value, "cultivateHobby");
            return (Criteria) this;
        }

        public Criteria andCultivateHobbyNotEqualTo(String value) {
            addCriterion("cultivate_hobby <>", value, "cultivateHobby");
            return (Criteria) this;
        }

        public Criteria andCultivateHobbyGreaterThan(String value) {
            addCriterion("cultivate_hobby >", value, "cultivateHobby");
            return (Criteria) this;
        }

        public Criteria andCultivateHobbyGreaterThanOrEqualTo(String value) {
            addCriterion("cultivate_hobby >=", value, "cultivateHobby");
            return (Criteria) this;
        }

        public Criteria andCultivateHobbyLessThan(String value) {
            addCriterion("cultivate_hobby <", value, "cultivateHobby");
            return (Criteria) this;
        }

        public Criteria andCultivateHobbyLessThanOrEqualTo(String value) {
            addCriterion("cultivate_hobby <=", value, "cultivateHobby");
            return (Criteria) this;
        }

        public Criteria andCultivateHobbyLike(String value) {
            addCriterion("cultivate_hobby like", value, "cultivateHobby");
            return (Criteria) this;
        }

        public Criteria andCultivateHobbyNotLike(String value) {
            addCriterion("cultivate_hobby not like", value, "cultivateHobby");
            return (Criteria) this;
        }

        public Criteria andCultivateHobbyIn(List<String> values) {
            addCriterion("cultivate_hobby in", values, "cultivateHobby");
            return (Criteria) this;
        }

        public Criteria andCultivateHobbyNotIn(List<String> values) {
            addCriterion("cultivate_hobby not in", values, "cultivateHobby");
            return (Criteria) this;
        }

        public Criteria andCultivateHobbyBetween(String value1, String value2) {
            addCriterion("cultivate_hobby between", value1, value2, "cultivateHobby");
            return (Criteria) this;
        }

        public Criteria andCultivateHobbyNotBetween(String value1, String value2) {
            addCriterion("cultivate_hobby not between", value1, value2, "cultivateHobby");
            return (Criteria) this;
        }

        public Criteria andPhoneIsNull() {
            addCriterion("phone is null");
            return (Criteria) this;
        }

        public Criteria andPhoneIsNotNull() {
            addCriterion("phone is not null");
            return (Criteria) this;
        }

        public Criteria andPhoneEqualTo(Integer value) {
            addCriterion("phone =", value, "phone");
            return (Criteria) this;
        }

        public Criteria andPhoneNotEqualTo(Integer value) {
            addCriterion("phone <>", value, "phone");
            return (Criteria) this;
        }

        public Criteria andPhoneGreaterThan(Integer value) {
            addCriterion("phone >", value, "phone");
            return (Criteria) this;
        }

        public Criteria andPhoneGreaterThanOrEqualTo(Integer value) {
            addCriterion("phone >=", value, "phone");
            return (Criteria) this;
        }

        public Criteria andPhoneLessThan(Integer value) {
            addCriterion("phone <", value, "phone");
            return (Criteria) this;
        }

        public Criteria andPhoneLessThanOrEqualTo(Integer value) {
            addCriterion("phone <=", value, "phone");
            return (Criteria) this;
        }

        public Criteria andPhoneIn(List<Integer> values) {
            addCriterion("phone in", values, "phone");
            return (Criteria) this;
        }

        public Criteria andPhoneNotIn(List<Integer> values) {
            addCriterion("phone not in", values, "phone");
            return (Criteria) this;
        }

        public Criteria andPhoneBetween(Integer value1, Integer value2) {
            addCriterion("phone between", value1, value2, "phone");
            return (Criteria) this;
        }

        public Criteria andPhoneNotBetween(Integer value1, Integer value2) {
            addCriterion("phone not between", value1, value2, "phone");
            return (Criteria) this;
        }

        public Criteria andAddressIsNull() {
            addCriterion("address is null");
            return (Criteria) this;
        }

        public Criteria andAddressIsNotNull() {
            addCriterion("address is not null");
            return (Criteria) this;
        }

        public Criteria andAddressEqualTo(String value) {
            addCriterion("address =", value, "address");
            return (Criteria) this;
        }

        public Criteria andAddressNotEqualTo(String value) {
            addCriterion("address <>", value, "address");
            return (Criteria) this;
        }

        public Criteria andAddressGreaterThan(String value) {
            addCriterion("address >", value, "address");
            return (Criteria) this;
        }

        public Criteria andAddressGreaterThanOrEqualTo(String value) {
            addCriterion("address >=", value, "address");
            return (Criteria) this;
        }

        public Criteria andAddressLessThan(String value) {
            addCriterion("address <", value, "address");
            return (Criteria) this;
        }

        public Criteria andAddressLessThanOrEqualTo(String value) {
            addCriterion("address <=", value, "address");
            return (Criteria) this;
        }

        public Criteria andAddressLike(String value) {
            addCriterion("address like", value, "address");
            return (Criteria) this;
        }

        public Criteria andAddressNotLike(String value) {
            addCriterion("address not like", value, "address");
            return (Criteria) this;
        }

        public Criteria andAddressIn(List<String> values) {
            addCriterion("address in", values, "address");
            return (Criteria) this;
        }

        public Criteria andAddressNotIn(List<String> values) {
            addCriterion("address not in", values, "address");
            return (Criteria) this;
        }

        public Criteria andAddressBetween(String value1, String value2) {
            addCriterion("address between", value1, value2, "address");
            return (Criteria) this;
        }

        public Criteria andAddressNotBetween(String value1, String value2) {
            addCriterion("address not between", value1, value2, "address");
            return (Criteria) this;
        }

        public Criteria andIsDeleteIsNull() {
            addCriterion("is_delete is null");
            return (Criteria) this;
        }

        public Criteria andIsDeleteIsNotNull() {
            addCriterion("is_delete is not null");
            return (Criteria) this;
        }

        public Criteria andIsDeleteEqualTo(Boolean value) {
            addCriterion("is_delete =", value, "isDelete");
            return (Criteria) this;
        }

        public Criteria andIsDeleteNotEqualTo(Boolean value) {
            addCriterion("is_delete <>", value, "isDelete");
            return (Criteria) this;
        }

        public Criteria andIsDeleteGreaterThan(Boolean value) {
            addCriterion("is_delete >", value, "isDelete");
            return (Criteria) this;
        }

        public Criteria andIsDeleteGreaterThanOrEqualTo(Boolean value) {
            addCriterion("is_delete >=", value, "isDelete");
            return (Criteria) this;
        }

        public Criteria andIsDeleteLessThan(Boolean value) {
            addCriterion("is_delete <", value, "isDelete");
            return (Criteria) this;
        }

        public Criteria andIsDeleteLessThanOrEqualTo(Boolean value) {
            addCriterion("is_delete <=", value, "isDelete");
            return (Criteria) this;
        }

        public Criteria andIsDeleteIn(List<Boolean> values) {
            addCriterion("is_delete in", values, "isDelete");
            return (Criteria) this;
        }

        public Criteria andIsDeleteNotIn(List<Boolean> values) {
            addCriterion("is_delete not in", values, "isDelete");
            return (Criteria) this;
        }

        public Criteria andIsDeleteBetween(Boolean value1, Boolean value2) {
            addCriterion("is_delete between", value1, value2, "isDelete");
            return (Criteria) this;
        }

        public Criteria andIsDeleteNotBetween(Boolean value1, Boolean value2) {
            addCriterion("is_delete not between", value1, value2, "isDelete");
            return (Criteria) this;
        }

        public Criteria andModifierIsNull() {
            addCriterion("modifier is null");
            return (Criteria) this;
        }

        public Criteria andModifierIsNotNull() {
            addCriterion("modifier is not null");
            return (Criteria) this;
        }

        public Criteria andModifierEqualTo(String value) {
            addCriterion("modifier =", value, "modifier");
            return (Criteria) this;
        }

        public Criteria andModifierNotEqualTo(String value) {
            addCriterion("modifier <>", value, "modifier");
            return (Criteria) this;
        }

        public Criteria andModifierGreaterThan(String value) {
            addCriterion("modifier >", value, "modifier");
            return (Criteria) this;
        }

        public Criteria andModifierGreaterThanOrEqualTo(String value) {
            addCriterion("modifier >=", value, "modifier");
            return (Criteria) this;
        }

        public Criteria andModifierLessThan(String value) {
            addCriterion("modifier <", value, "modifier");
            return (Criteria) this;
        }

        public Criteria andModifierLessThanOrEqualTo(String value) {
            addCriterion("modifier <=", value, "modifier");
            return (Criteria) this;
        }

        public Criteria andModifierLike(String value) {
            addCriterion("modifier like", value, "modifier");
            return (Criteria) this;
        }

        public Criteria andModifierNotLike(String value) {
            addCriterion("modifier not like", value, "modifier");
            return (Criteria) this;
        }

        public Criteria andModifierIn(List<String> values) {
            addCriterion("modifier in", values, "modifier");
            return (Criteria) this;
        }

        public Criteria andModifierNotIn(List<String> values) {
            addCriterion("modifier not in", values, "modifier");
            return (Criteria) this;
        }

        public Criteria andModifierBetween(String value1, String value2) {
            addCriterion("modifier between", value1, value2, "modifier");
            return (Criteria) this;
        }

        public Criteria andModifierNotBetween(String value1, String value2) {
            addCriterion("modifier not between", value1, value2, "modifier");
            return (Criteria) this;
        }

        public Criteria andGmtCreateIsNull() {
            addCriterion("gmt_create is null");
            return (Criteria) this;
        }

        public Criteria andGmtCreateIsNotNull() {
            addCriterion("gmt_create is not null");
            return (Criteria) this;
        }

        public Criteria andGmtCreateEqualTo(Date value) {
            addCriterionForJDBCDate("gmt_create =", value, "gmtCreate");
            return (Criteria) this;
        }

        public Criteria andGmtCreateNotEqualTo(Date value) {
            addCriterionForJDBCDate("gmt_create <>", value, "gmtCreate");
            return (Criteria) this;
        }

        public Criteria andGmtCreateGreaterThan(Date value) {
            addCriterionForJDBCDate("gmt_create >", value, "gmtCreate");
            return (Criteria) this;
        }

        public Criteria andGmtCreateGreaterThanOrEqualTo(Date value) {
            addCriterionForJDBCDate("gmt_create >=", value, "gmtCreate");
            return (Criteria) this;
        }

        public Criteria andGmtCreateLessThan(Date value) {
            addCriterionForJDBCDate("gmt_create <", value, "gmtCreate");
            return (Criteria) this;
        }

        public Criteria andGmtCreateLessThanOrEqualTo(Date value) {
            addCriterionForJDBCDate("gmt_create <=", value, "gmtCreate");
            return (Criteria) this;
        }

        public Criteria andGmtCreateIn(List<Date> values) {
            addCriterionForJDBCDate("gmt_create in", values, "gmtCreate");
            return (Criteria) this;
        }

        public Criteria andGmtCreateNotIn(List<Date> values) {
            addCriterionForJDBCDate("gmt_create not in", values, "gmtCreate");
            return (Criteria) this;
        }

        public Criteria andGmtCreateBetween(Date value1, Date value2) {
            addCriterionForJDBCDate("gmt_create between", value1, value2, "gmtCreate");
            return (Criteria) this;
        }

        public Criteria andGmtCreateNotBetween(Date value1, Date value2) {
            addCriterionForJDBCDate("gmt_create not between", value1, value2, "gmtCreate");
            return (Criteria) this;
        }

        public Criteria andGmtModifiedIsNull() {
            addCriterion("gmt_modified is null");
            return (Criteria) this;
        }

        public Criteria andGmtModifiedIsNotNull() {
            addCriterion("gmt_modified is not null");
            return (Criteria) this;
        }

        public Criteria andGmtModifiedEqualTo(Date value) {
            addCriterionForJDBCDate("gmt_modified =", value, "gmtModified");
            return (Criteria) this;
        }

        public Criteria andGmtModifiedNotEqualTo(Date value) {
            addCriterionForJDBCDate("gmt_modified <>", value, "gmtModified");
            return (Criteria) this;
        }

        public Criteria andGmtModifiedGreaterThan(Date value) {
            addCriterionForJDBCDate("gmt_modified >", value, "gmtModified");
            return (Criteria) this;
        }

        public Criteria andGmtModifiedGreaterThanOrEqualTo(Date value) {
            addCriterionForJDBCDate("gmt_modified >=", value, "gmtModified");
            return (Criteria) this;
        }

        public Criteria andGmtModifiedLessThan(Date value) {
            addCriterionForJDBCDate("gmt_modified <", value, "gmtModified");
            return (Criteria) this;
        }

        public Criteria andGmtModifiedLessThanOrEqualTo(Date value) {
            addCriterionForJDBCDate("gmt_modified <=", value, "gmtModified");
            return (Criteria) this;
        }

        public Criteria andGmtModifiedIn(List<Date> values) {
            addCriterionForJDBCDate("gmt_modified in", values, "gmtModified");
            return (Criteria) this;
        }

        public Criteria andGmtModifiedNotIn(List<Date> values) {
            addCriterionForJDBCDate("gmt_modified not in", values, "gmtModified");
            return (Criteria) this;
        }

        public Criteria andGmtModifiedBetween(Date value1, Date value2) {
            addCriterionForJDBCDate("gmt_modified between", value1, value2, "gmtModified");
            return (Criteria) this;
        }

        public Criteria andGmtModifiedNotBetween(Date value1, Date value2) {
            addCriterionForJDBCDate("gmt_modified not between", value1, value2, "gmtModified");
            return (Criteria) this;
        }

        public Criteria andBakIsNull() {
            addCriterion("bak is null");
            return (Criteria) this;
        }

        public Criteria andBakIsNotNull() {
            addCriterion("bak is not null");
            return (Criteria) this;
        }

        public Criteria andBakEqualTo(String value) {
            addCriterion("bak =", value, "bak");
            return (Criteria) this;
        }

        public Criteria andBakNotEqualTo(String value) {
            addCriterion("bak <>", value, "bak");
            return (Criteria) this;
        }

        public Criteria andBakGreaterThan(String value) {
            addCriterion("bak >", value, "bak");
            return (Criteria) this;
        }

        public Criteria andBakGreaterThanOrEqualTo(String value) {
            addCriterion("bak >=", value, "bak");
            return (Criteria) this;
        }

        public Criteria andBakLessThan(String value) {
            addCriterion("bak <", value, "bak");
            return (Criteria) this;
        }

        public Criteria andBakLessThanOrEqualTo(String value) {
            addCriterion("bak <=", value, "bak");
            return (Criteria) this;
        }

        public Criteria andBakLike(String value) {
            addCriterion("bak like", value, "bak");
            return (Criteria) this;
        }

        public Criteria andBakNotLike(String value) {
            addCriterion("bak not like", value, "bak");
            return (Criteria) this;
        }

        public Criteria andBakIn(List<String> values) {
            addCriterion("bak in", values, "bak");
            return (Criteria) this;
        }

        public Criteria andBakNotIn(List<String> values) {
            addCriterion("bak not in", values, "bak");
            return (Criteria) this;
        }

        public Criteria andBakBetween(String value1, String value2) {
            addCriterion("bak between", value1, value2, "bak");
            return (Criteria) this;
        }

        public Criteria andBakNotBetween(String value1, String value2) {
            addCriterion("bak not between", value1, value2, "bak");
            return (Criteria) this;
        }
    }

    /**  tableName: t_student   **/
    public static class Criteria extends GeneratedCriteria {

        protected Criteria() {
            super();
        }
    }

    /** t_student **/
    public static class Criterion {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
}

create mysql

DROP TABLE IF EXISTS `t_student`;
CREATE TABLE `t_student` (
  `id` bigint(20) AUTO_INCREMENT ,
  `name` varchar(50) not NULL COMMENT '名称',
    `height` double(4,2) comment '身高',
    `class_no` int(11) COMMENT '所属班级',
  `sex` tinyint(1)  COMMENT  '性别',
  `iq` int(11)  COMMENT '智商',
    `focus` tinyint(1)  COMMENT '是否特别关注',
  `cultivate_hobby` varchar(500) COMMENT '培养兴趣',
  `phone` int(11) DEFAULT NULL COMMENT '电话号码',
  `address` varchar(500)  COMMENT '地址',
  `is_delete` tinyint(1) not NULL COMMENT '是否删除',
  `modifier` varchar(50) not NULL COMMENT '修改人',
  `gmt_create` date not NULL COMMENT '创建时间',
  `gmt_modified` date not NULL COMMENT '修改时间',
  `bak` varchar(500) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT = 1 DEFAULT CHARSET=utf8 COMMENT='学生表';
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值