In the SpringBoot project, use Mybatis to dynamically create sql statements and how to insert OR conditions between loop inserts Where

first post the code for dynamically creating sql

AND();
for (Object key : key_values){
     WHERE("(article.title LIKE "%"+key.toString()+"%" OR article.content LIKE "%"+key.toString()+"%")");
}

the final output SQL statement is as follows

clipboard.png

clipboard.png

is there any way to achieve it? I looked at AbstractSQL.class and didn"t seem to find a match.

Jul.14,2022

has a OR (); , document has examples

Menu