提交 574fe137 编写于 作者: chenxiang@lab.ibiz5.com's avatar chenxiang@lab.ibiz5.com

NoSQL:MongoDB适配 fix

上级 098b9dd2
......@@ -61,47 +61,47 @@ public class {{entity.codeName}}SearchContext extends MongoQueryContext {
this.{{camelCase field.codeName}}{{formitem.valueOP}} = {{camelCase field.codeName}}{{formitem.valueOP}};
if(!ObjectUtils.isEmpty(this.{{camelCase field.codeName}}{{formitem.valueOP}})){
{{#eq formitem.valueOP "LIKE"}}
this.getSearchCond().addCriteria(Criteria.where("{{camelCase field.name}}").regex({{camelCase field.codeName}}{{formitem.valueOP}}));
this.getSearchCond().addCriteria(Criteria.where("{{camelCase field.codeName}}").regex({{camelCase field.codeName}}{{formitem.valueOP}}));
{{/eq}}
{{#eq formitem.valueOP "LEFTLIKE"}}
this.getSearchCond().addCriteria(Criteria.where("{{camelCase field.name}}").regex({{camelCase field.codeName}}{{formitem.valueOP}}));
this.getSearchCond().addCriteria(Criteria.where("{{camelCase field.codeName}}").regex({{camelCase field.codeName}}{{formitem.valueOP}}));
{{/eq}}
{{#eq formitem.valueOP "RIGHTLIKE"}}
this.getSearchCond().addCriteria(Criteria.where("{{camelCase field.name}}").regex({{camelCase field.codeName}}{{formitem.valueOP}}));
this.getSearchCond().addCriteria(Criteria.where("{{camelCase field.codeName}}").regex({{camelCase field.codeName}}{{formitem.valueOP}}));
{{/eq}}
{{#eq formitem.valueOP "EQ"}}
this.getSearchCond().addCriteria(Criteria.where("{{camelCase field.name}}").is({{camelCase field.codeName}}{{formitem.valueOP}}));
this.getSearchCond().addCriteria(Criteria.where("{{camelCase field.codeName}}").is({{camelCase field.codeName}}{{formitem.valueOP}}));
{{/eq}}
{{#eq formitem.valueOP "NOTEQ"}}
this.getSearchCond().addCriteria(Criteria.where("{{camelCase field.name}}").ne({{camelCase field.codeName}}{{formitem.valueOP}}));
this.getSearchCond().addCriteria(Criteria.where("{{camelCase field.codeName}}").ne({{camelCase field.codeName}}{{formitem.valueOP}}));
{{/eq}}
{{#eq formitem.valueOP "GT"}}
this.getSearchCond().addCriteria(Criteria.where("{{camelCase field.name}}").gt({{camelCase field.codeName}}{{formitem.valueOP}}));
this.getSearchCond().addCriteria(Criteria.where("{{camelCase field.codeName}}").gt({{camelCase field.codeName}}{{formitem.valueOP}}));
{{/eq}}
{{#eq formitem.valueOP "GTANDEQ"}}
this.getSearchCond().addCriteria(Criteria.where("{{camelCase field.name}}").gte({{camelCase field.codeName}}{{formitem.valueOP}}));
this.getSearchCond().addCriteria(Criteria.where("{{camelCase field.codeName}}").gte({{camelCase field.codeName}}{{formitem.valueOP}}));
{{/eq}}
{{#eq formitem.valueOP "LT"}}
this.getSearchCond().addCriteria(Criteria.where("{{camelCase field.name}}").lt({{camelCase field.codeName}}{{formitem.valueOP}}));
this.getSearchCond().addCriteria(Criteria.where("{{camelCase field.codeName}}").lt({{camelCase field.codeName}}{{formitem.valueOP}}));
{{/eq}}
{{#eq formitem.valueOP "LTANDEQ"}}
this.getSearchCond().addCriteria(Criteria.where("{{camelCase field.name}}").lte({{camelCase field.codeName}}{{formitem.valueOP}}));
this.getSearchCond().addCriteria(Criteria.where("{{camelCase field.codeName}}").lte({{camelCase field.codeName}}{{formitem.valueOP}}));
{{/eq}}
{{#eq formitem.valueOP "ISNOTNULL"}}
if(this.{{camelCase field.codeName}}{{formitem.valueOP}}.equals("1")){
this.getSearchCond().addCriteria(Criteria.where("{{camelCase field.name}}").ne(null));
this.getSearchCond().addCriteria(Criteria.where("{{camelCase field.codeName}}").ne(null));
}
{{/eq}}
{{#eq formitem.valueOP "ISNULL"}}
if(this.{{camelCase field.codeName}}{{formitem.valueOP}}.equals("1")){
this.getSearchCond().addCriteria(Criteria.where("{{camelCase field.name}}").is(null));
this.getSearchCond().addCriteria(Criteria.where("{{camelCase field.codeName}}").is(null));
}
{{/eq}}
{{#eq formitem.valueOP "IN"}}
this.getSearchCond().addCriteria(Criteria.where("{{camelCase field.name}}").in({{camelCase field.codeName}}{{formitem.valueOP}}.split(";|,|;|,")));
this.getSearchCond().addCriteria(Criteria.where("{{camelCase field.codeName}}").in({{camelCase field.codeName}}{{formitem.valueOP}}.split(";|,|;|,")));
{{/eq}}
{{#eq formitem.valueOP "NOTIN"}}
this.getSearchCond().addCriteria(Criteria.where("{{camelCase field.name}}").nin({{camelCase field.codeName}}{{formitem.valueOP}}.split(";|,|;|,")));
this.getSearchCond().addCriteria(Criteria.where("{{camelCase field.codeName}}").nin({{camelCase field.codeName}}{{formitem.valueOP}}.split(";|,|;|,")));
{{/eq}}
}
return this;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册