mybatis 自动生成integer_通过mybatis-generator-core工具自动关联表生成对应model、mappers及dao层代码类完整教程...

一、前言

二、方法一(基于批处理方式)

1.在mysql的数据库test中创建guser表脚本CREATE TABLE 'guser' (@b@  'id' int(20) NOT NULL COMMENT '主键',@b@  'name' varchar(60) DEFAULT NULL COMMENT '用户名',@b@  'create_by' varchar(60) DEFAULT NULL COMMENT '创建人',@b@  'create_time' date DEFAULT NULL COMMENT '创建时间',@b@  'update_by' varchar(60) DEFAULT NULL COMMENT '更新人',@b@  'update_time' date DEFAULT NULL COMMENT '更新时间',@b@  PRIMARY KEY ('id')@b@) ENGINE=MyISAM DEFAULT CHARSET=utf8;

2.generator.xml的配置内容如下<?xml  version="1.0" encoding="UTF-8"?>@b@generatorConfiguration  PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"  "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">@b@@b@@b@ @b@ @b@@b@@b@@b@ @b@ @b@@b@ @b@@b@@b@  @b@   @b@    @b@@b@   @b@   @b@   @b@  @b@@b@@b@   @b@     @b@    @b@@b@@b@   @b@    @b@ @b@@b@@b@@b@@b@

 @b@@b@  @b@@b@

如果连接oracle数据库修改部分如下<?xml  version="1.0" encoding="UTF-8"?>@b@generatorConfiguration  PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"  "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">@b@@b@@b@ @b@ @b@@b@@b@@b@ @b@ @b@@b@ @b@@b@@b@....@b@@b@          @b@@b@

3.配置JAVA_HOME环境,后配置run.bat批处理文件,内容如下java -jar C:\WS\mybatis-generator-core-1.3.1\lib\mybatis-generator-core-1.3.1.jar  -configfile   C:\WS\mybatis-generator-core-1.3.1\generator.xml -overwrite

4.运行run.bat能正常在target目录生成dao、mappers及model代码,如下图所示

三、方法二(基于eclipse方式)

1.在项目的generator.xml,配置如下<?xml  version="1.0" encoding="UTF-8"?>@b@generatorConfiguration  PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"  "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">@b@@b@@b@ @b@ @b@@b@@b@@b@ @b@ @b@@b@ @b@@b@@b@  @b@   @b@    @b@@b@   @b@   @b@   @b@  @b@@b@@b@   @b@     @b@    @b@@b@@b@   @b@    @b@ @b@@b@@b@@b@@b@

 @b@@b@  @b@@b@

3.编写GeneratorExecuter执行类入口,代码如下import java.io.File;@b@import java.util.ArrayList;@b@import java.util.List;@b@@b@import org.mybatis.generator.api.MyBatisGenerator;@b@import org.mybatis.generator.config.Configuration;@b@import org.mybatis.generator.config.xml.ConfigurationParser;@b@import org.mybatis.generator.internal.DefaultShellCallback;@b@@b@public class GeneratorExecuter {@b@@b@ public void generator() throws Exception{@b@        List warnings = new ArrayList();@b@        boolean overwrite = true;@b@        @b@        File configFile = new File("C:\\WS\\NJ\\project\\xwood-project\\JavaTest\\src\\com\\xwood\\gen\\generator.xml"); @b@        ConfigurationParser cp = new ConfigurationParser(warnings);@b@        Configuration config = cp.parseConfiguration(configFile);@b@        DefaultShellCallback callback = new DefaultShellCallback(overwrite);@b@        MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config,@b@                callback, warnings);@b@        myBatisGenerator.generate(null);@b@    }@b@    public static void main(String[] args) throws Exception {@b@        try {@b@        GeneratorExecuter generatorSqlmap = new GeneratorExecuter();@b@            generatorSqlmap.generator();@b@        } catch (Exception e) {@b@            e.printStackTrace();@b@        }@b@}@b@@b@}

4.运行结果如下图

四、方法三 (基于eclipse插件方式)

五、生成结果如下

1.dao层代码GuserMapper.javaimport com.xwood.gen.model.Guser;@b@import com.xwood.gen.model.GuserExample;@b@import java.util.List;@b@import org.apache.ibatis.annotations.Param;@b@@b@public interface GuserMapper {@b@    int countByExample(GuserExample example);@b@@b@    int deleteByExample(GuserExample example);@b@@b@    int deleteByPrimaryKey(Integer id);@b@@b@    int insert(Guser record);@b@@b@    int insertSelective(Guser record);@b@@b@    List selectByExample(GuserExample example);@b@@b@    Guser selectByPrimaryKey(Integer id);@b@@b@    int updateByExampleSelective(@Param("record") Guser record, @Param("example") GuserExample example);@b@@b@    int updateByExample(@Param("record") Guser record, @Param("example") GuserExample example);@b@@b@    int updateByPrimaryKeySelective(Guser record);@b@@b@    int updateByPrimaryKey(Guser record);@b@}

2.mappers层代码GuserMapper.xml<?xml  version="1.0" encoding="UTF-8" ?>@b@mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >@b@@b@  @b@    @b@    @b@    @b@    @b@    @b@    @b@  @b@  @b@    @b@      @b@        @b@          @b@            @b@              @b@                @b@                  and ${criterion.condition}@b@                @b@                @b@                  and ${criterion.condition} #{criterion.value}@b@                @b@                @b@                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}@b@                @b@                @b@                  and ${criterion.condition}@b@                  @b@                    #{listItem}@b@                  @b@                @b@              @b@            @b@          @b@        @b@      @b@    @b@  @b@  @b@    @b@      @b@        @b@          @b@            @b@              @b@                @b@                  and ${criterion.condition}@b@                @b@                @b@                  and ${criterion.condition} #{criterion.value}@b@                @b@                @b@                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}@b@                @b@                @b@                  and ${criterion.condition}@b@                  @b@                    #{listItem}@b@                  @b@                @b@              @b@            @b@          @b@        @b@      @b@    @b@  @b@  @b@    id, name, create_by, create_time, update_by, update_time@b@  @b@  @b@    select@b@    @b@      distinct@b@    @b@    @b@    from guser@b@    @b@      @b@    @b@    @b@      order by ${orderByClause}@b@    @b@  @b@  @b@    select @b@    @b@    from guser@b@    where id = #{id,jdbcType=INTEGER}@b@  @b@  @b@    delete from guser@b@    where id = #{id,jdbcType=INTEGER}@b@  @b@  @b@    delete from guser@b@    @b@      @b@    @b@  @b@  @b@    insert into guser (id, name, create_by, @b@      create_time, update_by, update_time@b@      )@b@    values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, @b@      #{createTime,jdbcType=DATE}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=DATE}@b@      )@b@  @b@  @b@    insert into guser@b@    @b@      @b@        id,@b@      @b@      @b@        name,@b@      @b@      @b@        create_by,@b@      @b@      @b@        create_time,@b@      @b@      @b@        update_by,@b@      @b@      @b@        update_time,@b@      @b@    @b@    @b@      @b@        #{id,jdbcType=INTEGER},@b@      @b@      @b@        #{name,jdbcType=VARCHAR},@b@      @b@      @b@        #{createBy,jdbcType=VARCHAR},@b@      @b@      @b@        #{createTime,jdbcType=DATE},@b@      @b@      @b@        #{updateBy,jdbcType=VARCHAR},@b@      @b@      @b@        #{updateTime,jdbcType=DATE},@b@      @b@    @b@  @b@  @b@    select count(*) from guser@b@    @b@      @b@    @b@  @b@  @b@    update guser@b@    @b@      @b@        id = #{record.id,jdbcType=INTEGER},@b@      @b@      @b@        name = #{record.name,jdbcType=VARCHAR},@b@      @b@      @b@        create_by = #{record.createBy,jdbcType=VARCHAR},@b@      @b@      @b@        create_time = #{record.createTime,jdbcType=DATE},@b@      @b@      @b@        update_by = #{record.updateBy,jdbcType=VARCHAR},@b@      @b@      @b@        update_time = #{record.updateTime,jdbcType=DATE},@b@      @b@    @b@    @b@      @b@    @b@  @b@  @b@    update guser@b@    set id = #{record.id,jdbcType=INTEGER},@b@      name = #{record.name,jdbcType=VARCHAR},@b@      create_by = #{record.createBy,jdbcType=VARCHAR},@b@      create_time = #{record.createTime,jdbcType=DATE},@b@      update_by = #{record.updateBy,jdbcType=VARCHAR},@b@      update_time = #{record.updateTime,jdbcType=DATE}@b@    @b@      @b@    @b@  @b@  @b@    update guser@b@    @b@      @b@        name = #{name,jdbcType=VARCHAR},@b@      @b@      @b@        create_by = #{createBy,jdbcType=VARCHAR},@b@      @b@      @b@        create_time = #{createTime,jdbcType=DATE},@b@      @b@      @b@        update_by = #{updateBy,jdbcType=VARCHAR},@b@      @b@      @b@        update_time = #{updateTime,jdbcType=DATE},@b@      @b@    @b@    where id = #{id,jdbcType=INTEGER}@b@  @b@  @b@    update guser@b@    set name = #{name,jdbcType=VARCHAR},@b@      create_by = #{createBy,jdbcType=VARCHAR},@b@      create_time = #{createTime,jdbcType=DATE},@b@      update_by = #{updateBy,jdbcType=VARCHAR},@b@      update_time = #{updateTime,jdbcType=DATE}@b@    where id = #{id,jdbcType=INTEGER}@b@  @b@

3.model层代码Guser.java、GuserExample.javapublic class Guser {@b@    private Integer id;@b@@b@    private String name;@b@@b@    private String createBy;@b@@b@    private Date createTime;@b@@b@    private String updateBy;@b@@b@    private Date updateTime;@b@@b@    public Integer getId() {@b@        return id;@b@    }@b@@b@    public void setId(Integer id) {@b@        this.id = id;@b@    }@b@@b@    public String getName() {@b@        return name;@b@    }@b@@b@    public void setName(String name) {@b@        this.name = name == null ? null : name.trim();@b@    }@b@@b@    public String getCreateBy() {@b@        return createBy;@b@    }@b@@b@    public void setCreateBy(String createBy) {@b@        this.createBy = createBy == null ? null : createBy.trim();@b@    }@b@@b@    public Date getCreateTime() {@b@        return createTime;@b@    }@b@@b@    public void setCreateTime(Date createTime) {@b@        this.createTime = createTime;@b@    }@b@@b@    public String getUpdateBy() {@b@        return updateBy;@b@    }@b@@b@    public void setUpdateBy(String updateBy) {@b@        this.updateBy = updateBy == null ? null : updateBy.trim();@b@    }@b@@b@    public Date getUpdateTime() {@b@        return updateTime;@b@    }@b@@b@    public void setUpdateTime(Date updateTime) {@b@        this.updateTime = updateTime;@b@    }@b@}public class GuserExample {@b@    protected String orderByClause;@b@@b@    protected boolean distinct;@b@@b@    protected List oredCriteria;@b@@b@    public GuserExample() {@b@        oredCriteria = new ArrayList();@b@    }@b@@b@    public void setOrderByClause(String orderByClause) {@b@        this.orderByClause = orderByClause;@b@    }@b@@b@    public String getOrderByClause() {@b@        return orderByClause;@b@    }@b@@b@    public void setDistinct(boolean distinct) {@b@        this.distinct = distinct;@b@    }@b@@b@    public boolean isDistinct() {@b@        return distinct;@b@    }@b@@b@    public List getOredCriteria() {@b@        return oredCriteria;@b@    }@b@@b@    public void or(Criteria criteria) {@b@        oredCriteria.add(criteria);@b@    }@b@@b@    public Criteria or() {@b@        Criteria criteria = createCriteriaInternal();@b@        oredCriteria.add(criteria);@b@        return criteria;@b@    }@b@@b@    public Criteria createCriteria() {@b@        Criteria criteria = createCriteriaInternal();@b@        if (oredCriteria.size() == 0) {@b@            oredCriteria.add(criteria);@b@        }@b@        return criteria;@b@    }@b@@b@    protected Criteria createCriteriaInternal() {@b@        Criteria criteria = new Criteria();@b@        return criteria;@b@    }@b@@b@    public void clear() {@b@        oredCriteria.clear();@b@        orderByClause = null;@b@        distinct = false;@b@    }@b@@b@    protected abstract static class GeneratedCriteria {@b@        protected List criteria;@b@@b@        protected GeneratedCriteria() {@b@            super();@b@            criteria = new ArrayList();@b@        }@b@@b@        public boolean isValid() {@b@            return criteria.size() > 0;@b@        }@b@@b@        public List getAllCriteria() {@b@            return criteria;@b@        }@b@@b@        public List getCriteria() {@b@            return criteria;@b@        }@b@@b@        protected void addCriterion(String condition) {@b@            if (condition == null) {@b@                throw new RuntimeException("Value for condition cannot be null");@b@            }@b@            criteria.add(new Criterion(condition));@b@        }@b@@b@        protected void addCriterion(String condition, Object value, String property) {@b@            if (value == null) {@b@                throw new RuntimeException("Value for " + property + " cannot be null");@b@            }@b@            criteria.add(new Criterion(condition, value));@b@        }@b@@b@        protected void addCriterion(String condition, Object value1, Object value2, String property) {@b@            if (value1 == null || value2 == null) {@b@                throw new RuntimeException("Between values for " + property + " cannot be null");@b@            }@b@            criteria.add(new Criterion(condition, value1, value2));@b@        }@b@@b@        protected void addCriterionForJDBCDate(String condition, Date value, String property) {@b@            if (value == null) {@b@                throw new RuntimeException("Value for " + property + " cannot be null");@b@            }@b@            addCriterion(condition, new java.sql.Date(value.getTime()), property);@b@        }@b@@b@        protected void addCriterionForJDBCDate(String condition, List values, String property) {@b@            if (values == null || values.size() == 0) {@b@                throw new RuntimeException("Value list for " + property + " cannot be null or empty");@b@            }@b@            List dateList = new ArrayList();@b@            Iterator iter = values.iterator();@b@            while (iter.hasNext()) {@b@                dateList.add(new java.sql.Date(iter.next().getTime()));@b@            }@b@            addCriterion(condition, dateList, property);@b@        }@b@@b@        protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) {@b@            if (value1 == null || value2 == null) {@b@                throw new RuntimeException("Between values for " + property + " cannot be null");@b@            }@b@            addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property);@b@        }@b@@b@        public Criteria andIdIsNull() {@b@            addCriterion("id is null");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andIdIsNotNull() {@b@            addCriterion("id is not null");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andIdEqualTo(Integer value) {@b@            addCriterion("id =", value, "id");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andIdNotEqualTo(Integer value) {@b@            addCriterion("id <>", value, "id");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andIdGreaterThan(Integer value) {@b@            addCriterion("id >", value, "id");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andIdGreaterThanOrEqualTo(Integer value) {@b@            addCriterion("id >=", value, "id");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andIdLessThan(Integer value) {@b@            addCriterion("id  values) {@b@            addCriterion("id in", values, "id");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andIdNotIn(List values) {@b@            addCriterion("id not in", values, "id");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andIdBetween(Integer value1, Integer value2) {@b@            addCriterion("id between", value1, value2, "id");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andIdNotBetween(Integer value1, Integer value2) {@b@            addCriterion("id not between", value1, value2, "id");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andNameIsNull() {@b@            addCriterion("name is null");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andNameIsNotNull() {@b@            addCriterion("name is not null");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andNameEqualTo(String value) {@b@            addCriterion("name =", value, "name");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andNameNotEqualTo(String value) {@b@            addCriterion("name <>", value, "name");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andNameGreaterThan(String value) {@b@            addCriterion("name >", value, "name");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andNameGreaterThanOrEqualTo(String value) {@b@            addCriterion("name >=", value, "name");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andNameLessThan(String value) {@b@            addCriterion("name  values) {@b@            addCriterion("name in", values, "name");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andNameNotIn(List values) {@b@            addCriterion("name not in", values, "name");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andNameBetween(String value1, String value2) {@b@            addCriterion("name between", value1, value2, "name");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andNameNotBetween(String value1, String value2) {@b@            addCriterion("name not between", value1, value2, "name");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andCreateByIsNull() {@b@            addCriterion("create_by is null");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andCreateByIsNotNull() {@b@            addCriterion("create_by is not null");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andCreateByEqualTo(String value) {@b@            addCriterion("create_by =", value, "createBy");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andCreateByNotEqualTo(String value) {@b@            addCriterion("create_by <>", value, "createBy");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andCreateByGreaterThan(String value) {@b@            addCriterion("create_by >", value, "createBy");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andCreateByGreaterThanOrEqualTo(String value) {@b@            addCriterion("create_by >=", value, "createBy");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andCreateByLessThan(String value) {@b@            addCriterion("create_by  values) {@b@            addCriterion("create_by in", values, "createBy");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andCreateByNotIn(List values) {@b@            addCriterion("create_by not in", values, "createBy");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andCreateByBetween(String value1, String value2) {@b@            addCriterion("create_by between", value1, value2, "createBy");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andCreateByNotBetween(String value1, String value2) {@b@            addCriterion("create_by not between", value1, value2, "createBy");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andCreateTimeIsNull() {@b@            addCriterion("create_time is null");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andCreateTimeIsNotNull() {@b@            addCriterion("create_time is not null");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andCreateTimeEqualTo(Date value) {@b@            addCriterionForJDBCDate("create_time =", value, "createTime");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andCreateTimeNotEqualTo(Date value) {@b@            addCriterionForJDBCDate("create_time <>", value, "createTime");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andCreateTimeGreaterThan(Date value) {@b@            addCriterionForJDBCDate("create_time >", value, "createTime");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {@b@            addCriterionForJDBCDate("create_time >=", value, "createTime");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andCreateTimeLessThan(Date value) {@b@            addCriterionForJDBCDate("create_time  values) {@b@            addCriterionForJDBCDate("create_time in", values, "createTime");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andCreateTimeNotIn(List values) {@b@            addCriterionForJDBCDate("create_time not in", values, "createTime");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andCreateTimeBetween(Date value1, Date value2) {@b@            addCriterionForJDBCDate("create_time between", value1, value2, "createTime");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {@b@            addCriterionForJDBCDate("create_time not between", value1, value2, "createTime");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andUpdateByIsNull() {@b@            addCriterion("update_by is null");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andUpdateByIsNotNull() {@b@            addCriterion("update_by is not null");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andUpdateByEqualTo(String value) {@b@            addCriterion("update_by =", value, "updateBy");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andUpdateByNotEqualTo(String value) {@b@            addCriterion("update_by <>", value, "updateBy");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andUpdateByGreaterThan(String value) {@b@            addCriterion("update_by >", value, "updateBy");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andUpdateByGreaterThanOrEqualTo(String value) {@b@            addCriterion("update_by >=", value, "updateBy");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andUpdateByLessThan(String value) {@b@            addCriterion("update_by  values) {@b@            addCriterion("update_by in", values, "updateBy");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andUpdateByNotIn(List values) {@b@            addCriterion("update_by not in", values, "updateBy");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andUpdateByBetween(String value1, String value2) {@b@            addCriterion("update_by between", value1, value2, "updateBy");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andUpdateByNotBetween(String value1, String value2) {@b@            addCriterion("update_by not between", value1, value2, "updateBy");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andUpdateTimeIsNull() {@b@            addCriterion("update_time is null");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andUpdateTimeIsNotNull() {@b@            addCriterion("update_time is not null");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andUpdateTimeEqualTo(Date value) {@b@            addCriterionForJDBCDate("update_time =", value, "updateTime");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andUpdateTimeNotEqualTo(Date value) {@b@            addCriterionForJDBCDate("update_time <>", value, "updateTime");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andUpdateTimeGreaterThan(Date value) {@b@            addCriterionForJDBCDate("update_time >", value, "updateTime");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {@b@            addCriterionForJDBCDate("update_time >=", value, "updateTime");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andUpdateTimeLessThan(Date value) {@b@            addCriterionForJDBCDate("update_time  values) {@b@            addCriterionForJDBCDate("update_time in", values, "updateTime");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andUpdateTimeNotIn(List values) {@b@            addCriterionForJDBCDate("update_time not in", values, "updateTime");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andUpdateTimeBetween(Date value1, Date value2) {@b@            addCriterionForJDBCDate("update_time between", value1, value2, "updateTime");@b@            return (Criteria) this;@b@        }@b@@b@        public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {@b@            addCriterionForJDBCDate("update_time not between", value1, value2, "updateTime");@b@            return (Criteria) this;@b@        }@b@    }@b@@b@    public static class Criteria extends GeneratedCriteria {@b@@b@        protected Criteria() {@b@            super();@b@        }@b@    }@b@@b@    public static class Criterion {@b@        private String condition;@b@@b@        private Object value;@b@@b@        private Object secondValue;@b@@b@        private boolean noValue;@b@@b@        private boolean singleValue;@b@@b@        private boolean betweenValue;@b@@b@        private boolean listValue;@b@@b@        private String typeHandler;@b@@b@        public String getCondition() {@b@            return condition;@b@        }@b@@b@        public Object getValue() {@b@            return value;@b@        }@b@@b@        public Object getSecondValue() {@b@            return secondValue;@b@        }@b@@b@        public boolean isNoValue() {@b@            return noValue;@b@        }@b@@b@        public boolean isSingleValue() {@b@            return singleValue;@b@        }@b@@b@        public boolean isBetweenValue() {@b@            return betweenValue;@b@        }@b@@b@        public boolean isListValue() {@b@            return listValue;@b@        }@b@@b@        public String getTypeHandler() {@b@            return typeHandler;@b@        }@b@@b@        protected Criterion(String condition) {@b@            super();@b@            this.condition = condition;@b@            this.typeHandler = null;@b@            this.noValue = true;@b@        }@b@@b@        protected Criterion(String condition, Object value, String typeHandler) {@b@            super();@b@            this.condition = condition;@b@            this.value = value;@b@            this.typeHandler = typeHandler;@b@            if (value instanceof List>) {@b@                this.listValue = true;@b@            } else {@b@                this.singleValue = true;@b@            }@b@        }@b@@b@        protected Criterion(String condition, Object value) {@b@            this(condition, value, null);@b@        }@b@@b@        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {@b@            super();@b@            this.condition = condition;@b@            this.value = value;@b@            this.secondValue = secondValue;@b@            this.typeHandler = typeHandler;@b@            this.betweenValue = true;@b@        }@b@@b@        protected Criterion(String condition, Object value, Object secondValue) {@b@            this(condition, value, secondValue, null);@b@        }@b@    }@b@}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值