فهرست منبع

风机、场站测点配置基础方法

wangchangsheng 2 سال پیش
والد
کامیت
2704cc3b48

+ 108 - 3
web/backmanagerconfig/src/main/java/com/gyee/backconfig/controller/WindpowerstationpointnewController.java

@@ -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.Windpowerstationpointnew;
+import com.gyee.backconfig.service.auto.IWindpowerstationpointnewService;
+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("//windpowerstationpointnew")
 public class WindpowerstationpointnewController {
 
+    @Autowired
+    private IWindpowerstationpointnewService windpowerstationpointnewService;
+
+
+    /**
+     * 查询
+     * @param id
+     * @param code
+     * @param model
+     * @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<Windpowerstationpointnew> list = windpowerstationpointnewService.list(id, code, name,model, uniformcode, stationid,pageNum, pageSize);
+        if (null != list) {
+            return R.ok().data(list);
+        } else {
+            return R.error().data("查询失败!");
+        }
+    }
+
+
+    /**
+     * 根据id查询c
+     * @param id
+     * @return
+     */
+    @GetMapping(value = "/{id}")
+    public R findOne(@PathVariable("id") String id){
+
+        Windpowerstationpointnew pointnew = windpowerstationpointnewService.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 Windpowerstationpointnew pointnew){
+
+        boolean b = windpowerstationpointnewService.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 = windpowerstationpointnewService.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<Windpowerstationpointnew> list){
+        boolean b = windpowerstationpointnewService.updateBatchById(list);
+        if (b){
+            return R.ok().data(b);
+        }else {
+            return R.error().data("更新失败!");
+        }
+
+    }
+
+
 }

+ 108 - 3
web/backmanagerconfig/src/main/java/com/gyee/backconfig/controller/WindturbinetestingpointnewController.java

@@ -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("更新失败!");
+        }
+
+    }
+
+
 }

+ 10 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/service/auto/IWindpowerstationpointnewService.java

@@ -1,5 +1,6 @@
 package com.gyee.backconfig.service.auto;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.gyee.backconfig.model.auto.Windpowerstationpointnew;
 import com.baomidou.mybatisplus.extension.service.IService;
 
@@ -13,4 +14,13 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IWindpowerstationpointnewService extends IService<Windpowerstationpointnew> {
 
+
+    IPage<Windpowerstationpointnew> list(String id, String code, String name, String model,String uniformcode,String stationid, String pageNum, String pageSize);
+
+    Windpowerstationpointnew getOne(String id);
+
+    boolean addOrUpdate(Windpowerstationpointnew pointnew);
+
+    boolean  removeByIds(String ids);
+
 }

+ 9 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/service/auto/IWindturbinetestingpointnewService.java

@@ -1,5 +1,6 @@
 package com.gyee.backconfig.service.auto;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.gyee.backconfig.model.auto.Windturbinetestingpointnew;
 import com.baomidou.mybatisplus.extension.service.IService;
 
@@ -13,4 +14,12 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IWindturbinetestingpointnewService extends IService<Windturbinetestingpointnew> {
 
+    IPage<Windturbinetestingpointnew> list(String id, String code, String name, String model, String uniformcode, String stationid, String pageNum, String pageSize);
+
+    Windturbinetestingpointnew getOne(String id);
+
+    boolean addOrUpdate(Windturbinetestingpointnew pointnew);
+
+    boolean  removeByIds(String ids);
+
 }

+ 1 - 1
web/backmanagerconfig/src/main/java/com/gyee/backconfig/service/auto/impl/StandardpointServiceImpl.java

@@ -41,7 +41,7 @@ public class StandardpointServiceImpl extends ServiceImpl<StandardpointMapper, S
             qw.like("name",name);
         }
         if (StringUtils.isNotEmpty(type)){
-            qw.like("type",type);
+            qw.eq("type",type);
         }
 
         Page<Standardpoint> page = new Page<>(Integer.parseInt(pageNum),Integer.parseInt(pageSize));

+ 55 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/service/auto/impl/WindpowerstationpointnewServiceImpl.java

@@ -1,11 +1,17 @@
 package com.gyee.backconfig.service.auto.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.gyee.backconfig.model.auto.Windpowerstationpointnew;
 import com.gyee.backconfig.mapper.auto.WindpowerstationpointnewMapper;
 import com.gyee.backconfig.service.auto.IWindpowerstationpointnewService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gyee.common.model.StringUtils;
 import org.springframework.stereotype.Service;
 
+import java.util.Arrays;
+
 /**
  * <p>
  *  服务实现类
@@ -17,4 +23,53 @@ import org.springframework.stereotype.Service;
 @Service
 public class WindpowerstationpointnewServiceImpl extends ServiceImpl<WindpowerstationpointnewMapper, Windpowerstationpointnew> implements IWindpowerstationpointnewService {
 
+    @Override
+    public IPage<Windpowerstationpointnew> list(String id, String code, String name, String model, String uniformcode, String stationid, String pageNum, String pageSize) {
+        QueryWrapper<Windpowerstationpointnew> qw = new QueryWrapper<>();
+        if (StringUtils.isNotEmpty(id)){
+            qw.eq("id",id);
+        }
+        if (StringUtils.isNotEmpty(code)){
+            qw.like("code",code);
+        }
+
+        if (StringUtils.isNotEmpty(name)){
+            qw.like("name",name);
+        }
+
+        if (StringUtils.isNotEmpty(model)){
+            qw.like("model",model);
+        }
+
+        if (StringUtils.isNotEmpty(uniformcode)){
+            qw.eq("uniformcode",uniformcode);
+        }
+
+        if (StringUtils.isNotEmpty(stationid)){
+            qw.eq("stationid",stationid);
+        }
+
+        Page<Windpowerstationpointnew> page = new Page<>(Integer.parseInt(pageNum),Integer.parseInt(pageSize));
+        IPage<Windpowerstationpointnew> companysPage = getBaseMapper().selectPage(page, qw);
+        return companysPage;
+    }
+
+    @Override
+    public Windpowerstationpointnew getOne(String id) {
+        Windpowerstationpointnew pointnew =  this.getById(id);
+        return pointnew;
+    }
+
+    @Override
+    public boolean addOrUpdate(Windpowerstationpointnew pointnew) {
+        boolean b = this.saveOrUpdate(pointnew);
+        return b;
+    }
+
+    @Override
+    public boolean removeByIds(String ids) {
+        String[] strings = ids.split(",");
+        boolean b = this.removeByIds(Arrays.asList(strings));
+        return b;
+    }
 }

+ 55 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/service/auto/impl/WindturbinetestingpointnewServiceImpl.java

@@ -1,11 +1,17 @@
 package com.gyee.backconfig.service.auto.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.gyee.backconfig.model.auto.Windturbinetestingpointnew;
 import com.gyee.backconfig.mapper.auto.WindturbinetestingpointnewMapper;
 import com.gyee.backconfig.service.auto.IWindturbinetestingpointnewService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gyee.common.model.StringUtils;
 import org.springframework.stereotype.Service;
 
+import java.util.Arrays;
+
 /**
  * <p>
  *  服务实现类
@@ -17,4 +23,53 @@ import org.springframework.stereotype.Service;
 @Service
 public class WindturbinetestingpointnewServiceImpl extends ServiceImpl<WindturbinetestingpointnewMapper, Windturbinetestingpointnew> implements IWindturbinetestingpointnewService {
 
+    @Override
+    public IPage<Windturbinetestingpointnew> list(String id, String code, String name, String model, String uniformcode, String stationid, String pageNum, String pageSize) {
+        QueryWrapper<Windturbinetestingpointnew> qw = new QueryWrapper<>();
+        if (StringUtils.isNotEmpty(id)){
+            qw.eq("id",id);
+        }
+        if (StringUtils.isNotEmpty(code)){
+            qw.like("code",code);
+        }
+
+        if (StringUtils.isNotEmpty(name)){
+            qw.like("name",name);
+        }
+
+        if (StringUtils.isNotEmpty(model)){
+            qw.like("model",model);
+        }
+
+        if (StringUtils.isNotEmpty(uniformcode)){
+            qw.eq("uniformcode",uniformcode);
+        }
+
+        if (StringUtils.isNotEmpty(stationid)){
+            qw.eq("stationid",stationid);
+        }
+
+        Page<Windturbinetestingpointnew> page = new Page<>(Integer.parseInt(pageNum),Integer.parseInt(pageSize));
+        IPage<Windturbinetestingpointnew> companysPage = getBaseMapper().selectPage(page, qw);
+        return companysPage;
+    }
+
+    @Override
+    public Windturbinetestingpointnew getOne(String id) {
+        Windturbinetestingpointnew pointnew =  this.getById(id);
+        return pointnew;
+    }
+
+    @Override
+    public boolean addOrUpdate(Windturbinetestingpointnew pointnew) {
+        boolean b = this.saveOrUpdate(pointnew);
+        return b;
+    }
+
+    @Override
+    public boolean removeByIds(String ids) {
+        String[] strings = ids.split(",");
+        boolean b = this.removeByIds(Arrays.asList(strings));
+        return b;
+    }
 }