whyclxw
2021-04-15 b40ac12d6231f261581fb4281c905819530e934d
提交
12个文件已修改
4个文件已删除
6个文件已添加
207 ■■■■■ 已修改文件
.idea/compiler.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/libraries/Maven__com_baomidou_mybatis_plus_3_1_2.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/libraries/Maven__com_baomidou_mybatis_plus_boot_starter_3_1_2.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/libraries/Maven__org_mybatis_mybatis_3_5_1.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/libraries/Maven__org_mybatis_mybatis_3_5_6.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/libraries/Maven__org_mybatis_mybatis_spring_2_0_1.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/libraries/Maven__org_mybatis_mybatis_spring_2_0_6.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/libraries/Maven__org_mybatis_spring_boot_mybatis_spring_boot_autoconfigure_2_1_4.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/libraries/Maven__org_mybatis_spring_boot_mybatis_spring_boot_starter_2_1_4.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/vcs.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SpringBootF_1.iml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pom.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/example/lxw/controller/User_infController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/example/lxw/mapper/User_InfMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/example/lxw/pojo/User_inf.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/example/lxw/service/User_infService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/User_infMapper.xml 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/java/com/example/lxw/MpperTest.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
target/classes/application.yml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
target/classes/com/example/lxw/pojo/User_inf.class 补丁 | 查看 | 原始文档 | blame | 历史
target/test-classes/com/example/lxw/MpperTest.class 补丁 | 查看 | 原始文档 | blame | 历史
.idea/compiler.xml
@@ -7,16 +7,19 @@
        <sourceOutputDir name="target/generated-sources/annotations" />
        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
        <outputRelativeToContentRoot value="true" />
        <module name="springboot-mybatisplus" />
        <module name="SpringBootF_1" />
      </profile>
    </annotationProcessing>
    <bytecodeTargetLevel>
      <module name="springboot-mybatisplus" target="1.8" />
      <module name="SpringBootF_1" target="1.8" />
    </bytecodeTargetLevel>
  </component>
  <component name="JavacSettings">
    <option name="ADDITIONAL_OPTIONS_OVERRIDE">
      <module name="SpringBootF_1" options="-parameters" />
      <module name="springboot-mybatisplus" options="-parameters" />
    </option>
  </component>
</project>
.idea/libraries/Maven__com_baomidou_mybatis_plus_3_1_2.xml
New file
@@ -0,0 +1,13 @@
<component name="libraryTable">
  <library name="Maven: com.baomidou:mybatis-plus:3.1.2">
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/../../maven/apache-maven-3.6.3/maven_jar/com/baomidou/mybatis-plus/3.1.2/mybatis-plus-3.1.2.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$PROJECT_DIR$/../../maven/apache-maven-3.6.3/maven_jar/com/baomidou/mybatis-plus/3.1.2/mybatis-plus-3.1.2-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$PROJECT_DIR$/../../maven/apache-maven-3.6.3/maven_jar/com/baomidou/mybatis-plus/3.1.2/mybatis-plus-3.1.2-sources.jar!/" />
    </SOURCES>
  </library>
</component>
.idea/libraries/Maven__com_baomidou_mybatis_plus_boot_starter_3_1_2.xml
New file
@@ -0,0 +1,13 @@
<component name="libraryTable">
  <library name="Maven: com.baomidou:mybatis-plus-boot-starter:3.1.2">
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/../../maven/apache-maven-3.6.3/maven_jar/com/baomidou/mybatis-plus-boot-starter/3.1.2/mybatis-plus-boot-starter-3.1.2.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$PROJECT_DIR$/../../maven/apache-maven-3.6.3/maven_jar/com/baomidou/mybatis-plus-boot-starter/3.1.2/mybatis-plus-boot-starter-3.1.2-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$PROJECT_DIR$/../../maven/apache-maven-3.6.3/maven_jar/com/baomidou/mybatis-plus-boot-starter/3.1.2/mybatis-plus-boot-starter-3.1.2-sources.jar!/" />
    </SOURCES>
  </library>
</component>
.idea/libraries/Maven__org_mybatis_mybatis_3_5_1.xml
New file
@@ -0,0 +1,13 @@
<component name="libraryTable">
  <library name="Maven: org.mybatis:mybatis:3.5.1">
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/../../maven/apache-maven-3.6.3/maven_jar/org/mybatis/mybatis/3.5.1/mybatis-3.5.1.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$PROJECT_DIR$/../../maven/apache-maven-3.6.3/maven_jar/org/mybatis/mybatis/3.5.1/mybatis-3.5.1-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$PROJECT_DIR$/../../maven/apache-maven-3.6.3/maven_jar/org/mybatis/mybatis/3.5.1/mybatis-3.5.1-sources.jar!/" />
    </SOURCES>
  </library>
</component>
.idea/libraries/Maven__org_mybatis_mybatis_3_5_6.xml
File was deleted
.idea/libraries/Maven__org_mybatis_mybatis_spring_2_0_1.xml
New file
@@ -0,0 +1,13 @@
<component name="libraryTable">
  <library name="Maven: org.mybatis:mybatis-spring:2.0.1">
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/../../maven/apache-maven-3.6.3/maven_jar/org/mybatis/mybatis-spring/2.0.1/mybatis-spring-2.0.1.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$PROJECT_DIR$/../../maven/apache-maven-3.6.3/maven_jar/org/mybatis/mybatis-spring/2.0.1/mybatis-spring-2.0.1-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$PROJECT_DIR$/../../maven/apache-maven-3.6.3/maven_jar/org/mybatis/mybatis-spring/2.0.1/mybatis-spring-2.0.1-sources.jar!/" />
    </SOURCES>
  </library>
</component>
.idea/libraries/Maven__org_mybatis_mybatis_spring_2_0_6.xml
File was deleted
.idea/libraries/Maven__org_mybatis_spring_boot_mybatis_spring_boot_autoconfigure_2_1_4.xml
File was deleted
.idea/libraries/Maven__org_mybatis_spring_boot_mybatis_spring_boot_starter_2_1_4.xml
File was deleted
.idea/vcs.xml
New file
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="VcsDirectoryMappings">
    <mapping directory="$PROJECT_DIR$" vcs="Git" />
  </component>
</project>
SpringBootF_1.iml
@@ -28,7 +28,6 @@
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-thymeleaf:2.1.12.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.1.12.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.1.12.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.1.12.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.1.12.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
    <orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
@@ -65,19 +64,20 @@
    <orderEntry type="library" name="Maven: org.springframework:spring-aop:5.1.13.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-context:5.1.13.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-expression:5.1.13.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.4" level="project" />
    <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-boot-starter:3.1.2" level="project" />
    <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus:3.1.2" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.1.12.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.1.12.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.2.0" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.1.13.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.springframework:spring-tx:5.1.13.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.1.4" level="project" />
    <orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.6" level="project" />
    <orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.6" level="project" />
    <orderEntry type="library" scope="RUNTIME" name="Maven: mysql:mysql-connector-java:8.0.19" level="project" />
    <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-extension:3.1.2" level="project" />
    <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-core:3.1.2" level="project" />
    <orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-annotation:3.1.2" level="project" />
    <orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:1.2" level="project" />
    <orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.1" level="project" />
    <orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.1" level="project" />
    <orderEntry type="library" name="Maven: com.alibaba:druid:1.1.10" level="project" />
    <orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.10" level="project" />
    <orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.1.12.RELEASE" level="project" />
pom.xml
@@ -30,9 +30,9 @@
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>mybatis-spring-boot-starter</artifactId>
            <version>2.1.4</version>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
            <version>3.1.2</version>
        </dependency>
        <!--<dependency>
            <groupId>org.thymeleaf.extras</groupId>
src/main/java/com/example/lxw/controller/User_infController.java
@@ -24,8 +24,12 @@
    @ApiOperation(value = "查询所有的用户")
    public ServiceModel selectList(){
        ServiceModel model=user_infService.selectList();
        /*model.setData(1);
        model.setData("查询成功");*/
        return model;
    }
    @PutMapping("searchByBaojiUsr")
    @ApiOperation(value = "查询所有用户的包机组信息")
    public ServiceModel searchByBaojiUsr(){
        ServiceModel model=user_infService.searchByBaojiUsr();
        return model;
    }
src/main/java/com/example/lxw/mapper/User_InfMapper.java
@@ -18,5 +18,5 @@
     * 返回所有的用户
     * @return
     */
//    public List<User_inf> searchAll();
    public List<User_inf> searchByBaojiUsr();
}
src/main/java/com/example/lxw/pojo/User_inf.java
@@ -1,10 +1,14 @@
package com.example.lxw.pojo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import java.io.Serializable;
/**
 * @author lxw
@@ -15,7 +19,8 @@
@AllArgsConstructor
@NoArgsConstructor
@TableName(schema = "db_user",value = "tb_user_inf")
public class User_inf {
public class User_inf implements Serializable {
    @TableId(value = "uId")
    private long uId;
    private String uSnId;
    private String uName;
@@ -39,7 +44,14 @@
    private String upassword;
    private String uPubKeyX;
    private String uPubKeyY;
    @TableField(value = "uKey_ID")
    private String uKeyId;
    @TableField(value = "face_id")
    private long faceId;
    private String license;
    @TableField(exist = false)
    private String note;
    @TableField(exist = false)
    private UserBattgroupBaojigroupUsr baojigroupUsr;
}
src/main/java/com/example/lxw/service/User_infService.java
@@ -30,4 +30,15 @@
        model.setData(list);
        return model;
    }
    /**
     * 查询所有用户的包机组信息
     * */
    public  ServiceModel searchByBaojiUsr(){
        List<User_inf> list=user_infMapper.searchByBaojiUsr();
        ServiceModel model=new ServiceModel();
        model.setCode(1);
        model.setData(list);
        return model;
    }
}
src/main/resources/application.yml
@@ -33,16 +33,16 @@
      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
      id-type: AUTO
      #驼峰下划线转换
      table-underline: true
      table-underline: false
      #数据库大写下划线转换
      capital-mode: true
      capital-mode: false
      #mp2.3+ 全局表前缀 tb_
      table-prefix: tb_
      #刷新mapper 调试神器
  # refresh-mapper: true
  configuration:
    #配置返回数据库(column下划线命名&&返回java实体是驼峰命名),自动匹配无需as(没开启这个,SQL需要写as: select user_id as userId)
    map-underscore-to-camel-case: true
    map-underscore-to-camel-case: false
    cache-enabled: false
    #mybatis日志输出
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
src/main/resources/mapper/User_infMapper.xml
New file
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.lxw.mapper.User_InfMapper" >
    <resultMap id="baojiUserMap" type="User_inf">
        <result column="uSnId" property="uSnId" />
        <result column="uName" property="uName" />
        <association property="UserBattgroupBaojigroupUsr">
            <result property="baojiGroupId" column="baojiGroupId"/>
        </association>
    </resultMap>
    <select id="searchByBaojiUsr" resultMap="baojiUserMap">
        SELECT tb_user_inf.*,tb_user_battgroup_baojigroup_usr.baoji_group_id
        from tb_user_inf
        LEFT JOIN tb_user_battgroup_baojigroup_usr ON tb_user_inf.uId=tb_user_battgroup_baojigroup_usr.uId
        order by tb_user_inf.uid
    </select>
</mapper>
src/test/java/com/example/lxw/MpperTest.java
@@ -6,26 +6,24 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
import java.util.List;
/**
 * @author lxw
 * @create 2021-04-14 10:20
 */
@SpringBootTest
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class MpperTest {
    @Resource
    private User_InfMapper mapper;
   @Autowired
    private User_InfMapper user_infMapper;
    @Test
    public void searchAll(){
        List<User_inf> list= mapper.selectList(new QueryWrapper<>());
        List<User_inf> list= user_infMapper.selectList(new QueryWrapper<>());
        list.forEach(uinf-> System.out.println(uinf.toString()));
    }
    @Test
target/classes/application.yml
@@ -33,16 +33,16 @@
      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
      id-type: AUTO
      #驼峰下划线转换
      table-underline: true
      table-underline: false
      #数据库大写下划线转换
      capital-mode: true
      capital-mode: false
      #mp2.3+ 全局表前缀 tb_
      table-prefix: tb_
      #刷新mapper 调试神器
  # refresh-mapper: true
  configuration:
    #配置返回数据库(column下划线命名&&返回java实体是驼峰命名),自动匹配无需as(没开启这个,SQL需要写as: select user_id as userId)
    map-underscore-to-camel-case: true
    map-underscore-to-camel-case: false
    cache-enabled: false
    #mybatis日志输出
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
target/classes/com/example/lxw/pojo/User_inf.class
Binary files differ
target/test-classes/com/example/lxw/MpperTest.class
Binary files differ