| | |
| | | import com.ycl.entity.equipment.OrgGrid; |
| | | import com.ycl.service.equipment.IOrgGridService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | @GetMapping("/query") |
| | | @ApiOperation(value = "查询网格") |
| | | public CommonResult search(@RequestParam(required = false) String area, |
| | | @RequestParam Integer size, |
| | | @RequestParam Integer current) { |
| | | return CommonResult.success(iOrgGridService.page(new Page<>(size, current), new LambdaQueryWrapper<OrgGrid>() |
| | | .like(StringUtils.isNotBlank(area), OrgGrid::getArea, area))); |
| | | public CommonResult search(@RequestParam(required = false) String name, |
| | | @RequestParam Integer pageSize, |
| | | @RequestParam Integer currentPage) { |
| | | return CommonResult.success(iOrgGridService.search(pageSize, currentPage, name)); |
| | | |
| | | } |
| | | |
| | | @PostMapping("/addition") |
| | | @PostMapping("/add") |
| | | @ApiOperation(value = "添加") |
| | | @LogSave(operationType = "网格管理", contain = "添加") |
| | | public CommonResult add(@RequestBody OrgGrid orgGrid) { |
| | | return CommonResult.success(iOrgGridService.save(orgGrid)); |
| | | } |
| | | |
| | | @DeleteMapping("/deletion") |
| | | @DeleteMapping("/delete/{id}") |
| | | @ApiOperation(value = "删除") |
| | | @LogSave(operationType = "网格管理", contain = "删除") |
| | | public CommonResult delete(@RequestParam Integer id) { |
| | | public CommonResult delete(@PathVariable Long id) { |
| | | return CommonResult.success(iOrgGridService.removeById(id)); |
| | | } |
| | | |
| | | @GetMapping("/modification") |
| | | @PutMapping("/update") |
| | | @ApiOperation(value = "修改") |
| | | @LogSave(operationType = "网格管理", contain = "修改") |
| | | public CommonResult modify(@RequestBody OrgGrid orgGrid) { |