Browse Source

xrp-mybatis-wrapper计划电量增删改查

xiruipeng 2 years ago
parent
commit
3fba8bd8ad
17 changed files with 770 additions and 6 deletions
  1. 8 0
      web/backmanagerconfig/pom.xml
  2. 2 1
      web/backmanagerconfig/src/main/java/com/gyee/backconfig/BackConfigMain.java
  3. 8 3
      web/backmanagerconfig/src/main/java/com/gyee/backconfig/config/GeneratorCodeConfig.java
  4. 5 0
      web/backmanagerconfig/src/main/java/com/gyee/backconfig/controller/test/TestController.java
  5. 51 0
      web/backmanagerconfig/src/main/java/com/gyee/backconfig/controller/test/XrpProjectplanController.java
  6. 84 0
      web/backmanagerconfig/src/main/java/com/gyee/backconfig/controller/test/XrpProjectplanServiceController.java
  7. 28 0
      web/backmanagerconfig/src/main/java/com/gyee/backconfig/mapper/auto/XrpProjectplanMapper.java
  8. 53 0
      web/backmanagerconfig/src/main/java/com/gyee/backconfig/model/auto/XrpProjectplan.java
  9. 63 0
      web/backmanagerconfig/src/main/java/com/gyee/backconfig/service/BackConfigService.java
  10. 16 0
      web/backmanagerconfig/src/main/java/com/gyee/backconfig/service/auto/IXrpProjectplanService.java
  11. 41 0
      web/backmanagerconfig/src/main/java/com/gyee/backconfig/service/auto/impl/XrpProjectplanServiceImpl.java
  12. 3 2
      web/backmanagerconfig/src/main/resources/application-jn.yml
  13. 134 0
      web/backmanagerconfig/src/test/java/BackConfigMainTests.java
  14. 74 0
      web/backmanagerconfig/src/test/java/MyBatisPlusServiceTest.java
  15. 39 0
      web/backmanagerconfig/src/test/java/MyBatisPlusTest.java
  16. 148 0
      web/backmanagerconfig/src/test/java/MyBatisPlusWrapperTest.java
  17. 13 0
      web/backmanagerconfig/src/test/java/OrderServiceApplicationTests.java

+ 8 - 0
web/backmanagerconfig/pom.xml

@@ -63,6 +63,14 @@
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>2.4.2</version>
+                <configuration>
+                    <skipTests>true</skipTests>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
 

+ 2 - 1
web/backmanagerconfig/src/main/java/com/gyee/backconfig/BackConfigMain.java

@@ -10,7 +10,8 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 
 @SpringBootApplication
 @EnableDiscoveryClient
-@MapperScan("com.gyee.backconfig.mapper")
+@MapperScan("com.gyee.backconfig.mapper")//扫描mapper接口所在的包,IOC只能存在类所对应的bean
+//不能存在接口对应的bean,其实是mapper动态生成的代理类交给IOC管理
 public class BackConfigMain {
     public static void main(String[] args) {
         SpringApplication.run(BackConfigMain.class,args);

+ 8 - 3
web/backmanagerconfig/src/main/java/com/gyee/backconfig/config/GeneratorCodeConfig.java

@@ -40,7 +40,7 @@ public class GeneratorCodeConfig {
         GlobalConfig gc = new GlobalConfig();
         String projectPath = System.getProperty("user.dir");
         gc.setOutputDir(projectPath + "/src/main/java");
-        gc.setAuthor("谢生杰");
+        gc.setAuthor("郗瑞鹏");
         gc.setOpen(false);
         //实体属性 Swagger2 注解
         gc.setSwagger2(false);
@@ -53,10 +53,15 @@ public class GeneratorCodeConfig {
         dsc.setUsername("root");
         dsc.setPassword("root");
         mpg.setDataSource(dsc);*/
-        dsc.setDriverName("oracle.jdbc.driver.OracleDriver");
+//        dsc.setDriverName("oracle.jdbc.driver.OracleDriver"); 注意大写
+//        dsc.setUsername("gdprod");
+//        dsc.setPassword("gd123");
+//        dsc.setUrl("jdbc:oracle:thin:@10.81.3.151:1521:gdsj");
+
+        dsc.setDriverName("org.postgresql.Driver");
         dsc.setUsername("gdprod");
         dsc.setPassword("gd123");
-        dsc.setUrl("jdbc:oracle:thin:@10.83.68.165:1521:gdsj");
+        dsc.setUrl("jdbc:postgresql://10.81.3.151:5432/wisdom");
 
         mpg.setDataSource(dsc);
 

+ 5 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/controller/test/TestController.java

@@ -16,4 +16,9 @@ public class TestController {
     public R test(){
         return R.ok().data("hello backconfig");
     }
+
+    /*@RequestMapping(value="/backconfig/xrptest")
+    public R test2(){
+        return R.ok().data("hello xrp");
+    }*/
 }

+ 51 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/controller/test/XrpProjectplanController.java

@@ -0,0 +1,51 @@
+package com.gyee.backconfig.controller.test;
+
+
+import com.gyee.backconfig.config.R;
+import com.gyee.backconfig.model.auto.XrpProjectplan;
+import com.gyee.backconfig.service.auto.IXrpProjectplanService;
+import com.gyee.backconfig.service.auto.impl.XrpProjectplanServiceImpl;
+import com.gyee.common.model.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 郗瑞鹏
+ * @since 2022-09-14
+ */
+@RestController
+@RequestMapping("//xrp-projectplan")
+public class XrpProjectplanController {
+
+    @Autowired
+    private XrpProjectplanServiceImpl xrpProjectplanService;
+
+
+
+    @GetMapping("/xpp")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R xppList(){
+
+        List<XrpProjectplan> xrpProjectplans = xrpProjectplanService.queryAll();
+        if (StringUtils.isNotNull(xrpProjectplans)) {
+            return R.ok(xrpProjectplans.size()).data(xrpProjectplans);
+        }else{
+            return R.error().message("访问失败");
+        }
+    }
+
+    @GetMapping("/test")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R test(){
+        return R.ok().data("hello backconfig xrp");
+    }
+}

+ 84 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/controller/test/XrpProjectplanServiceController.java

@@ -0,0 +1,84 @@
+package com.gyee.backconfig.controller.test;
+
+
+import com.gyee.backconfig.config.R;
+import com.gyee.backconfig.model.auto.XrpProjectplan;
+import com.gyee.backconfig.service.BackConfigService;
+import com.gyee.backconfig.service.auto.impl.XrpProjectplanServiceImpl;
+import com.gyee.common.model.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 郗瑞鹏
+ * @since 2022-09-14
+ */
+@RestController
+@RequestMapping("//xrp-service-projectplan")
+public class XrpProjectplanServiceController {
+
+    @Resource
+    private BackConfigService backConfigService;
+
+
+
+    @GetMapping("/xpp")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R xppList(){
+        List<XrpProjectplan> xrpProjectplanList = backConfigService.backConfigList();
+        if (StringUtils.isNotNull(xrpProjectplanList)) {
+            return R.ok(xrpProjectplanList.size()).data(xrpProjectplanList);
+        }else{
+            return R.error().message("访问失败");
+        }
+    }
+
+    @GetMapping("/xpp-by-id")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R xppById(String id){
+        XrpProjectplan xrpProjectplan = backConfigService.projectplanById(id);
+        if (StringUtils.isNotNull(xrpProjectplan)) {
+            return R.ok().data(xrpProjectplan);
+        }else{
+            return R.error().message("访问失败");
+        }
+    }
+
+    //新增
+    @PostMapping("/saveXPP")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R saveXPP(@RequestBody XrpProjectplan xrpProjectplan){
+        Boolean saveSingle = backConfigService.saveSingle(xrpProjectplan);
+        if (saveSingle) {
+            return R.ok().data("保存成功");
+        }else{
+            return R.error().message("保存失败");
+        }
+    }
+
+    //更新
+    /*public void xppUpdate(@RequestBody XrpProjectplan xpp){
+        if(StringUtils.isNotEmpty(xpp))
+            backConfigService.updateXpp(xpp);
+    }*/
+
+
+
+    @GetMapping("/test")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R test(){
+        return R.ok().data("hello backconfig xrp");
+    }
+}

+ 28 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/mapper/auto/XrpProjectplanMapper.java

@@ -0,0 +1,28 @@
+package com.gyee.backconfig.mapper.auto;
+
+import com.gyee.backconfig.model.auto.XrpProjectplan;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+import java.util.Map;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 郗瑞鹏
+ * @since 2022-09-14
+ */
+@Repository
+public interface XrpProjectplanMapper extends BaseMapper<XrpProjectplan> {
+
+    /*
+     * @description:根据id查询用户信息为Map集合
+     * @author: xiruipeng
+     * @date: 2022/9/15 11:58
+     * @param: [id]
+     * @return: java.util.Map<java.lang.String,java.lang.Object>
+     **/
+    Map<String,Object> selectMapById(Long id);
+}

+ 53 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/model/auto/XrpProjectplan.java

@@ -0,0 +1,53 @@
+package com.gyee.backconfig.model.auto;
+
+import java.math.BigDecimal;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 郗瑞鹏
+ * @since 2022-09-14
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("XRP_PROJECTPLAN")
+public class XrpProjectplan extends Model {
+
+    private static final long serialVersionUID = 1L;
+    @TableId(value="ID",type = IdType.ASSIGN_ID)//指定自增策略
+    // bigint,int8表里面是,默认 只能使用id作为主键,@tableId 将属性对应的字段作为指定主键
+    //value="ID" 这里id和数据库中指定作为主键的字段,value=可以省略;
+    private Long id;
+
+    @TableField("PROJECTID")
+    private String projectid;
+
+
+    @TableField("GENERATINGCAPACITY")
+    private String generatingcapacity;
+
+
+    @TableField("OUTAGEHOURS")
+    private Double outagehours;
+
+    @TableField("YEAR")
+    private String year;
+
+    @TableField("MONTH")
+    private String month;
+
+    @TableField("WINDPOWER")
+    private String windpower;
+
+    //删除逻辑删除
+    @TableLogic
+    private Integer isdeleted;
+
+}

+ 63 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/service/BackConfigService.java

@@ -0,0 +1,63 @@
+package com.gyee.backconfig.service;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.gyee.backconfig.model.auto.XrpProjectplan;
+import com.gyee.backconfig.service.auto.IXrpProjectplanService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author 50560
+ * @create 2022-09-14 13:41
+ * backConfig:大部分逻辑在此处
+ */
+@Service
+public class BackConfigService {
+
+    @Resource
+    private IXrpProjectplanService xrpProjectplanService;
+
+    /**
+     * @param
+     * @return
+     */
+    public List<XrpProjectplan> backConfigList(){
+        List<XrpProjectplan> xrpProjectplanList = xrpProjectplanService.list();
+
+        return xrpProjectplanList;
+    }
+
+    //根据id返回
+    public XrpProjectplan projectplanById(String id){
+        QueryWrapper<XrpProjectplan> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("id",id);
+        XrpProjectplan xrpProjectplan = xrpProjectplanService.getOne(queryWrapper);
+        return xrpProjectplan;
+    }
+
+    public void updateXpp(XrpProjectplan xpp) {
+        xrpProjectplanService.updateById(xpp);
+    }
+
+
+
+    public Boolean saveSingle(XrpProjectplan xrpProjectplan) {
+        return xrpProjectplanService.saveOrUpdate(xrpProjectplan);
+    }
+
+    //更新
+
+
+    //增加
+
+
+
+
+
+
+
+}

+ 16 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/service/auto/IXrpProjectplanService.java

@@ -0,0 +1,16 @@
+package com.gyee.backconfig.service.auto;
+
+import com.gyee.backconfig.model.auto.XrpProjectplan;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 郗瑞鹏
+ * @since 2022-09-14
+ */
+public interface IXrpProjectplanService extends IService<XrpProjectplan> {
+
+}

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

@@ -0,0 +1,41 @@
+package com.gyee.backconfig.service.auto.impl;
+
+import com.gyee.backconfig.model.auto.XrpProjectplan;
+import com.gyee.backconfig.mapper.auto.XrpProjectplanMapper;
+import com.gyee.backconfig.service.auto.IXrpProjectplanService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 郗瑞鹏
+ * @since 2022-09-14
+ */
+@Service
+public class XrpProjectplanServiceImpl extends ServiceImpl<XrpProjectplanMapper, XrpProjectplan> implements IXrpProjectplanService {
+
+    @Resource
+    private XrpProjectplanMapper xrpProjectplanMapper;
+
+    //查询所有
+    public List<XrpProjectplan> queryAll(){
+        return xrpProjectplanMapper.selectList(null);
+    }
+
+    //根据条件查询
+
+    //新增
+
+    //更新
+
+    //删除
+
+
+}

+ 3 - 2
web/backmanagerconfig/src/main/resources/application-jn.yml

@@ -45,8 +45,8 @@ spring:
     type: com.alibaba.druid.pool.DruidDataSource
     driver-class-name: org.postgresql.Driver
     url: jdbc:postgresql://10.81.3.151:5432/wisdom
-    username: gdprod
-    password: gd123
+    username: postgres
+    password: postgres
     oracle-schema=:
     #    type: com.alibaba.druid.pool.DruidDataSource
     #    url: jdbc:mysql://127.0.0.1:3306/test?characterEncoding=utf8&serverTimezone=UTC
@@ -88,6 +88,7 @@ mybatis-plus:
       logic-not-delete-value: 1
       # 删除后
       logic-delete-value: 0
+      #table-prefix: t_
 logging:
   level:
     root: info

+ 134 - 0
web/backmanagerconfig/src/test/java/BackConfigMainTests.java

@@ -0,0 +1,134 @@
+/**
+ * @author 50560
+ * @create 2022-09-15 9:53
+ */
+
+import com.alibaba.fastjson.JSONArray;
+import com.gyee.backconfig.BackConfigMain;
+import com.gyee.backconfig.mapper.auto.XrpProjectplanMapper;
+import com.gyee.backconfig.model.auto.XrpProjectplan;
+import org.apache.commons.math3.analysis.integration.IterativeLegendreGaussIntegrator;
+import org.junit.Test;
+import org.junit.runner.Result;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import javax.xml.bind.SchemaOutputResolver;
+import java.util.*;
+
+/**
+ *@BelongsProject: workpathnew
+ *@BelongsPackage: PACKAGE_NAME
+ *@Author: xiruipeng
+ *@CreateTime: 2022-09-15  09:53
+ *@Description: TODO
+ *@Version: 1.0
+ */
+@SpringBootTest(classes = {BackConfigMain.class})
+@RunWith(SpringRunner.class)
+public class BackConfigMainTests<test> {
+    @Autowired
+    private XrpProjectplanMapper xrpProjectplanMapper;
+
+    @Test
+    public void selectListPP(){
+        //查询一个list集合
+        List<XrpProjectplan> xrpProjectplanList = xrpProjectplanMapper.selectList(null);
+        xrpProjectplanList.forEach(System.out::println);
+    }
+
+    @Test
+    public void testInsert(){
+        ArrayList<XrpProjectplan> xrpProjectplans = new ArrayList<>();
+        XrpProjectplan xrpProjectplan = new XrpProjectplan();
+        xrpProjectplan.setId(100L);
+        xrpProjectplan.setProjectid("3");
+        xrpProjectplan.setGeneratingcapacity("2.4");
+        xrpProjectplan.setOutagehours(3.2);
+        xrpProjectplan.setYear("4");
+        xrpProjectplan.setMonth("6");
+        xrpProjectplan.setWindpower("22");
+        /*for (int i = 0; i < 10; i++) {
+            XrpProjectplan xrpProjectplan = new XrpProjectplan();
+            xrpProjectplan.setProjectid("3"+i);
+            xrpProjectplan.setGeneratingcapacity("2.4"+i);
+            xrpProjectplan.setOutagehours(3.2+i);
+            xrpProjectplan.setYear("4"+i);
+            xrpProjectplan.setMonth("6"+i);
+            xrpProjectplan.setWindpower("22"+i);
+            xrpProjectplans.add(xrpProjectplan);
+        }
+
+        for (XrpProjectplan projectplan : xrpProjectplans) {
+            System.out.println("-------"+projectplan.getMonth());
+            int insert = xrpProjectplanMapper.insert(projectplan);
+            System.out.println("result"+ insert);
+        }*/
+        int insert = xrpProjectplanMapper.insert(xrpProjectplan);
+        System.out.println("result"+ insert);
+        System.out.println("id"+xrpProjectplan.getId());
+    }
+
+    //deletbyid
+    @Test
+    public void testDelete(){
+        int result = xrpProjectplanMapper.deleteById(1);
+        System.out.println("result"+result);
+    }
+
+    @Test
+    public void testByMap(){
+        Map<String,Object> map=new HashMap<>();
+        //根据map设置的条件
+        map.put("projectid","2");
+        map.put("id",234);
+        int result = xrpProjectplanMapper.deleteByMap(map);
+        System.out.println("result:"+result);
+
+    }
+
+    @Test
+    public void testByDeleteBatch(){
+        List<Long> longs = Arrays.asList(2L, 1570249734874312705L, 1570251304856838146L);
+        int result = xrpProjectplanMapper.deleteBatchIds(longs);
+        System.out.println("result:"+result);
+
+    }
+
+    //修改信息
+    @Test
+    public void testUpate(){
+        XrpProjectplan xrpProjectplan = new XrpProjectplan();
+        xrpProjectplan.setId(1570251306048020483L);
+        xrpProjectplan.setProjectid("3");
+        xrpProjectplan.setGeneratingcapacity("2.4");
+        xrpProjectplan.setOutagehours(3.2);
+        xrpProjectplan.setYear("4");
+        xrpProjectplan.setMonth("6");
+        xrpProjectplan.setWindpower("22");
+        int result = xrpProjectplanMapper.updateById(xrpProjectplan);
+    }
+
+    @Test
+    public void testSelect(){
+        /*XrpProjectplan xrpProjectplan = xrpProjectplanMapper.selectById(1570251304856838146L);
+        System.out.println(xrpProjectplan);*/
+        List<Long> longs = Arrays.asList(1570251304856838145L, 1570251304856838146L, 1570250808607682562L);
+        List<XrpProjectplan> xrpProjectplanList = xrpProjectplanMapper.selectBatchIds(longs);
+        xrpProjectplanList.forEach(System.out::println);
+        Map<String
+                , Object> map = new HashMap<>();
+        map.put("id",1570250808607682562L);
+        map.put("projectid","40");
+        List<XrpProjectplan> xrpProjectplanList1 = xrpProjectplanMapper.selectByMap(map);
+        xrpProjectplanList1.forEach(System.out::println);
+    }
+
+    @Test
+    public void testMapperXml(){
+        Map<String, Object> map = xrpProjectplanMapper.selectMapById(1570251303959257090L);
+        System.out.println(map);
+    }
+}

+ 74 - 0
web/backmanagerconfig/src/test/java/MyBatisPlusServiceTest.java

@@ -0,0 +1,74 @@
+/**
+ * @author 50560
+ * @create 2022-09-15 13:18
+ */
+
+import com.gyee.backconfig.BackConfigMain;
+import com.gyee.backconfig.mapper.auto.XrpProjectplanMapper;
+import com.gyee.backconfig.model.auto.XrpProjectplan;
+import com.gyee.backconfig.service.auto.IXrpProjectplanService;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ *@BelongsProject: workpathnew
+ *@BelongsPackage: PACKAGE_NAME
+ *@Author: xiruipeng
+ *@CreateTime: 2022-09-15  13:18
+ *@Description: TODO
+ *@Version: 1.0
+ */
+@SpringBootTest(classes = {BackConfigMain.class})
+@RunWith(SpringRunner.class)
+public class MyBatisPlusServiceTest {
+
+    @Autowired
+    private IXrpProjectplanService iXrpProjectplanService;
+
+    @Test
+    public void testGetCount(){
+        long count = iXrpProjectplanService.count();
+        System.out.println("count"+count);
+    }
+
+    //mapper中没有批量添加
+    @Test
+    public void testBatchAdd(){
+        List<XrpProjectplan> list=new ArrayList<>();
+        for (int i = 0; i <10 ; i++) {
+            XrpProjectplan xrpProjectplan= new XrpProjectplan();
+            xrpProjectplan.setProjectid("3"+i);
+            xrpProjectplan.setGeneratingcapacity("2.4"+i);
+            xrpProjectplan.setOutagehours(3.2+i);
+            xrpProjectplan.setYear("4"+i);
+            xrpProjectplan.setMonth("6"+i);
+            xrpProjectplan.setWindpower("22"+i);
+            list.add(xrpProjectplan);
+        }
+        boolean b = iXrpProjectplanService.saveBatch(list);
+        System.out.println(b);
+    }
+
+
+    @Test
+    public void testAdd(){
+
+            XrpProjectplan xrpProjectplan= new XrpProjectplan();
+            xrpProjectplan.setId(100L);
+            xrpProjectplan.setProjectid("3");
+            xrpProjectplan.setGeneratingcapacity("2.4");
+            xrpProjectplan.setOutagehours(3.2);
+            xrpProjectplan.setYear("4");
+            xrpProjectplan.setMonth("6");
+            xrpProjectplan.setWindpower("22");
+       // iXrpProjectplanService.s
+
+       // System.out.println(b);
+    }
+}

+ 39 - 0
web/backmanagerconfig/src/test/java/MyBatisPlusTest.java

@@ -0,0 +1,39 @@
+/**
+ * @author 50560
+ * @create 2022-09-15 9:35
+ */
+
+import com.alibaba.fastjson.JSONArray;
+import com.gyee.backconfig.mapper.auto.XrpProjectplanMapper;
+import com.gyee.backconfig.model.auto.XrpProjectplan;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+/**
+ *@BelongsProject: workpathnew
+ *@BelongsPackage: PACKAGE_NAME
+ *@Author: xiruipeng
+ *@CreateTime: 2022-09-15  09:35
+ *@Description: TODO
+ *@Version: 1.0
+ */
+@SpringBootTest
+public class MyBatisPlusTest {
+    @Resource
+    private XrpProjectplanMapper xrpProjectplanMapper;
+
+    @Test
+    public void selectListPP(){
+        //查询一个list集合
+        List<XrpProjectplan> xrpProjectplanList = xrpProjectplanMapper.selectList(null);
+        xrpProjectplanList.forEach(System.out::println);
+    }
+
+
+
+}

+ 148 - 0
web/backmanagerconfig/src/test/java/MyBatisPlusWrapperTest.java

@@ -0,0 +1,148 @@
+/**
+ * @author 50560
+ * @create 2022-09-15 14:48
+ */
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.gyee.backconfig.BackConfigMain;
+import com.gyee.backconfig.mapper.auto.XrpProjectplanMapper;
+import com.gyee.backconfig.model.auto.XrpProjectplan;
+import com.gyee.common.model.StringUtils;
+import net.minidev.json.writer.UpdaterMapper;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ *@BelongsProject: workpathnew
+ *@BelongsPackage: PACKAGE_NAME
+ *@Author: xiruipeng
+ *@CreateTime: 2022-09-15  14:48
+ *@Description: TODO
+ *@Version: 1.0
+ */
+@SpringBootTest(classes = {BackConfigMain.class})
+@RunWith(SpringRunner.class)
+public class MyBatisPlusWrapperTest {
+    @Autowired
+    private XrpProjectplanMapper xrpProjectplanMapper;
+
+    @Test
+    public void testWrapper(){
+        //==>  Preparing: SELECT ID,PROJECTID,GENERATINGCAPACITY,OUTAGEHOURS,YEAR,MONTH,WINDPOWER,isdeleted FROM XRP_PROJECTPLAN WHERE isdeleted=1
+        // AND (year LIKE ? AND outagehours BETWEEN ? AND ? AND windpower IS NOT NULL)
+        QueryWrapper<XrpProjectplan> queryWrapper=new QueryWrapper<XrpProjectplan>();
+        queryWrapper.like("year","9")
+               // .between("outagehours",2.43,2.50)
+                .isNotNull("windpower");
+        List<XrpProjectplan> list = xrpProjectplanMapper.selectList(queryWrapper);
+        list.forEach(System.out::println);
+
+    }
+
+    @Test
+    public void testOrder(){
+        //查询信息,按照generatingcapacity降序,相同按照id升序
+        QueryWrapper<XrpProjectplan> queryWrapper = new QueryWrapper<>();
+        queryWrapper.orderByDesc("generatingcapacity").orderByAsc("id");
+        List<XrpProjectplan> list = xrpProjectplanMapper.selectList(queryWrapper);
+        list.forEach(System.out::println);
+
+    }
+
+    @Test
+    public void testDelete(){
+        //删除id
+        QueryWrapper<XrpProjectplan> queryWrapper=new QueryWrapper<>();
+        //queryWrapper.isNotNull("month");
+        queryWrapper.eq("month","");
+        int delete = xrpProjectplanMapper.delete(queryWrapper);
+        System.out.println("result"+ delete);
+    }
+
+    //update biao set zd="" where month='' and  id or year
+    @Test
+    public void testUpdate2(){
+
+        //将month为”“并且id>jj或者year like 49
+        QueryWrapper<XrpProjectplan> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("month","")
+                .gt("id",1570251305913802753L)
+                .or()
+                .like("year","49");
+        XrpProjectplan xrpProjectplan=new XrpProjectplan();
+        xrpProjectplan.setProjectid("5");
+        xrpProjectplan.setGeneratingcapacity("100.4");
+
+        //设置内容和条件
+        int result = xrpProjectplanMapper.update(xrpProjectplan, queryWrapper);
+        System.out.println("result:"+result);
+    }
+
+    @Test
+    public void testUpdatePer(){
+
+        //将month为”“并且(id>jj或者year like 49)
+        //lambda中的条件优先执行
+        //==>  Preparing: UPDATE XRP_PROJECTPLAN SET PROJECTID=?, GENERATINGCAPACITY=?
+        // WHERE isdeleted=1 AND (month = ? AND (id > ? OR year LIKE ?))
+        QueryWrapper<XrpProjectplan> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("month","")
+                .and(
+                        i->i.gt("id",1570251305913802753L)
+                                .or()
+                                .like("year","49")
+                );
+
+        XrpProjectplan xrpProjectplan=new XrpProjectplan();
+        xrpProjectplan.setProjectid("90");
+        xrpProjectplan.setGeneratingcapacity("111.4");
+
+        //设置内容和条件
+        int result = xrpProjectplanMapper.update(xrpProjectplan, queryWrapper);
+        System.out.println("result:"+result);
+    }
+
+    @Test
+    public void testPro(){
+        QueryWrapper<XrpProjectplan> queryWrapper=new QueryWrapper<>();
+        queryWrapper.select("ID","PROJECTID","YEAR");
+        //组装属性字段
+        List<Map<String, Object>> maps = xrpProjectplanMapper.selectMaps(queryWrapper);
+        maps.forEach(System.out::println);
+    }
+
+    @Test
+    public void testUpdate(){
+        UpdateWrapper<XrpProjectplan> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("month","")
+                .gt("id",1570251305913802753L)
+                .or()
+                .like("year","49");
+        updateWrapper.set("month","33").set("YEAR","50");
+        int result = xrpProjectplanMapper.update(null, updateWrapper);
+        System.out.println("result:"+result);
+    }
+
+    //组装条件
+    @Test
+    public void test(){
+       String year="";
+       Long idBegin=1570251304856838145L;
+       Long idEnd=1570284357834518534L;
+       QueryWrapper<XrpProjectplan> queryWrapper=new QueryWrapper<>();
+       //加入某个字符串不为null 不为空字符串,不为空白符
+       if(StringUtils.isNotEmpty(year)){
+           queryWrapper.like("year",year);
+       }
+
+       //if(idBegin)
+
+    }
+}

+ 13 - 0
web/backmanagerconfig/src/test/java/OrderServiceApplicationTests.java

@@ -0,0 +1,13 @@
+package com.jack.orderservice;
+
+import org.junit.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+class OrderServiceApplicationTests {
+
+    @Test
+    void contextLoads() {
+    }
+
+}