mybatisplus 函数
时间: 2023-07-30 18:06:53 浏览: 44
MyBatis-Plus 是一个 MyBatis 的增强工具,在 MyBatis 的基础上只做增强不做改变,为简化开发、提高效率而生。MyBatis-Plus 提供了非常丰富的 API,其中包括了很多常用的函数,比如:
1. selectOne:查询单条记录。
2. selectList:查询多条记录。
3. selectPage:分页查询记录。
4. insert:插入记录。
5. update:更新记录。
6. delete:删除记录。
7. selectCount:查询记录数。
8. selectMaps:查询结果以 Map 的形式返回。
9. selectObjs:查询结果以 Object 的形式返回。
10. selectByMap:根据条件查询记录。
11. selectBatchIds:根据主键批量查询记录。
12. insertBatch:批量插入记录。
13. updateBatchById:根据主键批量更新记录。
14. deleteBatchIds:根据主键批量删除记录。
除此之外,MyBatis-Plus 还提供了很多其他实用的函数,如 LambdaQueryWrapper、QueryWrapper、UpdateWrapper、EntityWrapper 等,可以方便地进行条件构造和查询。
相关问题
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_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)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)