public ISelecter where(String sql) { Rule r = new Rule(); r.setColumn(sql); r.setOpStart(""); r.setTag(""); r.setOpEnd(""); wheres.add(r); return this; }
public IExecuter whereSql(String sql, Object[] values) { Rule r = new Rule(); r.setColumn(sql); r.setOpStart(""); r.setTag(""); r.setOpEnd(""); wheres.add(r); for (Object v : values) { paramWheres.add(v); } return this; }
public ISelecter whereNq(String column, Object value) { Rule r = new Rule(); r.setColumn(column); if (null != value) { r.setOpStart("!="); paramWheres.add(value); } else { r.setOpStart(" IS NOT NULL"); r.setTag(""); } wheres.add(r); return this; }
protected IExecuter whereNotIn(String column, Object... value) { Rule r = new Rule(); r.setColumn(column); r.setOpStart(" not in ("); r.setOpEnd(")"); StringBuilder tag = new StringBuilder(); List<Object> l = objectsToList(value); for (Object o : l) { tag.append(",?"); paramWheres.add(o); } r.setTag(l.size() > 0 ? tag.toString().substring(1) : ""); wheres.add(r); return this; }