public final class Methods extends Object
| 构造器和说明 |
|---|
Methods() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Abs |
abs(Cmd column)
abs绝对值 函数
|
static Acos |
acos(Cmd column)
求反余弦值 函数
|
static Asin |
asin(Cmd column)
求反正弦值 函数
|
static Atan |
atan(Cmd column)
求反正切值 函数
|
static Avg |
avg(Cmd column)
avg平局值 函数
|
static Between |
between(Cmd column,
Object value,
Object value2)
between 区间判断
|
static Case |
case_()
case 语句块
|
static Ceil |
ceil(Cmd column)
ceil返回大于或等于 x 的最小整数(向上取整) 函数
|
static CharLength |
charLength(Cmd column)
返回字符串的字符数
|
static Cmd |
cmd(Object value)
将value转成Cmd对象;普通值将转成为BasicValue
|
static <T> Column |
column(Getter<T> column)
将指定列名转成 Column
|
static Column |
column(IDataset dataset,
String column)
将指定列名转成 Column
|
static Column |
column(String column)
将指定列名转成 Column
|
static Concat |
concat(Cmd column,
Object... values)
concat拼接 函数
|
static ConcatWs |
concatWs(Cmd column,
String split,
Object... values)
concatWs拼接 函数
|
static Cos |
cos(Cmd column)
求余弦值 函数
|
static Cot |
cot(Cmd column)
求余切值 函数
|
static Count |
count(Cmd column)
count条数 函数
|
static Count |
count(Cmd column,
boolean distinct)
count条数 函数
|
static Count1 |
count1()
count(1) 条数 函数
|
static CountAll |
countAll()
count(*) 条数 函数
|
static ConditionTemplate |
cTpl(boolean wrapping,
String template,
Object... params)
创建条件sql模板
|
static ConditionTemplate |
cTpl(String template,
Object... params)
创建条件sql模板
|
static CurrentDate |
currentDate()
当前日期
|
static CurrentDateTime |
currentDateTime()
当前时间(包含日期、时分秒)
|
static CurrentTime |
currentTime()
当前时间(不包含日期)
|
static DateFormat |
date(Cmd column)
获取日期部分,不包含时分秒
|
static DateAdd |
dateAdd(Cmd column,
int n)
日期增加
|
static DateAdd |
dateAdd(Cmd column,
int n,
TimeUnits timeUnit)
日期增加
|
static DateDiff |
dateDiff(Cmd column,
Cmd another)
日期比较
|
static DateFormat |
dateFormat(Cmd column,
DatePattern pattern)
格式化时间
|
static DateFormat |
dateFormat(Cmd column,
String pattern)
格式化时间
|
static DateAdd |
dateSub(Cmd column,
int n)
日期减少
|
static DateAdd |
dateSub(Cmd column,
int n,
TimeUnits timeUnit)
日期减少
|
static Day |
day(Cmd column)
获取column的第几天
|
static Degrees |
degrees(Cmd column)
将弧度转换为角度 函数
|
static Divide |
divide(Cmd column,
Cmd value)
divide除法
|
static Divide |
divide(Cmd column,
Number value)
multiply乘法
|
static Empty |
empty(Cmd column)
为空 判断
|
static Eq |
eq(Cmd column,
Object value)
eq等于 判断
|
static Exists |
exists(IQuery query)
exists 一个查询
|
static Exp |
exp(int n)
返回 e 的 n 次方 函数
|
static FALSE |
FALSE()
对应SQL中的true;创建一个始终TRUE条件
方便开发者使用
|
static Floor |
floor(Cmd column)
floor返回小于或等于 x 的最大整数(向下取整) 函数
|
static FunTemplate |
fTpl(boolean wrapping,
String template,
Object... params)
创建函数sql模板
|
static FunTemplate |
fTpl(String template,
Object... params)
创建函数sql模板
|
static GroupConcat |
groupConcat(Cmd column)
分组后对列拼接 函数
默认是逗号拼接
|
static GroupConcat |
groupConcat(Cmd column,
String split)
分组后对列拼接 函数
|
static Gt |
gt(Cmd column,
Object value)
gt大于 判断
|
static Gte |
gte(Cmd column,
Object value)
gte大于等于 判断
|
static Hour |
hour(Cmd column)
获取column的小时部分
|
static DateAdd |
hourAdd(Cmd column,
int n)
小时增
|
static DateAdd |
hourSub(Cmd column,
int n)
小时减少
|
static If |
if_(Condition condition,
Cmd value,
Cmd thenValue)
IF(条件,值1,值2) 函数
|
static If |
if_(Condition condition,
Cmd value,
Serializable thenValue)
if(条件,值1,值2) 函数
|
static If |
if_(Condition condition,
Serializable value,
Cmd thenValue)
if(条件,值1,值2) 函数
|
static If |
if_(Condition condition,
Serializable value,
Serializable thenValue)
if(条件,值1,值2) 函数
|
static IfNull |
ifNull(Cmd column,
Cmd value)
IFNULL(条件,值1,值2) 函数
|
static IfNull |
ifNull(Cmd column,
Serializable value)
IFNULL(条件,值1,值2) 函数
|
static ILike |
iLike(Cmd column,
Object value)
like 判断
|
static ILike |
iLike(LikeMode mode,
Cmd column,
Object value)
like 判断
|
static In |
in(Cmd column,
Collection<?> values)
in 多个值
|
static In |
in(Cmd column,
IQuery query)
in 一个查询
|
static In |
in(Cmd column,
Object... values)
in 多个值
|
static InetAton |
inetAton(Cmd column)
将ip转成数字
|
static InetAton |
inetAton(String ip)
将ip转成数字
|
static InetNtoa |
inetNtoa(Cmd column)
将ip数字转成ip
|
static InetNtoa |
inetNtoa(Number ipNumber)
将ip数字转成ip
|
static Instr |
instr(Cmd column,
String str)
返回目标字符(串)在源字符串字符串中出现的起始位置
|
static Eq |
isEmpty(Cmd column)
column列 为空
|
static Ne |
isNotEmpty(Cmd column)
column 列 不为空
|
static IsNotNull |
isNotNull(Cmd column)
column 列 is NOT NULL
|
static IsNull |
isNull(Cmd column)
column 列 is NOT NULL
|
static Left |
left(Cmd column,
int length)
左边截取
|
static Length |
length(Cmd column)
返回字符串的长度 函数
|
static Like |
like(Cmd column,
Object value)
like 判断
|
static Like |
like(LikeMode mode,
Cmd column,
Object value)
like 判断
|
static Object |
likeParamWrap(Cmd column,
Object param,
LikeMode mode,
boolean isNotLike)
LIKE 参数包装
|
static Log |
log(Cmd base,
int number)
以base为底,求number自然对数
|
static Lower |
lower(Cmd column)
转换成小写 函数
|
static Lpad |
lpad(Cmd column,
int length,
String pad)
从左边开始填充
|
static Lt |
lt(Cmd column,
Object value)
gt小于 判断
|
static Lte |
lte(Cmd column,
Object value)
gt小于等于 判断
|
static Ltrim |
ltrim(Cmd column)
删除左边空格
|
static Max |
max(Cmd column)
max最大 函数
|
static Min |
min(Cmd column)
min最小 函数
|
static DateAdd |
minuteAdd(Cmd column,
int n)
分增加
|
static DateAdd |
minuteSub(Cmd column,
int n)
分减少
|
static Mod |
mod(Cmd column,
Number divisor)
mod 取模 函数
|
static Month |
month(Cmd column)
获取月份
|
static DateAdd |
monthAdd(Cmd column,
int n)
月增加
|
static DateAdd |
monthSub(Cmd column,
int n)
月减少
|
static Multiply |
multiply(Cmd column,
Cmd value)
multiply乘法
|
static Multiply |
multiply(Cmd column,
Number value)
multiply乘法
|
static MysqlFunctions |
mysql()
获得 mysql的函数聚合类
|
static MysqlFunctions |
mysql(Cmd column)
获得 mysql的函数聚合类
|
static Field |
mysqlFiled(Cmd column,
Object... values)
匹配key 在values里的位置 从1 开始
|
static FindInSet |
mysqlFindInSet(Cmd column,
Number match)
匹配 match 在 key里边的位置
column 需要符合逗号分割规范
|
static FindInSet |
mysqlFindInSet(Cmd column,
String match)
匹配 match 在 key里边的位置
column 需要符合逗号分割规范
|
static FromUnixTime |
mysqlFromUnixTime(Cmd column)
mysql fromUnixTime 函数
|
static JsonContains |
mysqlJsonContains(Cmd column,
Serializable containValue)
mysql fromUnixTime 函数
|
static JsonContains |
mysqlJsonContains(Cmd column,
Serializable containValue,
String path)
mysql json 是否包含值
|
static JsonContainsPath |
mysqlJsonContainsPath(Cmd column,
boolean allMatch,
String... paths)
mysql json 是否包含路径
|
static JsonContainsPath |
mysqlJsonContainsPath(Cmd column,
String... paths)
mysql json 是否包含路径
|
static JsonExtract |
mysqlJsonExtract(Cmd column,
String... paths)
mysql json 值提取操作
|
static Md5 |
mysqlMd5(Cmd column)
md5
|
static Md5 |
mysqlMd5(String str)
md5
|
static Ne |
ne(Cmd column,
Object value)
ne不等于 判断
|
static NotBetween |
notBetween(Cmd column,
Object value,
Object value2)
not between 区间判断
|
static NotEmpty |
notEmpty(Cmd column)
不为空 判断
|
static NotExists |
notExists(IQuery query)
not exists 一个查询
|
static NotILike |
notILike(Cmd column,
Object value)
notLike 判断
|
static NotILike |
notILike(LikeMode mode,
Cmd column,
Object value)
not like 判断
|
static NotIn |
notIn(Cmd column,
Collection<?> values)
not in 多个值
|
static NotIn |
notIn(Cmd column,
IQuery query)
not in 一个查询
|
static NotIn |
notIn(Cmd column,
Object... values)
not in 多个值
|
static NotLike |
notLike(Cmd column,
Object value)
notLike 判断
|
static NotLike |
notLike(LikeMode mode,
Cmd column,
Object value)
not like 判断
|
static NULL |
NULL()
对应SQL中的NULL
|
static Cmd |
paramWrapAndConvertToCmd(Cmd column,
Object param)
参数包装并转成CMD对象
|
static Pi |
pi()
pi 返回圆周率 函数
|
static Plus |
plus(Cmd column,
Cmd value)
plus加法
|
static Plus |
plus(Cmd column,
Number value)
plus加法
|
static PostgresFunctions |
postgres()
获得 postgres的函数聚合类
|
static PostgresFunctions |
postgres(Cmd column)
获得 postgres的函数聚合类
|
static DistinctOn |
postgresDistinctOn(Cmd... onKeys)
postgres DistinctOn
|
static Pow |
pow(Cmd column,
int n)
pow平方 函数
|
static Radians |
radians(Cmd column)
将角度转换为弧度 函数
|
static Rand |
rand()
0~1 的随机数 函数
|
static Rand |
rand(Number n)
0~1 的随机数 函数
|
static Repeat |
repeat(Cmd column,
int n)
将字符串 重复 n 次
|
static Replace |
replace(Cmd column,
String target,
String replacement)
替换 函数
|
static Reverse |
reverse(Cmd column)
反转函数
|
static Right |
right(Cmd column,
int start)
右边截取
|
static Round |
round(Cmd column)
round四舍五入 取整数位 函数
|
static Round |
round(Cmd column,
int precision)
round四舍五入 函数
|
static Rpad |
rpad(Cmd column,
int length,
String pad)
从左边开始填充
|
static Rtrim |
rtrim(Cmd column)
删除右边空格
|
static DateAdd |
secondAdd(Cmd column,
int n)
秒增加
|
static DateAdd |
secondSub(Cmd column,
int n)
秒减少
|
static Sign |
sign(Cmd column)
获取 column的符号,负数为-1 0为0、正数为1
|
static Sin |
sin(Cmd column)
求正弦值 函数
|
static Case |
sort(Cmd column,
Serializable... values)
排序值,如果包含在 values 里 则返回 在values的顺序值 从1开始;如果不在values里 则 返回 column的值
可以稍微替代 mysql field 函数
|
static Sqrt |
sqrt(Cmd column)
sqrt 平方根 函数
|
static ST_Contains |
ST_Contains(Cmd column,
Cmd geo)
判断是否包含 geo
|
static ST_Contains |
ST_Contains(Cmd column,
ST_Point point)
判断是否包含 point
|
static ST_Distance |
ST_Distance(Cmd column,
Cmd point)
计算2个对象的距离
|
static ST_Distance |
ST_Distance(Cmd column,
Cmd point,
Boolean useSpheroid)
计算2个对象的距离
|
static ST_Distance |
ST_Distance(Cmd column,
ST_Point point)
计算2个坐标的距离
|
static ST_Distance |
ST_Distance(Cmd column,
ST_Point point,
Boolean useSpheroid)
计算2个坐标的距离
|
static ST_DWithin |
ST_DWithin(Cmd column,
Cmd point,
double distance)
如果两个对象之间的距离在指定范围之内,则返回True
|
static ST_DWithin |
ST_DWithin(Cmd column,
Cmd point,
double distance,
Boolean useSpheroid)
如果两个对象之间的距离在指定范围之内,则返回True
|
static ST_DWithin |
ST_DWithin(Cmd column,
ST_Point point,
double distance)
如果两个对象之间的距离在指定范围之内,则返回True
|
static ST_DWithin |
ST_DWithin(Cmd column,
ST_Point point,
double distance,
Boolean useSpheroid)
如果两个对象之间的距离在指定范围之内,则返回True
|
static Strcmp |
strcmp(Cmd column,
String str)
字符串比较 函数
返回 -1 0 1
|
static SubStr |
subStr(Cmd column,
int start)
字符截取
|
static SubStr |
subStr(Cmd column,
int start,
int length)
字符截取
|
static Subtract |
subtract(Cmd column,
Cmd value)
subtract减法
|
static Subtract |
subtract(Cmd column,
Number value)
subtract加法
|
static Sum |
sum(Cmd column)
sum求和 函数
|
static Tan |
tan(Cmd column)
求正切值 函数
|
static CmdTemplate |
tpl(boolean wrapping,
String template,
Object... params)
创建普通sql模板
|
static CmdTemplate |
tpl(String template,
Object... params)
创建普通sql模板
|
static Trim |
trim(Cmd column)
删除两边空格
|
static TRUE |
TRUE()
对应SQL中的true;创建一个始终TRUE条件
方便开发者使用
|
static Truncate |
truncate(Cmd column)
返回数值 column 整数位 函数
|
static Truncate |
truncate(Cmd column,
int precision)
返回数值 column 保留到小数点后 precision 位的值 函数
|
static Upper |
upper(Cmd column)
转换成大写 函数
|
static BasicValue |
value(Serializable value)
将普通值转换为BasicValue
|
static Weekday |
weekday(Cmd column)
获取column的星期几
|
static Year |
year(Cmd column)
获取年份
|
static DateAdd |
yearAdd(Cmd column,
int n)
年增加
|
static DateAdd |
yearSub(Cmd column,
int n)
年减少
|
public static NULL NULL()
public static TRUE TRUE()
public static FALSE FALSE()
public static ST_DWithin ST_DWithin(Cmd column, Cmd point, double distance)
column - 列point - 另外一个对象distance - 距离@SafeVarargs public static CmdTemplate tpl(String template, Object... params)
template - 模板params - 参数@SafeVarargs public static CmdTemplate tpl(boolean wrapping, String template, Object... params)
wrapping - 会对单引号进行包裹,因为使用的是MessageFormat,单引号是特殊字符;开启后无需关注单引号问题template - 模板params - 参数@SafeVarargs public static FunTemplate fTpl(String template, Object... params)
template - 模板params - 参数@SafeVarargs public static FunTemplate fTpl(boolean wrapping, String template, Object... params)
wrapping - 会对单引号进行包裹,因为使用的是MessageFormat,单引号是特殊字符;开启后无需关注单引号问题template - 模板params - 参数@SafeVarargs public static ConditionTemplate cTpl(String template, Object... params)
template - 模板params - 参数@SafeVarargs public static ConditionTemplate cTpl(boolean wrapping, String template, Object... params)
wrapping - 会对单引号进行包裹,因为使用的是MessageFormat,单引号是特殊字符;开启后无需关注单引号问题template - 模板params - 参数public static Cmd paramWrapAndConvertToCmd(Cmd column, Object param)
column - 列param - 参数public static Object likeParamWrap(Cmd column, Object param, LikeMode mode, boolean isNotLike)
column - 列param - 参数mode - like方式isNotLike - 是否为NOT LIKEpublic static Column column(IDataset dataset, String column)
dataset - 表/子查询column - 列名public static <T> Column column(Getter<T> column)
column - getter列名,指的是你as(XX.getXXX)后的列名public static BasicValue value(Serializable value)
value - 值public static Subtract subtract(Cmd column, Number value)
column - 列value - 值public static Subtract subtract(Cmd column, Cmd value)
column - 列value - 值public static Multiply multiply(Cmd column, Number value)
column - 列value - 值public static Divide divide(Cmd column, Cmd value)
column - 列value - 值public static Divide divide(Cmd column, Number value)
column - 列value - 值public static Multiply multiply(Cmd column, Cmd value)
column - 列value - 值public static Count1 count1()
public static CountAll countAll()
public static Count count(Cmd column, boolean distinct)
column - 列distinct - 是否去重public static Round round(Cmd column, int precision)
column - 列precision - 精度public static Rand rand()
public static Pi pi()
public static Truncate truncate(Cmd column, int precision)
column - 列precision - 精度public static Exp exp(int n)
n - 次方public static Log log(Cmd base, int number)
base - 底数number - 对数public static CharLength charLength(Cmd column)
column - 列public static SubStr subStr(Cmd column, int start)
column - 列start - 开始位置public static SubStr subStr(Cmd column, int start, int length)
column - 列start - 开始位置length - 长度public static Lpad lpad(Cmd column, int length, String pad)
column - 列length - 填充后的长度pad - 填充内容public static Rpad rpad(Cmd column, int length, String pad)
column - 列length - 填充后的长度pad - 填充内容public static Strcmp strcmp(Cmd column, String str)
column - 列str - 比较对象public static Replace replace(Cmd column, String target, String replacement)
column - 列target - 匹配目标replacement - 替换值public static FindInSet mysqlFindInSet(Cmd column, String match)
column - 列match - 匹配值public static FindInSet mysqlFindInSet(Cmd column, Number match)
column - 列match - 匹配值@SafeVarargs public static Field mysqlFiled(Cmd column, Object... values)
column - 列values - 指定顺利的数据(一组数据)public static CurrentDate currentDate()
public static CurrentTime currentTime()
public static CurrentDateTime currentDateTime()
public static DateFormat date(Cmd column)
column - 列public static DateFormat dateFormat(Cmd column, String pattern)
column - 列pattern - 格式public static DateFormat dateFormat(Cmd column, DatePattern pattern)
column - 列pattern - 格式public static DateAdd dateAdd(Cmd column, int n, TimeUnits timeUnit)
column - 列public static DateAdd dateSub(Cmd column, int n, TimeUnits timeUnit)
column - 列@SafeVarargs public static Concat concat(Cmd column, Object... values)
column - 列values - 需要拼接的值@SafeVarargs public static ConcatWs concatWs(Cmd column, String split, Object... values)
column - 列split - 分隔符values - 需要拼接的值public static If if_(Condition condition, Serializable value, Serializable thenValue)
condition - 条件value - condition符合时的值thenValue - condition不符合时的值public static If if_(Condition condition, Cmd value, Serializable thenValue)
condition - 条件value - condition符合时的值thenValue - condition不符合时的值public static If if_(Condition condition, Serializable value, Cmd thenValue)
condition - 条件value - condition符合时的值thenValue - condition不符合时的值public static If if_(Condition condition, Cmd value, Cmd thenValue)
condition - 条件value - condition符合时的值thenValue - condition不符合时的值public static IfNull ifNull(Cmd column, Cmd value)
column - 列value - 值public static IfNull ifNull(Cmd column, Serializable value)
column - 列value - 值public static IsNotNull isNotNull(Cmd column)
column - 列public static Case case_()
@SafeVarargs public static In in(Cmd column, Object... values)
column - 列values - 包含的指定值public static In in(Cmd column, Collection<?> values)
column - 列values - 包含的指定值@SafeVarargs public static NotIn notIn(Cmd column, Object... values)
column - 列public static NotIn notIn(Cmd column, Collection<?> values)
column - 列public static NotExists notExists(IQuery query)
query - 查询public static Between between(Cmd column, Object value, Object value2)
column - 列value - 开始值value2 - 结束值public static NotBetween notBetween(Cmd column, Object value, Object value2)
column - 列value - 值value2 - public static Like like(LikeMode mode, Cmd column, Object value)
column - 列value - 值public static NotLike notLike(Cmd column, Object value)
column - 列value - 值public static NotLike notLike(LikeMode mode, Cmd column, Object value)
column - 列value - 值public static ILike iLike(LikeMode mode, Cmd column, Object value)
column - 列value - 值public static NotILike notILike(Cmd column, Object value)
column - 列value - 值public static NotILike notILike(LikeMode mode, Cmd column, Object value)
column - 列value - 值public static FromUnixTime mysqlFromUnixTime(Cmd column)
column - 列public static JsonContains mysqlJsonContains(Cmd column, Serializable containValue)
column - 列containValue - 包含值public static JsonContains mysqlJsonContains(Cmd column, Serializable containValue, String path)
column - 列containValue - 包含值path - 指定路径@SafeVarargs public static JsonContainsPath mysqlJsonContainsPath(Cmd column, String... paths)
column - 列paths - 指定路径@SafeVarargs public static JsonContainsPath mysqlJsonContainsPath(Cmd column, boolean allMatch, String... paths)
column - 列allMatch - 是否全匹配上paths - 指定路径@SafeVarargs public static JsonExtract mysqlJsonExtract(Cmd column, String... paths)
column - 列paths - 指定路径public static Instr instr(Cmd column, String str)
column - 列str - 匹配的字符public static Case sort(Cmd column, Serializable... values)
column - 列values - 指定值public static GroupConcat groupConcat(Cmd column, String split)
column - 列split - 分隔符public static GroupConcat groupConcat(Cmd column)
column - 列public static ST_DWithin ST_DWithin(Cmd column, Cmd point, double distance, Boolean useSpheroid)
column - 列point - 另外一个对象distance - 距离useSpheroid - 是否使用椭球参考系。使用椭球参考系会使得结果更精确但稍慢。public static ST_DWithin ST_DWithin(Cmd column, ST_Point point, double distance)
column - 列point - 另外一个坐标distance - 距离public static ST_DWithin ST_DWithin(Cmd column, ST_Point point, double distance, Boolean useSpheroid)
column - 列point - 另外一个坐标distance - 距离useSpheroid - 是否使用椭球参考系。使用椭球参考系会使得结果更精确但稍慢。public static ST_Distance ST_Distance(Cmd column, Cmd point)
column - 列point - 另外一个参考对象public static ST_Distance ST_Distance(Cmd column, Cmd point, Boolean useSpheroid)
column - 列point - 另外一个参考对象useSpheroid - 是否使用椭球参考系。使用椭球参考系会使得结果更精确但稍慢。public static ST_Distance ST_Distance(Cmd column, ST_Point point)
column - 列point - 另外一个坐标public static ST_Distance ST_Distance(Cmd column, ST_Point point, Boolean useSpheroid)
column - 列point - 另外一个坐标useSpheroid - 是否使用椭球参考系。使用椭球参考系会使得结果更精确但稍慢。public static ST_Contains ST_Contains(Cmd column, Cmd geo)
column - 列geo - 另外一个geo对象public static ST_Contains ST_Contains(Cmd column, ST_Point point)
column - 列point - 另外一个坐标public static MysqlFunctions mysql()
public static MysqlFunctions mysql(Cmd column)
column - 列,后续可以以此列操作public static PostgresFunctions postgres()
public static PostgresFunctions postgres(Cmd column)
column - 列,后续可以以此列操作@SafeVarargs public static DistinctOn postgresDistinctOn(Cmd... onKeys)
onKeys - 排重依据列Copyright © 2025. All rights reserved.