zhanghua
2023-12-12 bc2da7908a227c09e5cc7b6d8dab3e9c94b784a1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package com.ycl.controller.epuipment;
 
 
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ycl.annotation.LogSave;
import com.ycl.api.CommonResult;
import com.ycl.controller.BaseController;
import com.ycl.entity.equipment.OrgGrid;
import com.ycl.service.equipment.IOrgGridService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
/**
 * <p>
 * 网格管理 前端控制器
 * </p>
 *
 * @author lyq
 * @since 2022-11-24
 */
@RestController
@RequestMapping("/org_grid")
@Api(tags = "网格管理")
public class OrgGridController extends BaseController {
 
    @Autowired
    IOrgGridService iOrgGridService;
 
    @GetMapping("/query")
    @ApiOperation(value = "查询网格")
    public CommonResult search(@RequestParam(required = false) String name,
                               @RequestParam Integer pageSize,
                               @RequestParam Integer currentPage) {
        return CommonResult.success(iOrgGridService.search(pageSize, currentPage, name));
 
    }
 
    @PostMapping("/add")
    @ApiOperation(value = "添加")
    @LogSave(operationType = "网格管理", contain = "添加")
    public CommonResult add(@RequestBody OrgGrid orgGrid) {
        return CommonResult.success(iOrgGridService.save(orgGrid));
    }
 
    @DeleteMapping("/delete/{id}")
    @ApiOperation(value = "删除")
    @LogSave(operationType = "网格管理", contain = "删除")
    public CommonResult delete(@PathVariable Long id) {
        return CommonResult.success(iOrgGridService.removeById(id));
    }
 
    @PutMapping("/update")
    @ApiOperation(value = "修改")
    @LogSave(operationType = "网格管理", contain = "修改")
    public CommonResult modify(@RequestBody OrgGrid orgGrid) {
        return CommonResult.success(iOrgGridService.updateById(orgGrid));
    }
}