新增[RANGE区间查询]
This commit is contained in:
@@ -96,6 +96,8 @@ public class X {
|
||||
return ((Map) obj).isEmpty();
|
||||
if (obj instanceof Collection)
|
||||
return ((Collection) obj).isEmpty();
|
||||
if (obj instanceof Object[])
|
||||
return ((Object[]) obj).length == 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.tccn.base.dbq.fbean;
|
||||
|
||||
import net.tccn.base.Kv;
|
||||
import net.tccn.base.X;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -30,7 +31,7 @@ public enum FilterType {
|
||||
|
||||
//不同的条件构建过滤语句
|
||||
public static String buildSql(Filter filter) {
|
||||
if (filter.getValue() == null || filter.getValue().length() == 0) {
|
||||
if (X.isEmpty(filter.getValue()) && X.isEmpty(filter.getValues())) {
|
||||
return "";
|
||||
}
|
||||
FilterType filterType = getFilterType(filter.getType());
|
||||
|
||||
@@ -61,10 +61,11 @@ public class RunTest<T> {
|
||||
//@Test
|
||||
public void parseFBeanTest() {
|
||||
String str = "{'platToken':'ipsm_v4','name':'historyTrack'," +
|
||||
"'filters':[{'col':'ap.comName','value':'贵阳市第十九中学','type':'LIKE'},{'col':'','value':'name=213113','type':'SQL'}]," +
|
||||
"'filters':[{'col':'ap.comName','value':'贵阳市第十九中学','type':'LIKE'},{'col':'','value':'name=213113','type':'SQL'}," +
|
||||
"{'col':'age','values':[1,2],'type':'RANGE'}]," +
|
||||
|
||||
"'orders':[],'limit':{'pn':1,'ps':10,'total':1}}";
|
||||
|
||||
//FBean fBean = new Gson().fromJson(str, FBean.class);
|
||||
FBean fBean = convert.convertFrom(FBean.class, str);
|
||||
|
||||
String[] parse = parser.parseList(fBean);
|
||||
|
||||
Reference in New Issue
Block a user