Bläddra i källkod

方阵、箱变基础配置修改

wangb 2 år sedan
förälder
incheckning
9e1715155b

+ 106 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/controller/BoxchangeController.java

@@ -0,0 +1,106 @@
+package com.gyee.backconfig.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.gyee.backconfig.config.R;
+import com.gyee.backconfig.model.auto.Boxchange;
+import com.gyee.backconfig.model.auto.ProBasicBoxchange;
+import com.gyee.backconfig.service.auto.IBoxchangeService;
+import com.gyee.common.model.StringUtils;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.Arrays;
+
+/**
+ * <p>
+ * 前端控制器
+ * </p>
+ *
+ * @author wang
+ * @since 2022-10-17
+ */
+@RestController
+@RequestMapping("//boxchange")
+public class BoxchangeController {
+    @Resource
+    private IBoxchangeService boxchangeService;
+
+    /**
+     * 查询
+     *
+     * @param id
+     * @param code
+     * @param windpowerstationid
+     * @param projectid
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
+    @GetMapping(value = "/listByPage")
+    public R findList(@RequestParam(value = "id", required = false) String id,
+                      @RequestParam(value = "code", required = false) String code,
+                      @RequestParam(value = "windpowerstationid", required = false) String windpowerstationid,
+                      @RequestParam(value = "projectid", required = false) String projectid,
+                      @RequestParam(value = "pageNum", required = true) String pageNum,
+                      @RequestParam(value = "pageSize", required = true) String pageSize) {
+        IPage<Boxchange> list = boxchangeService.list(id, code, windpowerstationid, projectid, pageNum, pageSize);
+        if (null != list) {
+            return R.ok().data(list);
+        } else {
+            return R.error().data("查询失败!");
+        }
+    }
+
+    /**
+     * 根据id查询
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping(value = "/boxchange/{id}")
+    public R findOne(@PathVariable("id") String id) {
+        QueryWrapper<Boxchange> qw = new QueryWrapper<>();
+        qw.eq("id", id);
+        Boxchange Boxchange = boxchangeService.getOne(qw);
+        if (StringUtils.isNotNull(Boxchange)) {
+            return R.ok().data(Boxchange);
+        } else {
+            return R.error().data("查询失败!");
+        }
+    }
+
+    /**
+     * 批量插入
+     *
+     * @param Boxchange
+     * @return
+     */
+    @PostMapping(value = "/save")
+    public R addAll(@RequestBody Boxchange Boxchange) {
+        boolean b = boxchangeService.saveOrUpdate(Boxchange);
+        if (b) {
+            return R.ok().data(b);
+        } else {
+            return R.error().data("保存失败!");
+        }
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @DeleteMapping(value = "/remove-Boxchanges/{ids}")
+    public R deleteAll(@PathVariable("ids") String ids) {
+        String[] strings = ids.split(",");
+        boolean b = boxchangeService.removeByIds(Arrays.asList(strings));
+        if (b) {
+            return R.ok().data(b);
+        } else {
+            return R.error().data("删除失败!");
+        }
+    }
+}

+ 123 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/controller/SquareController.java

@@ -0,0 +1,123 @@
+package com.gyee.backconfig.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.gyee.backconfig.config.R;
+import com.gyee.backconfig.model.auto.ProBasicSquare;
+import com.gyee.backconfig.model.auto.Square;
+import com.gyee.backconfig.service.auto.ISquareService;
+import com.gyee.common.model.StringUtils;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * <p>
+ * 前端控制器
+ * </p>
+ *
+ * @author wang
+ * @since 2022-10-17
+ */
+@RestController
+@RequestMapping("//square")
+public class SquareController {
+    @Resource
+    private ISquareService squareService;
+
+    /**
+     * 查询
+     *
+     * @param id
+     * @param code
+     * @param windpowerstationid
+     * @param name
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
+    @GetMapping(value = "/listByPage")
+    public R findList(@RequestParam(value = "id", required = false) String id,
+                      @RequestParam(value = "code", required = false) String code,
+                      @RequestParam(value = "windpowerstationid", required = false) String windpowerstationid,
+                      @RequestParam(value = "name", required = false) String name,
+                      @RequestParam(value = "pageNum", required = true) String pageNum,
+                      @RequestParam(value = "pageSize", required = true) String pageSize) {
+        IPage<Square> list = squareService.list(id, code, windpowerstationid, name, pageNum, pageSize);
+        if (null != list) {
+            return R.ok().data(list);
+        } else {
+            return R.error().data("查询失败!");
+        }
+    }
+
+    /**
+     * 根据id查询
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping(value = "/Square/{id}")
+    public R findOne(@PathVariable("id") String id) {
+        QueryWrapper<Square> qw = new QueryWrapper<>();
+        qw.eq("id", id);
+        Square Square = squareService.getOne(qw);
+        if (StringUtils.isNotNull(Square)) {
+            return R.ok().data(Square);
+        } else {
+            return R.error().data("查询失败!");
+        }
+    }
+
+    /**
+     * 批量插入
+     *
+     * @param square
+     * @return
+     */
+    @PostMapping(value = "/save")
+    public R addAll(@RequestBody Square square) {
+        boolean b = squareService.saveOrUpdate(square);
+        if (b) {
+            return R.ok().data(b);
+        } else {
+            return R.error().data("保存失败!");
+        }
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @DeleteMapping(value = "/remove-Squares/{ids}")
+    public R deleteAll(@PathVariable("ids") String ids) {
+        String[] strings = ids.split(",");
+        boolean b = squareService.removeByIds(Arrays.asList(strings));
+        if (b) {
+            return R.ok().data(b);
+        } else {
+            return R.error().data("删除失败!");
+        }
+    }
+
+    /**
+     * 批量修改
+     *
+     * @param list
+     * @return
+     */
+    @PutMapping(value = "/update")
+    public R update(@RequestBody List<Square> list) {
+        boolean b = squareService.updateBatchById(list);
+        if (b) {
+            return R.ok().data(b);
+        } else {
+            return R.error().data("更新失败!");
+        }
+    }
+}

+ 16 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/mapper/auto/BoxchangeMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.backconfig.mapper.auto;
+
+import com.gyee.backconfig.model.auto.Boxchange;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author wang
+ * @since 2022-10-17
+ */
+public interface BoxchangeMapper extends BaseMapper<Boxchange> {
+
+}

+ 16 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/mapper/auto/SquareMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.backconfig.mapper.auto;
+
+import com.gyee.backconfig.model.auto.Square;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author wang
+ * @since 2022-10-17
+ */
+public interface SquareMapper extends BaseMapper<Square> {
+
+}

+ 36 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/model/auto/Boxchange.java

@@ -0,0 +1,36 @@
+package com.gyee.backconfig.model.auto;
+
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author wang
+ * @since 2022-10-17
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class Boxchange extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    private String id;
+
+    private String code;
+
+    private String windpowerstationid;
+
+    private String projectid;
+
+    private String lineid;
+
+    private String name;
+
+    private String squareid;
+
+
+}

+ 36 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/model/auto/Square.java

@@ -0,0 +1,36 @@
+package com.gyee.backconfig.model.auto;
+
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author wang
+ * @since 2022-10-17
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class Square extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    private String id;
+
+    private String code;
+
+    private String windpowerstationid;
+
+    private String projectid;
+
+    private String lineid;
+
+    private String name;
+
+    private String types;
+
+
+}

+ 18 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/service/auto/IBoxchangeService.java

@@ -0,0 +1,18 @@
+package com.gyee.backconfig.service.auto;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.gyee.backconfig.model.auto.Boxchange;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.gyee.backconfig.model.auto.ProBasicBoxchange;
+
+/**
+ * <p>
+ * 服务类
+ * </p>
+ *
+ * @author wang
+ * @since 2022-10-17
+ */
+public interface IBoxchangeService extends IService<Boxchange> {
+    IPage<Boxchange> list(String id, String code, String windpowerstationid, String projectid, String pageNum, String pageSize);
+}

+ 18 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/service/auto/ISquareService.java

@@ -0,0 +1,18 @@
+package com.gyee.backconfig.service.auto;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.gyee.backconfig.model.auto.ProBasicSquare;
+import com.gyee.backconfig.model.auto.Square;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author wang
+ * @since 2022-10-17
+ */
+public interface ISquareService extends IService<Square> {
+    IPage<Square> list(String id, String code, String windpowerstationid, String name, String pageNum, String pageSize);
+}

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

@@ -0,0 +1,45 @@
+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.Boxchange;
+import com.gyee.backconfig.mapper.auto.BoxchangeMapper;
+import com.gyee.backconfig.model.auto.ProBasicBoxchange;
+import com.gyee.backconfig.service.auto.IBoxchangeService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gyee.common.model.StringUtils;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author wang
+ * @since 2022-10-17
+ */
+@Service
+public class BoxchangeServiceImpl extends ServiceImpl<BoxchangeMapper, Boxchange> implements IBoxchangeService {
+
+    @Override
+    public IPage<Boxchange> list(String id, String code, String windpowerstationid, String projectid, String pageNum, String pageSize) {
+        QueryWrapper<Boxchange> qw = new QueryWrapper<>();
+        if (StringUtils.isNotEmpty(id)) {
+            qw.like("id", id);
+        }
+        if (StringUtils.isNotEmpty(code)) {
+            qw.like("code", code);
+        }
+        if (StringUtils.isNotEmpty(windpowerstationid)) {
+            qw.like("windpowerstationid", windpowerstationid);
+        }
+        if (StringUtils.isNotEmpty(projectid)) {
+            qw.like("projectid", projectid);
+        }
+        Page<Boxchange> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
+        IPage<Boxchange> ProBasicPage =getBaseMapper().selectPage(page, qw);
+        return ProBasicPage;
+
+    }
+}

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

@@ -0,0 +1,44 @@
+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.ProBasicSquare;
+import com.gyee.backconfig.model.auto.Square;
+import com.gyee.backconfig.mapper.auto.SquareMapper;
+import com.gyee.backconfig.service.auto.ISquareService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gyee.common.model.StringUtils;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author wang
+ * @since 2022-10-17
+ */
+@Service
+public class SquareServiceImpl extends ServiceImpl<SquareMapper, Square> implements ISquareService {
+
+    @Override
+    public IPage<Square> list(String id, String code, String windpowerstationid, String name, String pageNum, String pageSize) {
+        QueryWrapper<Square> qw = new QueryWrapper<>();
+        if (StringUtils.isNotEmpty(id)) {
+            qw.like("id", id);
+        }
+        if (StringUtils.isNotEmpty(code)) {
+            qw.like("code", code);
+        }
+        if (StringUtils.isNotEmpty(windpowerstationid)) {
+            qw.like("windpowerstationid", windpowerstationid);
+        }
+        if (StringUtils.isNotEmpty(name)) {
+            qw.like("name", name);
+        }
+        Page<Square> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
+        IPage<Square> ProBasicPage =getBaseMapper().selectPage(page, qw);
+        return ProBasicPage;
+    }
+}