/************************************************************************ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ************************************************************************/ package common.ui.dataTable; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import org.apache.commons.lang3.StringUtils; import common.model.BaseModel; import common.util.TemplateUtil; /** *
* dataTable默认参数Java端解析封装工具
*
* @author Yx
*/
public final class GridParamProcessor {
final static List
* 过滤查询(现只支持一级分组)
* 前端提交格式: filters: {groupOp:"AND|OR", rules:[(field:"xxxxx",op:"eq",data:"x")*]}
* op定义如下: ['eq','ne','lt','le','gt','ge','bw','bn','in','ni','ew','en','cn','nc']
* ['equal','not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain']
* eq 等于 '='
* ne 不等于 '!='
* lt 小于 '<'
* le 小于等于 '<='
* gt 大于 '>'
* ge 大于等于 '>='
* bw 开始于 'like *%'
* bn 不开始于 'not like *%'
* ew 结束于 'like %*'
* en 不结束于 'not like %*'
* cn 包含 'like %*%'
* nc 包含 'not like %*%'
* nu 空值于 'is null'
* nn 非空值 'is not null'
* in 属于 'in (*)'
* ni 不属于 'not in (*)'
*
*/
if (filters != null) {
renderMap.put("queryParamsMap", TemplateUtil.genObjFormJson(filters.toString(), Map.class));
}
return renderMap;
}
}