| | |
| | | // 全字段模糊搜索 todo |
| | | if (!Cools.isEmpty(map.get("condition"))) { |
| | | Set<String> columns = new HashSet<>(); |
| | | // 创建一个临时map,排除condition参数和分页排序参数 |
| | | Map<String, Object> tempMap = new HashMap<>(map); |
| | | tempMap.remove("condition"); |
| | | tempMap.remove("curr"); |
| | | tempMap.remove("limit"); |
| | | tempMap.remove("orderByField"); |
| | | tempMap.remove("orderByType"); |
| | | |
| | | for (Field field : Cools.getAllFields(cls)){ |
| | | if (Modifier.isFinal(field.getModifiers()) |
| | | || Modifier.isStatic(field.getModifiers()) |
| | |
| | | if (Cools.isEmpty(column)) { |
| | | column = field.getName(); |
| | | } |
| | | if (!map.keySet().contains(column)) { |
| | | if (!tempMap.keySet().contains(column)) { |
| | | columns.add(column); |
| | | } |
| | | } |
| | |
| | | if (Cools.isEmpty(condition)) { |
| | | return; |
| | | } |
| | | // 创建一个新的集合,排除condition参数本身 |
| | | Set<String> excludeSet = new HashSet<>(set); |
| | | excludeSet.remove("condition"); |
| | | excludeSet.remove("curr"); |
| | | excludeSet.remove("limit"); |
| | | excludeSet.remove("orderByField"); |
| | | excludeSet.remove("orderByType"); |
| | | |
| | | List<String> columns = new ArrayList<>(); |
| | | for (Field field :Cools.getAllFields(cls)){ |
| | | if (Modifier.isFinal(field.getModifiers()) |
| | |
| | | if (Cools.isEmpty(column)) { |
| | | column = field.getName(); |
| | | } |
| | | if (!set.contains(column)) { |
| | | if (!excludeSet.contains(column)) { |
| | | columns.add(column); |
| | | } |
| | | } |