1.resources下的配置文件:
mybatiesplus-config-system.properties
#????????
OutputDir=E:/ruanjian/IdeaProjects/lh.edu/lh-service/lh-service-system/src/main/java
#mapper.xml SQL??????
OutputDirXml=E:/ruanjian/IdeaProjects/lh.edu/lh-service/lh-service-system/src/main/resources
#domain?????
OutputDirBase=E:/ruanjian/IdeaProjects/lh.edu/lh-pojo/lh-pojo-system/src/main/java
#????
author=whale.chen
#??????:??????
parent=com.lh.ymcc
#???????
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql:///ymcc-system?serverTimezone=UTC
jdbc.user=root
jdbc.pwd=123456
2.resources/templates下的自定义模板引擎(Mybatisplus有自己的模板)
这里有两个自定义模板
1.controller
名字:
controller.java.vm
package ${package.Controller};
import ${package.Service}.${table.serviceName};
import ${package.Entity}.${entity};
import com.lh.ymcc.query.${entity}Query;
import com.lh.ymcc.result.JSONResult;
import com.lh.ymcc.result.PageList;
import com.baomidou.mybatisplus.plugins.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/${table.entityPath}")
public class ${entity}Controller {
@Autowired
public ${table.serviceName} ${table.entityPath}Service;
/**
* 保存和修改公用的
*/
@RequestMapping(value="/save",method= RequestMethod.POST)
public JSONResult saveOrUpdate(@RequestBody ${entity} ${table.entityPath}){
if(${table.entityPath}.getId()!=null){
${table.entityPath}Service.updateById(${table.entityPath});
}else{
${table.entityPath}Se