javaEEday09-mybatis-crud-准备工作

This commit is contained in:
xx
2026-10-18 14:57:19 +08:00
parent 53fc236a5b
commit 19cc314870
8 changed files with 209 additions and 0 deletions
@@ -0,0 +1,13 @@
package com.inmind;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class SpringbootMybatisCrudApplication {
public static void main(String[] args) {
SpringApplication.run(SpringbootMybatisCrudApplication.class, args);
}
}
@@ -0,0 +1,8 @@
package com.inmind.mapper;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface EmpMapper {
//定义方法
}
@@ -0,0 +1,26 @@
package com.inmind.pojo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate;
import java.time.LocalDateTime;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Emp {
private Integer id;//id
private String username;//用户名
private String password;//密码
private String name;//姓名
private Short gender;//性别:1:男 2:女
private String image;//图像
private Short job;//职位
private LocalDate entrydate;//入职日期
private Integer deptId;//部门编号
private LocalDateTime createTime;//创建时间
private LocalDateTime updateTime;//更新时间
}
@@ -0,0 +1,6 @@
spring.application.name=springboot-mybatis-crud
#spring.datasource.type= com.alibaba.druid.pool.DruidDataSource
spring.datasource.url= jdbc:mysql://localhost:3306/mybatis
spring.datasource.username= root
spring.datasource.password= 1234
spring.datasource.driver-class-name= com.mysql.cj.jdbc.Driver
@@ -0,0 +1,13 @@
package com.inmind;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class SpringbootMybatisCrudApplicationTests {
@Test
void contextLoads() {
}
}