ke
2024-07-19 08a962d2925baa255207fdf979e6fee794f1773b
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
package cn.gistack.sm.hk.controller;
 
 
import cn.gistack.sm.hk.entity.HkStaffGaugeMon;
import cn.gistack.sm.hk.service.HkStaffGaugeMonService;
import cn.gistack.sm.hk.vo.HkStaffGaugeMonVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
 
/**
 * @author zhongrj
 * @Description: 水尺监测
 * @date 2024-06-05
 */
@Slf4j
@Api(tags = "水尺监测")
@RestController
@RequestMapping("/hk/hkStaffGaugeMon")
@AllArgsConstructor
public class HkStaffGaugeMonController {
 
    private final HkStaffGaugeMonService hkStaffGaugeMonService;
 
    /**
     * 分页列表查询
     *
     * @param hkStaffGaugeMon
     * @return
     */
    @ApiOperation(value="水尺监测-分页列表查询", notes="水尺监测-分页列表查询")
    @GetMapping(value = "/list")
    public R queryPageList(HkStaffGaugeMon hkStaffGaugeMon, Query query) {
        IPage<HkStaffGaugeMon> pageList = hkStaffGaugeMonService.page(Condition.getPage(query), Condition.getQueryWrapper(hkStaffGaugeMon));
        return R.data(pageList);
    }
 
    /**
     * 自定义分页列表查询
     * @param query
     * @param hkStaffGaugeMon
     * @return
     */
    @ApiOperation(value="水尺监测-自定义分页列表查询", notes="水尺监测-自定义分页列表查询")
    @GetMapping(value = "/page")
    public R selectAlarmPage(HkStaffGaugeMonVO hkStaffGaugeMon, Query query) {
        return R.data(hkStaffGaugeMonService.selectHkStaffGaugeMonPage(Condition.getPage(query),hkStaffGaugeMon));
    }
 
    /**
     * 添加
     *
     * @param hkStaffGaugeMon
     * @return
     */
    @ApiOperation(value="水尺监测-添加", notes="水尺监测-添加")
    @PostMapping(value = "/add")
    public R add(@RequestBody HkStaffGaugeMon hkStaffGaugeMon) {
        return R.data(hkStaffGaugeMonService.save(hkStaffGaugeMon));
    }
 
    /**
     * 编辑
     *
     * @param hkStaffGaugeMon
     * @return
     */
    @ApiOperation(value="水尺监测-编辑", notes="水尺监测-编辑")
    @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
    public R edit(@RequestBody HkStaffGaugeMon hkStaffGaugeMon) {
        return R.data(hkStaffGaugeMonService.updateById(hkStaffGaugeMon));
    }
 
    /**
     * 通过id查询
     *
     * @param id
     * @return
     */
    @ApiOperation(value="水尺监测-通过id查询", notes="水尺监测-通过id查询")
    @GetMapping(value = "/queryById")
    public R queryById(@RequestParam(name="id",required=true) String id) {
        HkStaffGaugeMon hkStaffGaugeMon = hkStaffGaugeMonService.getById(id);
        return R.data(hkStaffGaugeMon);
    }
 
    /**
     * 定时读取
     * @return
     */
    @GetMapping(value = "/insert")
    public void insert() {
        // 保存数据
        hkStaffGaugeMonService.saveHkStaffGaugeMonInfo();
    }
 
    /**
     * 定时读取
     * @return
     */
    @PostMapping(value = "/test")
    public void insert(@RequestBody String data) {
        // 保存数据
        hkStaffGaugeMonService.saveHkStaffGaugeMonInfo(data);
    }
 
 
}