201612 月8
Nutz:组合查询、子查询示例代码
Cnd cnd = Cnd.NEW(); if (!Strings.isBlank(src)) { cnd.and("srcFrom", "=", src); } if (!Strings.isBlank(name)) { String[] n = StringUtils.split(name, " "); SqlExpressionGroup group = new SqlExpressionGroup(); for (String s : n) { SqlExpression sqlExpression = Cnd.exp("srcName", "like", "%" + s + "%"); group.or(sqlExpression); } cnd.and(group); } cnd.and(Cnd.exps("productSku", "=", "").or("productSku", "is", null));
本文地址:https://wizzer.cn/archives/3327 , 转载请保留.