| | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param page 分页对象 |
| | | * @param violationRegistration 查询实体 |
| | | * @param query 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @GetMapping |
| | | public TableDataInfo selectAll(Page<ViolationRegistration> page, ViolationRegistration violationRegistration) { |
| | | return getDataTable(this.violationRegistrationService.page(page, new QueryWrapper<>(violationRegistration))); |
| | | @GetMapping("page/list") |
| | | public TableDataInfo listByPage(ViolationRegistrationQuery query) { |
| | | return getDataTable(this.violationRegistrationService.listByPage(page, new QueryWrapper<>(violationRegistration))); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("get/{id}") |
| | | public AjaxResult selectOne(@PathVariable Serializable id) { |
| | | public AjaxResult selectOne(@PathVariable Long id) { |
| | | return success(this.violationRegistrationService.getById(id)); |
| | | } |
| | | |
| | |
| | | * @param violationRegistration 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping |
| | | @PostMapping() |
| | | public AjaxResult insert(@RequestBody ViolationRegistration violationRegistration) { |
| | | return success(this.violationRegistrationService.save(violationRegistration)); |
| | | } |
| | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param idList 主键结合 |
| | | * @param workIds 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @DeleteMapping |
| | | public AjaxResult delete(@RequestParam("idList") List<Long> idList) { |
| | | return success(this.violationRegistrationService.removeByIds(idList)); |
| | | @DeleteMapping("/del/batch/{workIds}") |
| | | public AjaxResult delete(@PathVariable("workIds") List<Long> workIds) { |
| | | return success(this.violationRegistrationService.removeByIds(workIds)); |
| | | } |
| | | } |
| | | |