|
@@ -1,9 +1,14 @@
|
|
|
package com.gyee.backconfig.controller;
|
|
|
|
|
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.gyee.backconfig.config.R;
|
|
|
+import com.gyee.backconfig.model.auto.Windturbinetestingpointnew;
|
|
|
+import com.gyee.backconfig.service.auto.IWindturbinetestingpointnewService;
|
|
|
+import com.gyee.common.model.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -17,4 +22,104 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
@RequestMapping("//windturbinetestingpointnew")
|
|
|
public class WindturbinetestingpointnewController {
|
|
|
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IWindturbinetestingpointnewService windturbinetestingpointnewService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询
|
|
|
+ * @param id
|
|
|
+ * @param code
|
|
|
+ * @param name
|
|
|
+ * @param pageNum
|
|
|
+ * @param pageSize
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/list")
|
|
|
+ public R findList(@RequestParam(value = "id", required = false) String id,
|
|
|
+ @RequestParam(value = "code", required = false) String code,
|
|
|
+ @RequestParam(value = "name", required = false) String name,
|
|
|
+ @RequestParam(value = "model", required = false) String model,
|
|
|
+ @RequestParam(value = "uniformcode", required = false) String uniformcode,
|
|
|
+ @RequestParam(value = "stationid", required = false) String stationid,
|
|
|
+ @RequestParam(value = "pageNum", required = true) String pageNum,
|
|
|
+ @RequestParam(value = "pageSize", required = true) String pageSize) {
|
|
|
+ IPage<Windturbinetestingpointnew> list = windturbinetestingpointnewService.list(id, code, name,model, uniformcode, stationid,pageNum, pageSize);
|
|
|
+ if (null != list) {
|
|
|
+ return R.ok().data(list);
|
|
|
+ } else {
|
|
|
+ return R.error().data("查询失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据id查询
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/{id}")
|
|
|
+ public R findOne(@PathVariable("id") String id){
|
|
|
+
|
|
|
+ Windturbinetestingpointnew pointnew = windturbinetestingpointnewService.getOne(id);
|
|
|
+ if (StringUtils.isNotNull(pointnew)){
|
|
|
+ return R.ok().data(pointnew);
|
|
|
+ }else {
|
|
|
+ return R.error().data("查询失败!");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 插入(批量)
|
|
|
+ * @param pointnew
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/add")
|
|
|
+ public R addAll(@RequestBody Windturbinetestingpointnew pointnew){
|
|
|
+
|
|
|
+ boolean b = windturbinetestingpointnewService.addOrUpdate(pointnew);
|
|
|
+ if (b){
|
|
|
+ return R.ok().data(b);
|
|
|
+ }else {
|
|
|
+ return R.error().data("保存失败!");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量删除
|
|
|
+ * @param ids
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @DeleteMapping(value = "/{ids}")
|
|
|
+ public R deleteAll(@PathVariable("ids") String ids){
|
|
|
+ boolean b = windturbinetestingpointnewService.removeByIds(ids);
|
|
|
+ if (b){
|
|
|
+ return R.ok().data(b);
|
|
|
+ }else {
|
|
|
+ return R.error().data("删除失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量修改
|
|
|
+ * @param list
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PutMapping(value = "/editPointnew")
|
|
|
+ public R update(@RequestBody List<Windturbinetestingpointnew> list){
|
|
|
+ boolean b = windturbinetestingpointnewService.updateBatchById(list);
|
|
|
+ if (b){
|
|
|
+ return R.ok().data(b);
|
|
|
+ }else {
|
|
|
+ return R.error().data("更新失败!");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|