| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.function.Consumer; |
| | | |
| | | /** |
| | | * Created by vincent on 2/13/2024 |
| | |
| | | return this.buildWrapper(false); |
| | | } |
| | | |
| | | @SuppressWarnings("all") |
| | | public QueryWrapper<T> buildWrapper(Consumer<QueryWrapper<T>> consumer) { |
| | | return this.buildWrapper(false, consumer); |
| | | } |
| | | |
| | | public QueryWrapper<T> buildWrapper(boolean like) { |
| | | return this.buildWrapper(like, null); |
| | | } |
| | | |
| | | @SuppressWarnings("all") |
| | | public QueryWrapper<T> buildWrapper(boolean like, Consumer<QueryWrapper<T>> consumer) { |
| | | QueryWrapper<T> queryWrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = where.getMap(); |
| | | for (String key : map.keySet()) { |
| | |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | if (null != consumer) { |
| | | consumer.accept(queryWrapper); |
| | | } |
| | | |
| | | Field[] fields = null; |
| | |
| | | return queryWrapper; |
| | | } |
| | | |
| | | public Map<String, Object> pickOutMap() { |
| | | return pickOutMap(false); |
| | | } |
| | | |
| | | public Map<String, Object> pickOutMap(boolean mergeCondition) { |
| | | Map<String, Object> map = where.getMap(); |
| | | if (mergeCondition) { |
| | | if (!Cools.isEmpty(where.getCondition())) { |
| | | map.put("condition", where.getCondition()); |
| | | } |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | } |