类 QueryWrapper<T>
- 所有已实现的接口:
Serializable,Cloneable,Map<String,Object>
查询包装对象:
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);
- 作者:
- lingkang
- 另请参阅:
-
嵌套类概要
从类继承的嵌套类/接口 java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
构造器概要
构造器 -
方法概要
从类继承的方法 java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, newHashMap, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values从类继承的方法 java.util.AbstractMap
equals, hashCode, toString
-
构造器详细资料
-
QueryWrapper
-
-
方法详细资料
-
addParam
添加参数,sql中的参数只能用 #{paramName}
代码例子:QueryWrapper<UserEntity> query = mapperManage.createQuery( "select * from t_user where id>#{id}", UserEntity.class); query.addParam("id",2);// 参数 id List<UserEntity> list = query.getList();- 参数:
name- 参数名value- 参数值- 返回:
- 查询包装对象
-
addParam
添加 map 参数 -
getList
查询返回列表- 返回:
- 查询结果,不为空。无结果时返回 new ArrayList无效输入:'<'>()
-
getOne
查询一个对象,若结果有多个,会抛出异常- 返回:
- 实体对象、null 等
-