1.映射数据库中不存在的字段
TableField(exist=false)
2.
@Select(“seclect * from user”)
List<User> selectAll();
3.
@Select("select * from t_user")
@Results(
@Result(column = "id",property = "id")@Result(column = "username",property = "username")
@Result(column = "password",property = "password")
@Result(column ="birthday",property = "birthday"),@Result(column = "id",property = "orders",javaType = List.class,many=@Many(select = "com.example.mpdemo.mapper.OrderMapper.selectByUid")
List<User> selectAllUserAndOrders();
4.分页
@Configuration
public class MyBatisPlusConfig {
@Bean
public MybatisPlusInterceptor paginationInterceptor() MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();PaqinationInnerInterceptor paginationInterceptor = new PaginationInnerInterceptor(DbType)interceptor.addInnerInterceptor(paginationInterceptor);return interceptor:
}
}
@RequestMapping("getkc1")
public IPage getkc1(){
Page<Kecheng> page=new Page<>(0,2);
IPage ipage=kechengDao.selectPage(page,null);
return ipage;
}