| | |
| | | convert(param, wrapper); |
| | | allLike(BasArmMast.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | wrapper.orderBy("create_time",false); |
| | | return R.ok(basArmMastService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | @RequestMapping(value = "/basArmMast/listArm/auth") |
| | | @ManagerAuth |
| | | public R listArm(@RequestParam(defaultValue = "1") Integer curr, |
| | | @RequestParam(defaultValue = "10") Integer limit, |
| | | @RequestParam(required = false) String orderByField, |
| | | @RequestParam(required = false) String orderByType, |
| | | @RequestParam(required = false) String condition, |
| | | @RequestParam Map<String, Object> param) { |
| | | EntityWrapper<BasArmMast> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(BasArmMast.class, param.keySet(), wrapper, condition); |
| | | |
| | | if (!Cools.isEmpty(orderByField)) { |
| | | wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | } |
| | | wrapper.orderBy("create_time", false); |
| | | |
| | | // 如果不需要分页,使用 selectList() 获取所有数据 |
| | | List<BasArmMast> allData = basArmMastService.selectList(wrapper); |
| | | |
| | | return R.ok(allData); // 直接返回所有数据 |
| | | } |
| | | |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else if (entry.getKey().equals("binding_tags")){ |
| | | long aLong = Long.parseLong(val); |
| | | wrapper.ge(entry.getKey(), aLong); |
| | | } else { |
| | | wrapper.like(entry.getKey(), val); |
| | | } |