BaseMapper | |
Integer insert(T entity) | 插入一条记录 |
Integer insertAllColumn(T entity) | 插入全部字段的记录 |
Integer deleteById(Serializable id) | 根据ID删除记录 |
Integer deleteByMap(@Param("cm")Map<String,Object>columMap) | 根据表字段columMap条件,删除记录 |
Integer delete(@Param("ew") Wrapper<T> wrapper) | 根据wrapper包装条件删除记录 |
Integer deleteBatchIds(@Param("coll")Collection<? extends SerialIzable> idList ) | 根据ids批量删除 |
Integer updateById(@Param("et") T entity) | 根据id修改 |
Integer updateAllColumnById(@Param("et")T entity) | 根据di修改 |
Integer update(@Param("et")T entity,@Param("ew")Wrapper<T> wrapper) | 根据wrapper包装条件更新记录 |
T selectById(Serializable id) | 根据主键id查询记录 |
List<T> selectBatchIds(@Param("coll")Collection<? extends Serializable> idList) | 根据id批量查询 |
List<T> selectByMap(@Param("cm")Map<String,Object> columMap) | 根据columMap查询 |
T selectOne(@Param("ew")T entity) | 根据entity对象查询一条记录 |
Integer selectCount(@Param("ew") Wrapper<T> wrapper) | 根据wrapper条件查询记录数 |
List<T> selectList(@Param("ew") Wrapper<T> wrapper) | 根据封装条件查询记录 |
List<Map<String,Object>> selectMaps(@Param("ew") Wrapper<T> wrapper) | 根据wrapper条件查询 |
List<Object> selectObjs(@Param("ew") Wrapper<T> wrapper) | |
List<T> selectPage(RowBounds rowbounds,@Param("ew") Wrapper<T> wrapper) | |
List<Map<String,Object>> selectMapsPage(RowBounds rowbounds,@Param("ew") Wrapper<T> wrapper) |
条件参数说明
查询方式 | 说明 |
---|---|
setSqlSelect | 设置 SELECT 查询字段 |
where | WHERE 语句,拼接 + WHERE 条件 |
and | AND 语句,拼接 + AND 字段=值 |
andNew | AND 语句,拼接 + AND (字段=值) |
or | OR 语句,拼接 + OR 字段=值 |
orNew | OR 语句,拼接 + OR (字段=值) |
eq | 等于= |
allEq | 基于 map 内容等于= |
ne | 不等于<> |
gt | 大于> |
ge | 大于等于>= |
lt | 小于< |
le | 小于等于<= |
like | 模糊查询 LIKE |
notLike | 模糊查询 NOT LIKE |
in | IN 查询 |
notIn | NOT IN 查询 |
isNull | NULL 值查询 |
isNotNull | IS NOT NULL |
groupBy | 分组 GROUP BY |
having | HAVING 关键词 |
orderBy | 排序 ORDER BY |
orderAsc | ASC 排序 ORDER BY |
orderDesc | DESC 排序 ORDER BY |
exists | EXISTS 条件语句 |
notExists | NOT EXISTS 条件语句 |
between | BETWEEN 条件语句 |
notBetween | NOT BETWEEN 条件语句 |
addFilter | 自由拼接 SQL |
last | 拼接在最后,例如:last("LIMIT 1") |