|
@@ -0,0 +1,109 @@
|
|
1
|
+package com.yunzhi.nanyang.controller;
|
|
2
|
+
|
|
3
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
4
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
5
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
6
|
+import com.yunzhi.nanyang.common.BaseController;
|
|
7
|
+import com.yunzhi.nanyang.common.ResponseBean;
|
|
8
|
+
|
|
9
|
+import java.util.List;
|
|
10
|
+
|
|
11
|
+import com.yunzhi.nanyang.common.StringUtils;
|
|
12
|
+import io.swagger.annotations.Api;
|
|
13
|
+import io.swagger.annotations.ApiOperation;
|
|
14
|
+import io.swagger.annotations.ApiParam;
|
|
15
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
16
|
+import org.springframework.web.bind.annotation.*;
|
|
17
|
+import com.yunzhi.nanyang.entity.TaDeviceJob;
|
|
18
|
+import com.yunzhi.nanyang.service.TaDeviceJobService;
|
|
19
|
+
|
|
20
|
+/**
|
|
21
|
+ * 设备作业表;(ta_device_job)表控制层
|
|
22
|
+ *
|
|
23
|
+ * @author : http://njyunzhi.com
|
|
24
|
+ * @date : 2022-11-3
|
|
25
|
+ */
|
|
26
|
+@Api(tags = "设备作业表对象功能接口")
|
|
27
|
+@RestController
|
|
28
|
+@RequestMapping("/")
|
|
29
|
+public class TaDeviceJobController extends BaseController {
|
|
30
|
+
|
|
31
|
+ @Autowired
|
|
32
|
+ private TaDeviceJobService taDeviceJobService;
|
|
33
|
+
|
|
34
|
+// /**
|
|
35
|
+// * 通过ID查询单条数据
|
|
36
|
+// *
|
|
37
|
+// * @param jobId 主键
|
|
38
|
+// * @return 实例对象
|
|
39
|
+// */
|
|
40
|
+// @ApiOperation("通过ID查询单条数据")
|
|
41
|
+// @GetMapping("/device-job/{id}")
|
|
42
|
+// public ResponseBean queryById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
|
|
43
|
+// return ResponseBean.success(taDeviceJobService.getById(id));
|
|
44
|
+// }
|
|
45
|
+
|
|
46
|
+ /**
|
|
47
|
+ * 分页查询
|
|
48
|
+ *
|
|
49
|
+ * @param pageNum 当前页码
|
|
50
|
+ * @param pageSize 每页条数
|
|
51
|
+ * @return 查询结果
|
|
52
|
+ */
|
|
53
|
+ @ApiOperation("设备作业列表")
|
|
54
|
+ @GetMapping("/device-job")
|
|
55
|
+ public ResponseBean list(@ApiParam("页码") @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
|
56
|
+ @ApiParam("单页数据量") @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
|
57
|
+ @ApiParam("设备分类") @RequestParam(value = "deviceKind", required = false) String deviceKind,
|
|
58
|
+ @ApiParam("设备编号") @RequestParam(value = "deviceNo", required = false) String deviceNo) throws Exception {
|
|
59
|
+
|
|
60
|
+ IPage<TaDeviceJob> pg = new Page<>(pageNum, pageSize);
|
|
61
|
+ QueryWrapper<TaDeviceJob> queryWrapper = new QueryWrapper<>();
|
|
62
|
+ queryWrapper.eq(!StringUtils.isEmpty(deviceKind), "device_kind", deviceKind);
|
|
63
|
+ queryWrapper.like(!StringUtils.isEmpty(deviceNo), "device_no", deviceNo);
|
|
64
|
+ queryWrapper.orderByDesc("job_date");
|
|
65
|
+ IPage<TaDeviceJob> result = taDeviceJobService.page(pg, queryWrapper);
|
|
66
|
+
|
|
67
|
+ return ResponseBean.success(result);
|
|
68
|
+ }
|
|
69
|
+
|
|
70
|
+// /**
|
|
71
|
+// * 新增数据
|
|
72
|
+// *
|
|
73
|
+// * @param taDeviceJob 实例对象
|
|
74
|
+// * @return 实例对象
|
|
75
|
+// */
|
|
76
|
+// @ApiOperation("新增数据")
|
|
77
|
+// @PostMapping("/device-job")
|
|
78
|
+// public ResponseBean add(@ApiParam("对象实体") @RequestBody TaDeviceJob taDeviceJob) throws Exception {
|
|
79
|
+// taDeviceJobService.save(taDeviceJob);
|
|
80
|
+// return ResponseBean.success(taDeviceJob);
|
|
81
|
+// }
|
|
82
|
+//
|
|
83
|
+// /**
|
|
84
|
+// * 更新数据
|
|
85
|
+// *
|
|
86
|
+// * @param taDeviceJob 实例对象
|
|
87
|
+// * @return 实例对象
|
|
88
|
+// */
|
|
89
|
+// @ApiOperation("更新数据")
|
|
90
|
+// @PutMapping("/device-job/{id}")
|
|
91
|
+// public ResponseBean edit(@ApiParam("对象实体") @RequestBody TaDeviceJob taDeviceJob,
|
|
92
|
+// @ApiParam("对象ID") @PathVariable String id) throws Exception {
|
|
93
|
+// taDeviceJobService.updateById(taDeviceJob);
|
|
94
|
+// return ResponseBean.success(taDeviceJob);
|
|
95
|
+// }
|
|
96
|
+//
|
|
97
|
+// /**
|
|
98
|
+// * 通过主键删除数据
|
|
99
|
+// *
|
|
100
|
+// * @param jobId 主键
|
|
101
|
+// * @return 是否成功
|
|
102
|
+// */
|
|
103
|
+// @ApiOperation("通过主键删除数据")
|
|
104
|
+// @DeleteMapping("/device-job/{id}")
|
|
105
|
+// public ResponseBean deleteById(@ApiParam("对象ID") @PathVariable String id) {
|
|
106
|
+// taDeviceJobService.removeLogicById(id);
|
|
107
|
+// return ResponseBean.success("success");
|
|
108
|
+// }
|
|
109
|
+}
|