整体项目链接地址:
StringBoot+Mybatis的增删改查(一)
StringBoot+Mybatis的增删改查(二)
StringBoot+Mybatis的增删改查(三)
StringBoot+Mybatis的增删改查(四)
StringBoot+Mybatis的增删改查(五)
七、配置
1、css美化(beautify.css)
@charset "UTF-8";
* {
padding: 0;
margin: 0;
box-sizing: border-box;
font-family: "微软雅黑";
}
body {
font-family: Arial;
color: #4f6b72;
background: #E6EAE9;
}
/* 头部标题 */
.header {
background-size:100% 185px;
background-repeat:no-repeat;
padding: 53px;
text-align: center;
}
.header h1 {
font-size: 50px;
}
a {
color: #c75f3e;
text-decoration: none; /* 去除默认的下划线 */
}
#table {
width: 700px;
padding: 0;
margin: 100px auto 0 auto;
}
td {
text-align: center;
background: #fff;
font-size:11px;
padding: 6px 6px 6px 12px;
}
input
{
color: #000;
letter-spacing: 1px;
margin-bottom:30px;/*输入框设置*/
border:none;
border-bottom:1px solid #000;
outline:none;
background:transparent;
}
input[type="submit"]
{
background: transparent;
border: none;
outline: none;
color: #fff;
background:#03a9f4;
padding: 10px 20px;
cursor: pointer;
border-radius: 5px;
}
2、数据库配置(application.properties)
#app name
spring.application.name=com.xxx
#web port
server.port=8080
#datasource configure
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.name=defaultDataSource
spring.datasource.url=jdbc:mysql://localhost:3306/xxx?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC
spring.datasource.username=xxxxx
spring.datasource.password=xxxxx
mybatis.mapper-locations=classpath:mybatis/*.xml
3、依赖配置(pom.xml)
<?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>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com</groupId>
<artifactId>xxx</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>xxx</name>
<description>xxx</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.5.10</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.0.27</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
4、数据库
part表
detail表
后续在我Java专栏里。