Skip to content

Commit

Permalink
mybatis-plus 代码生成器测试
Browse files Browse the repository at this point in the history
  • Loading branch information
NeverKnowsTomorrow committed Sep 10, 2024
1 parent 067a846 commit e7e7202
Show file tree
Hide file tree
Showing 55 changed files with 983 additions and 1 deletion.
64 changes: 64 additions & 0 deletions mybatis-plus-mysql-demo/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-samples</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>

<artifactId>mybatis-plus-mysql-demo</artifactId>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<scope>annotationProcessor</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>${mybatisplus.artifactId}</artifactId>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-generator</artifactId>
</dependency>
<!-- 模板引擎 -->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-engine-core</artifactId>
<version>2.0</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.baomidou;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.baomidou.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;

/**
* <p>
* 前端控制器
* </p>
*
* @author qiao
* @since 2024-09-10 23:23:45
*/
@Controller
@RequestMapping("/account")
public class AccountController {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.baomidou.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;

/**
* <p>
* 前端控制器
* </p>
*
* @author qiao
* @since 2024-09-10 23:23:45
*/
@Controller
@RequestMapping("/actor")
public class ActorController {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.baomidou.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;

/**
* <p>
* 员工记录表 前端控制器
* </p>
*
* @author qiao
* @since 2024-09-10 23:23:45
*/
@Controller
@RequestMapping("/employees")
public class EmployeesController {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.baomidou.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;

/**
* <p>
* 前端控制器
* </p>
*
* @author qiao
* @since 2024-09-10 23:23:45
*/
@Controller
@RequestMapping("/filmActor")
public class FilmActorController {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.baomidou.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;

/**
* <p>
* 前端控制器
* </p>
*
* @author qiao
* @since 2024-09-10 23:23:45
*/
@Controller
@RequestMapping("/film")
public class FilmController {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.baomidou.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;

/**
* <p>
* 前端控制器
* </p>
*
* @author qiao
* @since 2024-09-10 23:23:45
*/
@Controller
@RequestMapping("/mylock")
public class MylockController {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.baomidou.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;

/**
* <p>
* 前端控制器
* </p>
*
* @author qiao
* @since 2024-09-10 23:23:45
*/
@Controller
@RequestMapping("/t1")
public class T1Controller {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.baomidou.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;

/**
* <p>
* 前端控制器
* </p>
*
* @author qiao
* @since 2024-09-10 23:23:45
*/
@Controller
@RequestMapping("/t2")
public class T2Controller {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.baomidou.entity;

import lombok.Data;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
public class Account {
private Long id;
private String name;
private Integer balance;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.baomidou.entity;

import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Getter;
import lombok.Setter;

/**
* <p>
*
* </p>
*
* @author qiao
* @since 2024-09-10 23:23:45
*/
@Getter
@Setter
public class Actor implements Serializable {

private static final long serialVersionUID = 1L;

private Integer id;

private String name;

private LocalDateTime updateTime;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package com.baomidou.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Getter;
import lombok.Setter;

/**
* <p>
* 员工记录表
* </p>
*
* @author qiao
* @since 2024-09-10 23:23:45
*/
@Getter
@Setter
public class Employees implements Serializable {

private static final long serialVersionUID = 1L;

@TableId(value = "id", type = IdType.AUTO)
private Integer id;

/**
* 姓名
*/
private String name;

/**
* 年龄
*/
private Integer age;

/**
* 职位
*/
private String position;

/**
* 入职时间
*/
private LocalDateTime hireTime;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.baomidou.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import lombok.Getter;
import lombok.Setter;

/**
* <p>
*
* </p>
*
* @author qiao
* @since 2024-09-10 23:23:45
*/
@Getter
@Setter
public class Film implements Serializable {

private static final long serialVersionUID = 1L;

@TableId(value = "id", type = IdType.AUTO)
private Integer id;

private String name;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.baomidou.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Getter;
import lombok.Setter;

/**
* <p>
*
* </p>
*
* @author qiao
* @since 2024-09-10 23:23:45
*/
@Getter
@Setter
@TableName("film_actor")
public class FilmActor implements Serializable {

private static final long serialVersionUID = 1L;

private Integer id;

private Integer filmId;

private Integer actorId;

private String remark;
}
Loading

0 comments on commit e7e7202

Please sign in to comment.