test
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.wyl.example</groupId>
|
||||
<artifactId>spring-boot</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>com.example</groupId>
|
||||
<artifactId>spring-boot-mybatis</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>spring-boot-mybatis</name>
|
||||
<description>spring-boot-mybatis</description>
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.wyl.springbootmybatis;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class SpringBootMybatisApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SpringBootMybatisApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.wyl.springbootmybatis.mybatis.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName mybatis_test
|
||||
*/
|
||||
@TableName(value ="mybatis_test")
|
||||
@Data
|
||||
public class MybatisTest implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField(value = "code")
|
||||
private String code;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.wyl.springbootmybatis.mybatis.mapper;
|
||||
|
||||
import com.wyl.springbootmybatis.mybatis.domain.MybatisTest;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author wyl
|
||||
* @description 针对表【mybatis_test】的数据库操作Mapper
|
||||
* @createDate 2022-05-16 22:33:34
|
||||
* @Entity com.wyl.springbootmybatis.mybatis.domain.MybatisTest
|
||||
*/
|
||||
public interface MybatisTestMapper extends BaseMapper<MybatisTest> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.wyl.springbootmybatis.mybatis.service;
|
||||
|
||||
import com.wyl.springbootmybatis.mybatis.domain.MybatisTest;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author wyl
|
||||
* @description 针对表【mybatis_test】的数据库操作Service
|
||||
* @createDate 2022-05-16 22:33:34
|
||||
*/
|
||||
public interface MybatisTestService extends IService<MybatisTest> {
|
||||
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.wyl.springbootmybatis.mybatis.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.wyl.springbootmybatis.mybatis.domain.MybatisTest;
|
||||
import com.wyl.springbootmybatis.mybatis.service.MybatisTestService;
|
||||
import com.wyl.springbootmybatis.mybatis.mapper.MybatisTestMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author wyl
|
||||
* @description 针对表【mybatis_test】的数据库操作Service实现
|
||||
* @createDate 2022-05-16 22:33:34
|
||||
*/
|
||||
@Service
|
||||
public class MybatisTestServiceImpl extends ServiceImpl<MybatisTestMapper, MybatisTest>
|
||||
implements MybatisTestService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
spring.datasource.url=jdbc:mysql://192.168.123.102:3306/wyl_test?useUnicode=true&serverTimezone=UTC&characterEncoding=utf8&useSSL=false&autoReconnect=true&failOverReadOnly=false&rewriteBatchedStatements=true
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=Wyl.0629
|
||||
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||
server.port=80
|
||||
@@ -0,0 +1,15 @@
|
||||
<?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.wyl.springbootmybatis.mybatis.mapper.MybatisTestMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.wyl.springbootmybatis.mybatis.domain.MybatisTest">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="code" column="code" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,code
|
||||
</sql>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user