1.Example常用函数         mybatis的逆向工程中会生成实例以及实例对应的example,example用于添加条件,相当于where后面的部分。         Example    example    =new    Example(实体类.class);         example.createCriteria().添加条件         常用函数如下:         (1)example.setDistinct(false):去除重复,boolean类型,true表示选择不重复的记录。         (2)example.setOrderByClause(“字段名  ASC ”):添加升序排列条件,DESC为降序。         (3)example.createCriteria().andEqualTo("xxx字段",value):添加xxx字段等于value的条件。         (4)example.createCriteria().andNotEqualTo("xxx字段",value):添加xxx字段不等于value的条件。         (5)example.createCriteria().andCreaterThan("xxx字段",value):添加xxx字段大于value的条件。         (6)example.createCriteria().andLessThan("xxx字段",value):添加xxx字段名小于value的条件。         (7)example.createCriteria().andLessThanOrEqualTo("xxx字段",value):添加字段名小于等于value的条件。         (8)example.createCriteria().andIn(List<?>):添加字段值在List<?>中的条件。         (9)example.createCriteria().andNotIn(List<?>):添加字段值不在List<?>中的条件。         (10)example.createCriteria().andLike("xxx字段","%"+value+"%"):添加xxx字段值为value的模糊查询。         (11)example.createCriteria().andNotLike("xxx字段","%"+value+"%"):添加xxx字段值不为value的模糊查询。         (12)example.createCriteria().andBetween("value1,value2):添加xxx字段值在value1和value2之间的条件。         (13)example.createCriteria().andNotBetween("value1,value2):添加xxx字段值不在value1和value2之间的条件。         (14)example.createCriteria().andIsNull("xxx字段",value):添加xxx字段值为null的条件。         (15)example.createCriteria().andIsNotNull("xxx字段",value):添加xxx字段值不为null的条件。 2.Mapper常用接口         (1)int  countByExample(example):按条件计数。         (2)int  updateByExample(实体类,example):按条件更新。         (3)int  updateByExampleSelective(实体类,example):按条件更新部位null的字段。         (4)int  updateByPrimaryKey(实体类):按主键更新。         (5)int  countByPrimaryKeySelective(实体类):按主键更新不为null的字段。         (6)int  deleteByPrimaryKey(id):按主键删除。         (7)int  deleteByExample(example):按条件删除。         (8)String/Integer  insert(实体类):插入数据(返回值为id)。         (9)返回值类型  selectByPrimaryKey(id):按主键查询。         (10)返回值类型  selectByExample(example):按条件查询。         (11)int  selectByExampleWithBLOGS(example):按条件查询(包括BLOB)字段。只有当数据表中的字段类型有为二进制时才会产生。