1. 程式人生 > >MyBatisPlus各種API

MyBatisPlus各種API

刪除 oba 記錄 tag style let oca use paginati

// 初始化 成功標識
boolean result = false;
// 初始化 User
User user = new User();

// 保存 User
user.setName("Tom");
result = user.insert();

// 更新 User
user.setAge(18);
result = user.updateById();

// 查詢 User
User exampleUser = t1.selectById();

// 查詢姓名為‘張三’的所有用戶記錄
List<User> userList1 = user.selectList(
    newEntityWrapper
<User>().eq("name", "張三") ); // 刪除 User result = t2.deleteById();

MyBatisPlus配置結構(參考):

MybatisSqlSessionFactoryBean

typeAliasesPackage

mapperLocations

configuration

globalConfig

plugins

paginationInterceptor

optimisticLockerInterceptor

performanceInterceptor

MybatisConfiguration

GlobalConfiguration

LogicSqlInjector

MapperScannerConfigurer

MyBatisPlus各種API