Skip to content

Commit

Permalink
2.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
sim-wangyan committed Nov 27, 2023
1 parent 6668533 commit 246c02c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
7. lt // <
8. lte // <=
9. like //like %xxx%
10. likeRight // like xxx%
10. likeLeft // like xxx%
11. notLike // not like %xxx%
12. in // in
13. nin // not in
Expand Down
13 changes: 11 additions & 2 deletions sqli-builder/src/main/java/io/xream/sqli/builder/CondBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ public CondBuilder ne(String property, Object value){
return doGle(Op.NE, property, value);
}

/**
* like() default LIKE %value%
* @param property
* @param value
*/
public CondBuilder like(String property, String value){
if (SqliStringUtil.isNullOrEmpty(value)) {
isOr();
Expand All @@ -113,8 +118,12 @@ public CondBuilder like(String property, String value){
String likeValue = SqlScript.LIKE_HOLDER + value + SqlScript.LIKE_HOLDER;
return doLike(Op.LIKE,property,likeValue);
}

public CondBuilder likeRight(String property, String value){
/**
* like() default LIKE %value%, then likeLeft() LIKE value%
* @param property
* @param value
*/
public CondBuilder likeLeft(String property, String value){
if (SqliStringUtil.isNullOrEmpty(value)) {
isOr();
return instance;
Expand Down
8 changes: 4 additions & 4 deletions sqli-builder/src/main/java/io/xream/sqli/builder/QB.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ public QB like(String property, String value) {
return (QB) super.like(property, value);
}

public QB likeRight(String property, String value) {
return (QB) super.likeRight(property, value);
public QB likeLeft(String property, String value) {
return (QB) super.likeLeft(property, value);
}

public QB notLike(String property, String value) {
Expand Down Expand Up @@ -523,8 +523,8 @@ public X like(String property, String value) {
return (X) super.like(property, value);
}

public X likeRight(String property, String value) {
return (X) super.likeRight(property, value);
public X likeLeft(String property, String value) {
return (X) super.likeLeft(property, value);
}

public X notLike(String property, String value) {
Expand Down
4 changes: 2 additions & 2 deletions sqli-builder/src/main/java/io/xream/sqli/builder/QrB.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ public QrB<T> like(String property, String value) {
return (QrB<T>) super.like(property, value);
}

public QrB<T> likeRight(String property, String value) {
return (QrB<T>) super.likeRight(property, value);
public QrB<T> likeLeft(String property, String value) {
return (QrB<T>) super.likeLeft(property, value);
}

public QrB<T> notLike(String property, String value) {
Expand Down

0 comments on commit 246c02c

Please sign in to comment.