mybatisplus 函数
时间: 2023-08-25 09:12:05 浏览: 47
MybatisPlus 是一个基于 MyBatis 的增强工具,它提供了很多便捷的函数,例如:
1. selectOne:查询一条记录;
2. selectList:查询多条记录;
3. selectMaps:查询多条记录,返回 Map 集合;
4. selectPage:分页查询;
5. insert:插入一条记录;
6. updateById:根据 ID 更新一条记录;
7. deleteById:根据 ID 删除一条记录;
8. deleteBatchIds:根据多个 ID 批量删除记录;
9. selectCount:查询记录总数;
10. selectObjs:查询单个字段值列表。
除了上面这些常用的函数外,MybatisPlus 还提供了很多其他的函数,可以根据具体的业务需求选择使用。
相关问题
mybatisplus函数
MyBatis-Plus 是一个 MyBatis 的增强工具,在 MyBatis 的基础上增加了许多实用的功能,其中包括函数。
MyBatis-Plus 的函数可以通过在 XML 配置文件中使用 ${funcName(args)} 的形式来调用。以下是 MyBatis-Plus 支持的函数:
1. 数学函数:支持 abs、mod、sqrt、exp、ln、log、log10、power、round、sign、trunc、acos、asin、atan、cos、cot、degrees、radians、sin、tan 等数学函数。
2. 字符串函数:支持 concat、substring、instr、lpad、rpad、trim、lower、upper、replace、length、ascii、char、initcap、regexp_replace、regexp_substr 等字符串函数。
3. 日期函数:支持 current_date、current_time、current_timestamp、date、time、timestamp、year、month、day、hour、minute、second 等日期函数。
4. 条件函数:支持 ifnull、if、case、coalesce 等条件函数。
5. 其他函数:支持 cast、soundex、user 等其他函数。
使用 MyBatis-Plus 函数可以使 SQL 语句更加简洁、易读,提高开发效率。
mybatisplus函数有哪些
MyBatis-Plus 是一个 MyBatis 的增强工具,在 MyBatis 的基础上提供了许多实用的功能,其中就包括了一些常用的函数。以下是部分 MyBatis-Plus 函数的介绍:
1. `eq`:等于
2. `ne`:不等于
3. `gt`:大于
4. `ge`:大于等于
5. `lt`:小于
6. `le`:小于等于
7. `like`:模糊查询
8. `notLike`:不匹配模式
9. `in`:包含在集合中
10. `notIn`:不包含在集合中
11. `isNull`:是否为 NULL
12. `isNotNull`:是否不为 NULL
13. `between`:在指定的两个值之间
14. `notBetween`:不在指定的两个值之间
15. `exists`:是否存在子查询结果
16. `notExists`:是否不存在子查询结果
17. `groupBy`:分组查询
以上仅是 MyBatis-Plus 函数的部分介绍,还有更多实用的函数可以使用。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)