关于or

OR条件构造相对复杂

condition("NM:nm|NM:name"); 生成SQL WHERE NM ='z' OR NM = 'zh'


condition("NM:nm|name|user");
中有第一个nm取值成功当前条件才生效,如果nm取值失败后面的name,user也忽略,当前条件无效
经常会这样用:
condition("NM:nm|{1}"); 生成SQL  WHERE NM = 'zh' OR NM = 1
condition("NM:nm|{NULL}"); 生成SQL  WHERE NM = 'zh' OR NM IS NULL


如果是在java中生成OR条件
condition("NM:nm","AGE:20").or("SORT","1") 生成SQL WHERE NM = 'zh' AND AGE=20 OR SORT = 1
condition("NM:nm","AGE:20").ors("SORT","1") 生成SQL WHERE (NM = 'zh' AND AGE=20) OR SORT = 1 //表示将在此之前的所有条件合成一组后与当前条件OR

其他文档