QueryWrapper queryWrapper = new QueryWrapper<>();
通过select()查询指定字段,同时可对字段进行Mysql函数处理
1 |
queryWrapper.select("service_code as serviceCode", "sum(num) as num"); |
通过last(),效果等同于limit
1 |
queryWrapper.last("limit 0,5"); |
例如,在查询IP时,想使用INET_ATON()函数,可以使用apply()实现
1 2 |
queryWrapper.apply("INET_ATON(qsip) <= INET_ATON({0})", ipQuery); queryWrapper.apply("INET_ATON(zzip) >= INET_ATON({0})", ipQuery); |
from:https://blog.csdn.net/qq_42594278/article/details/106625280