| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.zy.asrs.framework.common.Cools; |
| | | import com.zy.asrs.framework.common.DateUtils; |
| | | import com.zy.asrs.wcs.utils.Utils; |
| | | import com.zy.asrs.wcs.utils.CommonUtils; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.lang.reflect.Modifier; |
| | |
| | | if (null != list) { |
| | | key = key.replaceAll("Range", ""); |
| | | if (this.isToUnderlineCase) { |
| | | key = Utils.toSymbolCase(key, '_'); |
| | | key = CommonUtils.toSymbolCase(key, '_'); |
| | | } |
| | | queryWrapper.ge(key, DateUtils.convert(list.get(0))); |
| | | queryWrapper.le(key, DateUtils.convert(list.get(1))); |
| | | } |
| | | } else { |
| | | if (this.isToUnderlineCase) { |
| | | key = Utils.toSymbolCase(key, '_'); |
| | | key = CommonUtils.toSymbolCase(key, '_'); |
| | | } |
| | | if (like) { |
| | | queryWrapper.like(key, val); |
| | |
| | | fields = Cools.getAllFields(cls); |
| | | for (Field field : fields) { |
| | | if ("createTime".equals(field.getName())) { |
| | | queryWrapper.orderByDesc(Utils.toSymbolCase(field.getName(), '_')); |
| | | queryWrapper.orderByDesc(CommonUtils.toSymbolCase(field.getName(), '_')); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | String column = Utils.toSymbolCase(field.getName(), '_'); |
| | | String column = CommonUtils.toSymbolCase(field.getName(), '_'); |
| | | columns.add(column); |
| | | } |
| | | if (!columns.isEmpty()) { |
| | |
| | | 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; |
| | | } |
| | | |
| | | } |