public class Query<T> extends QueryCondition<T> implements QueryExecuteI<T>, QueryOtherI<Query>
@{code
Query query = ... ;
List list = query.andEq("name","lijz").select();
} AND, BETWEEN, distinct, groupBy, IN, NOT_BETWEEN, NOT_IN, OR, orderBy, params, sql, sqlManager, startRow, WHERE| 构造器和说明 |
|---|
Query(SQLManager sqlManager,
Class<T> clazz) |
| 限定符和类型 | 方法和说明 |
|---|---|
Query<T> |
asc(String column) |
Query<T> |
condition()
获取一个新条件
|
long |
count()
count
|
int |
delete()
删除
|
Query<T> |
desc(String column) |
static StrongValue |
filterEmpty(Object value)
过滤空和NULL的值,
如果为空或者null则不增加查询条件
|
static StrongValue |
filterNull(Object value)
过滤空和NULL的值,
如果为空或者null则不增加查询条件
|
Query<T> |
groupBy(String column)
groupBy 子句
|
Query<T> |
having(QueryCondition condition)
having子句
|
int |
insert(T t)
全部插入,包括插入null值
|
int |
insertSelective(T t)
有选择的插入,null不插入
|
LambdaQuery<T> |
lambda()
已过时。
|
Query<T> |
limit(Object startRow,
long pageSize)
默认从1开始,自动翻译成数据库的起始位置。
|
PageResult<Map> |
mapPage(long pageNumber,
long pageSize,
String... columns)
分页查询结果集,结果集每一条并映射到map
|
PageResult<Map> |
mapPage(PageRequest pageRequest,
String... columns) |
List<Map> |
mapSelect(String... columns)
查询结果集,结果集每一条并映射到map
|
Map |
mapSingle(String... columns)
查询一条记录,映射到Map
|
Query<T> |
orderBy(String orderBy)
orderBy 子句
例如 orderBy id desc,user_id asc
|
<K> PageResult<K> |
page(long pageNumber,
long pageSize,
Class<K> retType,
String... columns)
分页查询,并映射到指定类上
|
PageResult<T> |
page(long pageNumber,
long pageSize,
String... columns)
指定字段查询分页查询,不传入字段查询所有 SELECT *
|
<K> PageResult<K> |
page(PageRequest pageRequest,
Class<K> retType,
String... columns) |
PageResult<T> |
page(PageRequest pageRequest,
String... columns) |
protected <K> PageResult<K> |
pageByType(PageRequest pageRequest,
Class<K> retType,
String... columns) |
PageResult<T> |
pageSimple(long pageNumber,
long pageSize)
简单字段分页查询
|
PageResult<T> |
pageSimple(PageRequest pageRequest) |
List<T> |
select() |
<K> List<K> |
select(Class<K> retType,
String... columns)
查询,并映射到指定类上
|
List<T> |
select(String... columns)
指定字段查询,不传时查询所有
|
protected <K> List<K> |
selectByType(Class<K> retType,
String... columns) |
List<T> |
selectSimple()
查询简单字段
|
T |
single(String... columns)
查询出一条,如果没有,返回null
|
T |
singleSimple()
查询简单字段
|
T |
unique(String... cols)
查询一条,如果没有或者有多条,抛异常
|
T |
uniqueSimple()
查询一条,如果没有或者有多条,抛异常
|
int |
update(Object t)
全部更新,包括更新null值
|
int |
updateSelective(Object t)
有选择的更新
|
Query<T> |
useCondition(QueryCondition condition)
重用,比如在count前,调用此方法会获取count的参数,此参数可以用于select
|
addParam, addParam, addPreParam, and, andBetween, andEq, andGreat, andGreatEq, andIn, andIn, andIn, andIsNotNull, andIsNull, andLess, andLessEq, andLike, andNotBetween, andNotEq, andNotIn, andNotIn, andNotIn, andNotLike, appendAndSql, appendBetweenSql, appendInSql, appendOrSql, appendSql, appendSqlBase, clear, distinct, getCol, getColTrunk, getParams, getSql, getTableName, or, orBetween, orEq, orGreat, orGreatEq, orIn, orIn, orIn, orIsNotNull, orIsNull, orLess, orLessEq, orLike, orNotBetween, orNotEq, orNotIn, orNotIn, orNotIn, orNotLike, setSqlclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsingle, uniquepublic Query(SQLManager sqlManager, Class<T> clazz)
@Deprecated public LambdaQuery<T> lambda()
public List<T> select(String... columns)
QueryExecuteIselect 在接口中 QueryExecuteI<T>public List<T> select()
select 在接口中 QueryExecuteI<T>public List<T> selectSimple()
QueryExecuteIselectSimple 在接口中 QueryExecuteI<T>public T single(String... columns)
QueryExecuteIsingle 在接口中 QueryExecuteI<T>public Map mapSingle(String... columns)
QueryExecuteImapSingle 在接口中 QueryExecuteI<T>public T singleSimple()
QueryExecuteIsingleSimple 在接口中 QueryExecuteI<T>public T uniqueSimple()
QueryExecuteIuniqueSimple 在接口中 QueryExecuteI<T>public T unique(String... cols)
QueryExecuteIunique 在接口中 QueryExecuteI<T>public <K> List<K> select(Class<K> retType, String... columns)
QueryExecuteIselect 在接口中 QueryExecuteI<T>public List<Map> mapSelect(String... columns)
QueryExecuteImapSelect 在接口中 QueryExecuteI<T>public int update(Object t)
QueryExecuteIupdate 在接口中 QueryExecuteI<T>public int updateSelective(Object t)
QueryExecuteIupdateSelective 在接口中 QueryExecuteI<T>t - 任意对象或者Mappublic int insert(T t)
QueryExecuteIinsert 在接口中 QueryExecuteI<T>public int insertSelective(T t)
QueryExecuteIinsertSelective 在接口中 QueryExecuteI<T>public int delete()
QueryExecuteIdelete 在接口中 QueryExecuteI<T>public long count()
QueryExecuteIcount 在接口中 QueryExecuteI<T>public PageResult<T> pageSimple(PageRequest pageRequest)
pageSimple 在接口中 QueryExecuteI<T>public Query<T> having(QueryCondition condition)
QueryOtherIhaving 在接口中 QueryOtherI<Query>public Query<T> groupBy(String column)
QueryOtherIgroupBy 在接口中 QueryOtherI<Query>public Query<T> orderBy(String orderBy)
QueryOtherIorderBy 在接口中 QueryOtherI<Query>public Query<T> limit(Object startRow, long pageSize)
limit 在接口中 QueryOtherI<Query>startRow - 开始行数(包含)protected <K> PageResult<K> pageByType(PageRequest pageRequest, Class<K> retType, String... columns)
public PageResult<T> page(PageRequest pageRequest, String... columns)
page 在接口中 QueryExecuteI<T>public <K> PageResult<K> page(PageRequest pageRequest, Class<K> retType, String... columns)
page 在接口中 QueryExecuteI<T>public PageResult<Map> mapPage(PageRequest pageRequest, String... columns)
mapPage 在接口中 QueryExecuteI<T>public PageResult<T> page(long pageNumber, long pageSize, String... columns)
QueryExecuteIpage 在接口中 QueryExecuteI<T>public PageResult<T> pageSimple(long pageNumber, long pageSize)
QueryExecuteIpageSimple 在接口中 QueryExecuteI<T>public <K> PageResult<K> page(long pageNumber, long pageSize, Class<K> retType, String... columns)
QueryExecuteIpage 在接口中 QueryExecuteI<T>public PageResult<Map> mapPage(long pageNumber, long pageSize, String... columns)
QueryExecuteImapPage 在接口中 QueryExecuteI<T>public static StrongValue filterEmpty(Object value)
value - public static StrongValue filterNull(Object value)
value - public Query<T> useCondition(QueryCondition condition)
useCondition 在接口中 QueryExecuteI<T>condition - Copyright © 2021. All rights reserved.