| | |
| | | public R page(@RequestParam(defaultValue = "1") Integer curr, |
| | | @RequestParam(defaultValue = "10") Integer limit, |
| | | @RequestParam(required = false) String condition, |
| | | @RequestParam(required = false) String timeRange) { |
| | | @RequestParam(required = false) String timeRange, |
| | | @RequestParam Map<String, Object> param) { |
| | | LambdaQueryWrapper<@{ENTITYNAME}> wrapper = new LambdaQueryWrapper<>(); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.like(@{ENTITYNAME}::get@{MAJORCOLUMN0}, condition); |
| | |
| | | public R getDataKV(@RequestParam(required = false) String condition) { |
| | | List<KeyValueVo> vos = new ArrayList<>(); |
| | | LambdaQueryWrapper<@{ENTITYNAME}> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.like(@{ENTITYNAME}::get@{MAJORCOLUMN0}, condition); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.like(@{ENTITYNAME}::get@{MAJORCOLUMN0}, condition); |
| | | } |
| | | @{SIMPLEENTITYNAME}Service.page(new Page<>(1, 30), wrapper).getRecords().forEach(item -> vos.add(new KeyValueVo(String.valueOf(item.get@{MAJORCOLUMN0}()), item.get@{PRIMARYKEYCOLUMN}()))); |
| | | return R.ok().add(vos); |
| | | } |