parent
14160a2cec
commit
2c7f0fb3f0
@ -0,0 +1,35 @@
|
|||||||
|
package xyz.wbsite.wsqlite;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class Where {
|
||||||
|
|
||||||
|
public static Builder builder() {
|
||||||
|
return new Builder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Builder {
|
||||||
|
private StringBuilder sb = new StringBuilder();
|
||||||
|
private List<Object> args = new ArrayList<>();
|
||||||
|
|
||||||
|
public Builder eq(boolean condition,String name, Object value) {
|
||||||
|
if (condition){
|
||||||
|
sb.append(name).append("=? ");
|
||||||
|
}
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder like(boolean condition,String name, Object value) {
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder isNull(boolean condition,String name, Object value) {
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue