| 程序包 | 说明 |
|---|---|
| top.lingkang.mm.orm |
| 类和说明 |
|---|
| Condition |
| MapperManage
对表数据进行正删改查,若要更新更复杂的sql,请使用mapper.xml进行编写
|
| MapperManageImpl |
| Query |
| QueryColumn |
| QueryWrapper
查询包装对象:
QueryWrapper<UserEntity> query = mapperManage.createQuery(
"select * from t_user where id>#{id}",
UserEntity.class);
query.addParam("id", 2);
List<UserEntity> list = query.getList();
System.out.println(list);
|
| UpadateWrapper
更新包装对象,例1 :
UpadateWrapper update = mapperManage.createUpdate("update t_user set password=#{p} where id=#{id}");
update.addParam("p", System.currentTimeMillis()).addParam("id", 1);
int execute = update.execute();
log.info("受影响行数: {}", execute);
例2:
UpadateWrapper update = mapperManage.createUpdate("insert into t_user(id,username) values (2,#{un})");
update.addParam("un", "lk");
int execute = update.execute();
log.info("受影响行数: {}", execute);
|
Copyright © 2024 lingkang. All rights reserved.