因为工作需要以及为了自己后来搭建起来方便来做个笔记 如有问题欢迎指出
首先创建springBoot项目
1插件安装
因为spring官方提供了STS这个插件可以方便的进行springBoot项目的开发,所以先安装STS插件。
打开Eclipse选择 Help/EclipseMarketspace 打开插件市场,输入STS搜索插件如图:
然后傻瓜式安装,安装完了后就开始创建项目了。
创建项目
选择上方的 spring starter project 然后next
填完以后点击next
选择springboot版本我选的2.4.5因为可能存在差异这个我和我借鉴的选择的也不一样。然后选中spring web依赖,点击finish,这样我们一个springboot就创建好了:
因为我在做的时候很多时候搜索到的配置信息都是yml的 所以我后面吧properties文件改成了yml的文件
然后这个是创建后pom文件内部自动生成的依赖,因为我们选着web,所以帮我们添加好了web的依赖,还有个是单元测试默认添加的。
这里啰嗦几句给新手解惑下,这个依赖是springMvc的核心依赖。springMvc没有必要的配置,没有必需的配置类,只有在想要自定义的时候添加一些实现了WebMvcConfigurer接口的配置类,添加了这个等于springBoot整合完了springMvc。
然后添加在pom文件thymeleaf来测试我们目前搭建的项目是否正常。
<!-- Thymeleaf组件 --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-thymeleaf</artifactId></dependency>
springBoot会默认扫描入口启动类所在包和下面包的注解注入bean,也可以通过在入口类添加注解指定包:
@ComponentScan(basePackages = {"com.szscada.controller"})//扫描注解注入bean
创建控制层页面
@Controller
public class UserController {@RequestMapping(value="/user")public String index(Model model) {List<User> users = new ArrayList<User>();users.add(new User(1,"许七安", "不逛勾栏", "一般"));users.add(new User(2,"缘之空", "不可描述", "还好"));users.add(new User(3,"李长庚", "太过稳健", "呵呵"));model.addAttribute("users",users);return "user";}}
创建html页面
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head><meta charset="UTF-8"><title >Title</title>
</head>
<body><table><tr><td>id</td><td>姓名</td><td>爱好</td><td>性别</td></tr><tr th:each="user:${users}" th:object="${user}"><td th:text="${user.id}"></td><td th:text="${user.name}"></td><td th:text="${user.skill}"></td><td th:text="${user.evaluate}"></td></tr></table>
</body>
</html>
创建实体类bean
package com.szscada.entity;public class User {private int id;private String name;private String skill;private String evaluate;public int getId() {return id;}public void setId(int id) {this.id = id;}public String getName() {return name;}public void setName(String name) {this.name = name;}public String getSkill() {return skill;}public void setSkill(String skill) {this.skill = skill;}public String getEvaluate() {return evaluate;}public void setEvaluate(String evaluate) {this.evaluate = evaluate;}@Overridepublic String toString() {return "User [id=" + id + ", name=" + name + ", skill=" + skill + ", evaluate=" + evaluate + "]";}public User(int id, String name, String skill, String evaluate) {super();this.id = id;this.name = name;this.skill = skill;this.evaluate = evaluate;}public User() {super();}}
然后运行一下 MindCloud1Application文件 再到页面上http://localhost:8080/user 就可以访问到界面样子了
这里放上我的目录结构
这里是我参考的整合的博主的访问博客https://blog.csdn.net/qq_35487047/article/details/82291400
然后开始整合我们最容易出问题的mybatisPlus
1添加依赖和添加配置文件
新增如下依赖
<dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId> <version>8.0.18</version><scope>runtime</scope></dependency><!-- 这个依赖是lombok插件的依赖你需要先装插件才会起作用 --><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><optional>true</optional></dependency><!-- mybatis plus 代码生成器 --><dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-boot-starter</artifactId><version>3.2.0</version></dependency><dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-generator</artifactId><version>3.2.0</version></dependency><dependency><groupId>org.freemarker</groupId><artifactId>freemarker</artifactId><version>2.3.28</version></dependency><dependency><groupId>com.alibaba</groupId><artifactId>fastjson</artifactId><version>1.2.47</version></dependency>
然后修改yml配置文件信息
yml配置文件内容
# 配置端口
server:port: 8080
spring:# 配置数据源datasource:driver-class-name: com.mysql.cj.jdbc.Driverurl: jdbc:mysql://localhost:3306/user?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&nullCatalogMeansCurrent=true&serverTimezone=GMT%2B8username: rootpassword: 123456# activiti default configuration# mybatis-plus相关配置
mybatis-plus:# xml扫描,多个目录用逗号或者分号分隔(告诉 Mapper 所对应的 XML 文件位置)mapper-locations: classpath:mapper/*.xml# 以下配置均有默认值,可以不设置global-config:db-config:#主键类型 AUTO:"数据库ID自增" INPUT:"用户输入ID",ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID";id-type: auto#字段策略 IGNORED:"忽略判断" NOT_NULL:"非 NULL 判断") NOT_EMPTY:"非空判断"#field-strategy: NOT_EMPTY#数据库类型db-type: MYSQLconfiguration:# 是否开启自动驼峰命名规则映射:从数据库列名到Java属性驼峰命名的类似映射map-underscore-to-camel-case: true# 如果查询结果中包含空值的列,则 MyBatis 在映射的时候,不会映射这个字段call-setters-on-nulls: true# 这个配置会将执行的sql打印出来,在开发或测试的时候可以用log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
mybatisplus分页插件MybatisPlusConfig:
@Configuration
public class MybatisPlusConfig {/*** 分页插件*/@Beanpublic PaginationInterceptor paginationInterceptor() {return new PaginationInterceptor();}
}
我们这里加一个mybatisPlus 代码生成器我们可以解放双手不用手动搞相关的service,dao等那些类的配置了
自动生成代码工具类
package com.szscada.util;import java.util.Scanner;import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
import com.baomidou.mybatisplus.generator.config.GlobalConfig;
import com.baomidou.mybatisplus.generator.config.PackageConfig;
import com.baomidou.mybatisplus.generator.config.StrategyConfig;
import com.baomidou.mybatisplus.generator.config.TemplateConfig;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;/*** 自动生成mybatisplus的相关代码*/
public class GeneratorCodeConfig {public static String scanner(String tip) {Scanner scanner = new Scanner(System.in);StringBuilder help = new StringBuilder();help.append("请输入" + tip + ":");System.out.println(help.toString());if (scanner.hasNext()) {String ipt = scanner.next();if (StringUtils.isNotEmpty(ipt)) {return ipt;}}throw new MybatisPlusException("请输入正确的" + tip + "!");}public static void main(String[] args) {// 代码生成器AutoGenerator mpg = new AutoGenerator();// 全局配置GlobalConfig gc = new GlobalConfig();String projectPath = System.getProperty("user.dir");gc.setOutputDir(projectPath + "/src/main/java");gc.setAuthor("astupidcoder");gc.setOpen(false);//实体属性 Swagger2 注解gc.setSwagger2(false);mpg.setGlobalConfig(gc);// 数据源配置DataSourceConfig dsc = new DataSourceConfig();dsc.setUrl("jdbc:mysql://127.0.0.1:3306/user?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true");dsc.setDriverName("com.mysql.cj.jdbc.Driver");dsc.setUsername("root");dsc.setPassword("123456");mpg.setDataSource(dsc);// 包配置PackageConfig pc = new PackageConfig();
// pc.setModuleName(scanner("模块名"));pc.setParent("com.szscada");pc.setEntity("entity");pc.setMapper("dao");pc.setService("service");pc.setServiceImpl("service.impl");mpg.setPackageInfo(pc);// 自定义配置
// InjectionConfig cfg = new InjectionConfig() {
// @Override
// public void initMap() {
// // to do nothing
// }
// };// 如果模板引擎是 freemarker
// String templatePath = "/templates/mapper.xml.ftl";// 如果模板引擎是 velocity// String templatePath = "/templates/mapper.xml.vm";// 自定义输出配置
// List<FileOutConfig> focList = new ArrayList<>();// 自定义配置会被优先输出
// focList.add(new FileOutConfig(templatePath) {
// @Override
// public String outputFile(TableInfo tableInfo) {
// // 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
// return projectPath + "/src/main/resources/mapper/" + pc.getModuleName()
// + "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
// }
// });/*cfg.setFileCreate(new IFileCreate() {@Overridepublic boolean isCreate(ConfigBuilder configBuilder, FileType fileType, String filePath) {// 判断自定义文件夹是否需要创建checkDir("调用默认方法创建的目录");return false;}});*/
// cfg.setFileOutConfigList(focList);
// mpg.setCfg(cfg);// 配置模板TemplateConfig templateConfig = new TemplateConfig();// 配置自定义输出模板//指定自定义模板路径,注意不要带上.ftl/.vm, 会根据使用的模板引擎自动识别// templateConfig.setEntity("templates/entity2.java");// templateConfig.setService();// templateConfig.setController();templateConfig.setXml(null);mpg.setTemplate(templateConfig);// 策略配置StrategyConfig strategy = new StrategyConfig();strategy.setNaming(NamingStrategy.underline_to_camel);strategy.setColumnNaming(NamingStrategy.underline_to_camel);strategy.setSuperEntityClass("com.baomidou.mybatisplus.extension.activerecord.Model");strategy.setEntityLombokModel(true);strategy.setRestControllerStyle(true);strategy.setEntityLombokModel(true);// 公共父类
// strategy.setSuperControllerClass("com.baomidou.ant.common.BaseController");// 写于父类中的公共字段
// strategy.setSuperEntityColumns("id");strategy.setInclude(scanner("表名,多个英文逗号分割").split(","));strategy.setControllerMappingHyphenStyle(true);strategy.setTablePrefix(pc.getModuleName() + "_");mpg.setStrategy(strategy);mpg.setTemplateEngine(new FreemarkerTemplateEngine());mpg.execute();}
}
做到这里后我们需要去数据库里面添加相对的表结构来让代码生成器生成相对的代码内容
CREATE TABLE `user` (`id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',`name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '姓名',`age` int(11) NULL DEFAULT NULL COMMENT '年龄',`skill` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '技能',`evaluate` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '评价',`fraction` bigint(11) NULL DEFAULT NULL COMMENT '分数',PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '学生信息表' ROW_FORMAT = Dynamic;INSERT INTO `user` VALUES (1, '小明', 20, '画画', '该学生在画画方面有一定天赋', 89);
INSERT INTO `user` VALUES (2, '小兰', 19, '游戏', '近期该学生由于游戏的原因导致分数降低了', 64);
INSERT INTO `user` VALUES (3, '张张', 18, '英语', '近期该学生参加英语比赛获得二等奖', 90);
INSERT INTO `user` VALUES (4, '大黄', 20, '体育', '该学生近期由于参加篮球比赛,导致脚伤', 76);
INSERT INTO `user` VALUES (5, '大白', 17, '绘画', '该学生参加美术大赛获得三等奖', 77);
INSERT INTO `user` VALUES (7, '小龙', 18, 'JAVA', '该学生是一个在改BUG的码农', 59);
INSERT INTO `user` VALUES (9, 'Sans', 18, '睡觉', 'Sans是一个爱睡觉,并且身材较矮骨骼巨大的骷髅小胖子', 60);
INSERT INTO `user` VALUES (10, 'papyrus', 18, 'JAVA', 'Papyrus是一个讲话大声、个性张扬的骷髅,给人自信、有魅力的骷髅小瘦子', 58);
INSERT INTO `user` VALUES (11, '删除数据1', 3, '画肖像', NULL, 61);
INSERT INTO `user` VALUES (12, '删除数据2', 3, NULL, NULL, 61);
INSERT INTO `user` VALUES (13, '删除数据3', 3, NULL, NULL, 61);
INSERT INTO `user` VALUES (14, '删除数据4', 5, '删除', NULL, 10);
然后数据库数据生成后运行我们的代码生成器如下(因为存在了的文件它不会覆盖导致如果之前实体类也是user文件名的话需要删除不然不会创建,生成新的user实体类后需要手动添加get,set方法)
因为我生成过了所以会这样生成后记得刷新一下项目生成的代码就会显示出来
如果想做相对的修改可以在这里做
然后稍微的修改一下控制层从数据库内读取数据显示到页面如下
@Controller
public class UserController {@Autowiredprivate IUserService userService;@RequestMapping(value="/user")public String index(Model model) {// List<User> users = new ArrayList<User>();// users.add(new User(1,"许七安", "不逛勾栏", "一般"));// users.add(new User(2,"缘之空", "不可描述", "还好"));// users.add(new User(3,"李长庚", "太过稳健", "呵呵"));//model.addAttribute("users",users);List<User> list = userService.list();for (User user : list) {System.out.println(user.toString());}model.addAttribute("users",list);return "user";}}
然后我们再把相对的几个类添加到启动类的扫描里面去
@SpringBootApplication
@ComponentScan(basePackages = {"com.szscada.controller","com.szscada.service","com.szscada.service.impl", "com.szscada.config"})//扫描注解注入bean
@MapperScan(basePackages = {"com.szscada.dao"}) //扫描DAO
public class MindCloud1Application {public static void main(String[] args) {SpringApplication.run(MindCloud1Application.class, args);}}
页面如下
到这里整合springBoot+springMvc+mybatisPlus整合结束
下面整合最头疼的activiti这个框架整合mybatisPlus会出一些很有意思的问题首先讲解一下原因。
activiti整合mybatisPlus会出现几个很头疼的问题第一个整合时候报错因为他们统一调用的是mybatis框架但是版本不统一所以我们要移除掉一个我这里移除的是activiti的样式如下
<!-- activiti组件 mybatis-plus和activiti有调用mybatis的依赖版本冲突所以要做特殊处理 --><dependency><groupId>org.activiti</groupId><artifactId>activiti-spring-boot-starter-basic</artifactId><version>6.0.0</version><exclusions><exclusion><groupId>org.mybatis</groupId><artifactId>mybatis</artifactId></exclusion></exclusions></dependency>
然后 activiti和springBoot整合后还会出现 activiti表不会自动创建的问题,这个问题 是这样的首先你需要在配置文件里面配置
spring:activiti:# true activiti会对数据库中所有表进行更新操作。如果表不存在,则自动创建。(开发时常用)database-schema-update: true#自动部署验证设置:true-开启(默认)、false-关闭check-process-definitions: true#设置默认扫码文件路径process-definition-location-prefix: classpath:/processes/
# process-definition-location-suffixes:
# - **.bpmn
# - **.bpmn20.xml#保存历史数据级别设置为full最高级别,便于历史数据的追溯history-level: full# asyncExecutorActivate是指activiti在流程引擎启动就激活AsyncExecutor,异步:true-开启(默认)、false-关闭async-executor-activate: false
然后你的数据库版本过高的时候这样也就算项目启动了也不会正常创建,网上的资料是说
在使用mysql-connect 8.+以上版本的时候需要添加nullCatalogMeansCurrent=true
参数,否则在使用mybatis-generator生成表对应的xml等时会扫描整个服务器里面的全部数据库中的表,而不是扫描对应数据库的表。
所以修改数据库连接配置: 加上【nullCatalogMeansCurrent=true
】这里的在前面我已经加上了
然后还需要在启动类上面加上
@EnableAutoConfiguration(exclude = {org.activiti.spring.boot.SecurityAutoConfiguration.class,org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class })
然后在src/main/resources下创建processes流程存放目录然后创建一个MyProcess.bpmn流程文件放进去修改一下yml文然后执行就大功告成了
MyProcess.bpmn文件如下(这个文件是我通过activiti插件创建)
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test"><process id="myProcess" name="工程派单流程" isExecutable="true"><startEvent id="startevent1" name="开始流程"></startEvent><userTask id="usertask1" name="工程受理" activiti:assignee="emp" activiti:candidateGroups="emp"></userTask><sequenceFlow id="flow1" sourceRef="startevent1" targetRef="usertask1"></sequenceFlow><userTask id="usertask2" name="查勘派单" activiti:assignee="zz" activiti:candidateGroups="zz" activiti:formKey="audit_bz.jsp"></userTask><sequenceFlow id="flow2" sourceRef="usertask1" targetRef="usertask2"></sequenceFlow><userTask id="usertask3" name="工程查勘" activiti:assignee="zz" activiti:candidateGroups="zz" activiti:formKey="audit_bz.jsp"></userTask><sequenceFlow id="flow3" sourceRef="usertask2" targetRef="usertask3"></sequenceFlow><userTask id="usertask4" name="设计批表预算" activiti:assignee="zz" activiti:candidateGroups="zz" activiti:formKey="audit_bz.jsp"></userTask><sequenceFlow id="flow4" sourceRef="usertask3" targetRef="usertask4"></sequenceFlow><userTask id="usertask5" name="工程审核" activiti:assignee="zz" activiti:candidateGroups="zz" activiti:formKey="audit_bz.jsp"></userTask><sequenceFlow id="flow5" sourceRef="usertask4" targetRef="usertask5"></sequenceFlow><userTask id="usertask6" name="工程收费" activiti:assignee="zz" activiti:candidateGroups="zz" activiti:formKey="audit_bz.jsp"></userTask><sequenceFlow id="flow6" sourceRef="usertask5" targetRef="usertask6"></sequenceFlow><userTask id="usertask7" name="工程派单" activiti:assignee="zz" activiti:candidateGroups="zz" activiti:formKey="audit_bz.jsp"></userTask><sequenceFlow id="flow7" sourceRef="usertask6" targetRef="usertask7"></sequenceFlow><userTask id="usertask8" name="监理派单" activiti:assignee="jl" activiti:candidateGroups="jl" activiti:formKey="audit_bz.jsp"></userTask><userTask id="usertask9" name="施工派单" activiti:assignee="sg" activiti:candidateGroups="sg" activiti:formKey="audit_bz.jsp"></userTask><userTask id="usertask10" name="工程施工" activiti:assignee="sg" activiti:candidateGroups="sg" activiti:formKey="audit_bz.jsp"></userTask><sequenceFlow id="flow11" sourceRef="usertask9" targetRef="usertask10"></sequenceFlow><userTask id="usertask11" name="监理信息" activiti:assignee="jl" activiti:candidateGroups="jl" activiti:formKey="audit_bz.jsp"></userTask><sequenceFlow id="flow12" sourceRef="usertask8" targetRef="usertask11"></sequenceFlow><userTask id="usertask12" name="工程验报" activiti:assignee="sg" activiti:candidateGroups="sg" activiti:formKey="audit_bz.jsp"></userTask><userTask id="usertask13" name="水表验收" activiti:assignee="jl" activiti:candidateGroups="jl" activiti:formKey="audit_bz.jsp"></userTask><userTask id="usertask14" name="管网验收" activiti:assignee="sg" activiti:candidateGroups="sg" activiti:formKey="audit_bz.jsp"></userTask><userTask id="usertask15" name="系统建卡" activiti:assignee="jl" activiti:candidateGroups="jl" activiti:formKey="audit_bz.jsp"></userTask><sequenceFlow id="flow19" sourceRef="usertask13" targetRef="usertask15"></sequenceFlow><userTask id="usertask16" name="内部决算" activiti:assignee="lz" activiti:candidateGroups="lz" activiti:formKey="audit_bz.jsp"></userTask><userTask id="usertask17" name="决算收费" activiti:assignee="lz" activiti:candidateGroups="lz" activiti:formKey="audit_bz.jsp"></userTask><sequenceFlow id="flow23" sourceRef="usertask16" targetRef="usertask17"></sequenceFlow><userTask id="usertask18" name="资料归档" activiti:assignee="lz" activiti:candidateGroups="lz" activiti:formKey="audit_bz.jsp"></userTask><sequenceFlow id="flow24" sourceRef="usertask17" targetRef="usertask18"></sequenceFlow><endEvent id="endevent1" name="End"></endEvent><sequenceFlow id="flow25" sourceRef="usertask18" targetRef="endevent1"></sequenceFlow><parallelGateway id="parallelgateway1" name="Parallel Gateway"></parallelGateway><sequenceFlow id="flow26" sourceRef="usertask7" targetRef="parallelgateway1"></sequenceFlow><sequenceFlow id="flow27" sourceRef="parallelgateway1" targetRef="usertask8"></sequenceFlow><sequenceFlow id="flow28" sourceRef="parallelgateway1" targetRef="usertask9"></sequenceFlow><parallelGateway id="parallelgateway2" name="Parallel Gateway"></parallelGateway><sequenceFlow id="flow29" sourceRef="usertask11" targetRef="parallelgateway2"></sequenceFlow><sequenceFlow id="flow30" sourceRef="usertask10" targetRef="parallelgateway2"></sequenceFlow><sequenceFlow id="flow31" sourceRef="parallelgateway2" targetRef="usertask12"></sequenceFlow><parallelGateway id="parallelgateway3" name="Parallel Gateway"></parallelGateway><sequenceFlow id="flow32" sourceRef="usertask12" targetRef="parallelgateway3"></sequenceFlow><sequenceFlow id="flow33" sourceRef="parallelgateway3" targetRef="usertask13"></sequenceFlow><sequenceFlow id="flow34" sourceRef="parallelgateway3" targetRef="usertask14"></sequenceFlow><parallelGateway id="parallelgateway4" name="Parallel Gateway"></parallelGateway><sequenceFlow id="flow35" sourceRef="usertask15" targetRef="parallelgateway4"></sequenceFlow><sequenceFlow id="flow36" sourceRef="usertask14" targetRef="parallelgateway4"></sequenceFlow><sequenceFlow id="flow37" sourceRef="parallelgateway4" targetRef="usertask16"></sequenceFlow></process><bpmndi:BPMNDiagram id="BPMNDiagram_myProcess"><bpmndi:BPMNPlane bpmnElement="myProcess" id="BPMNPlane_myProcess"><bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1"><omgdc:Bounds height="35.0" width="35.0" x="140.0" y="60.0"></omgdc:Bounds></bpmndi:BPMNShape><bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1"><omgdc:Bounds height="55.0" width="105.0" x="290.0" y="50.0"></omgdc:Bounds></bpmndi:BPMNShape><bpmndi:BPMNShape bpmnElement="usertask2" id="BPMNShape_usertask2"><omgdc:Bounds height="55.0" width="105.0" x="530.0" y="50.0"></omgdc:Bounds></bpmndi:BPMNShape><bpmndi:BPMNShape bpmnElement="usertask3" id="BPMNShape_usertask3"><omgdc:Bounds height="55.0" width="105.0" x="830.0" y="50.0"></omgdc:Bounds></bpmndi:BPMNShape><bpmndi:BPMNShape bpmnElement="usertask4" id="BPMNShape_usertask4"><omgdc:Bounds height="55.0" width="105.0" x="1090.0" y="50.0"></omgdc:Bounds></bpmndi:BPMNShape><bpmndi:BPMNShape bpmnElement="usertask5" id="BPMNShape_usertask5"><omgdc:Bounds height="55.0" width="105.0" x="1090.0" y="180.0"></omgdc:Bounds></bpmndi:BPMNShape><bpmndi:BPMNShape bpmnElement="usertask6" id="BPMNShape_usertask6"><omgdc:Bounds height="55.0" width="105.0" x="830.0" y="180.0"></omgdc:Bounds></bpmndi:BPMNShape><bpmndi:BPMNShape bpmnElement="usertask7" id="BPMNShape_usertask7"><omgdc:Bounds height="55.0" width="105.0" x="530.0" y="180.0"></omgdc:Bounds></bpmndi:BPMNShape><bpmndi:BPMNShape bpmnElement="usertask8" id="BPMNShape_usertask8"><omgdc:Bounds height="55.0" width="105.0" x="290.0" y="260.0"></omgdc:Bounds></bpmndi:BPMNShape><bpmndi:BPMNShape bpmnElement="usertask9" id="BPMNShape_usertask9"><omgdc:Bounds height="55.0" width="105.0" x="105.0" y="180.0"></omgdc:Bounds></bpmndi:BPMNShape><bpmndi:BPMNShape bpmnElement="usertask10" id="BPMNShape_usertask10"><omgdc:Bounds height="55.0" width="105.0" x="105.0" y="360.0"></omgdc:Bounds></bpmndi:BPMNShape><bpmndi:BPMNShape bpmnElement="usertask11" id="BPMNShape_usertask11"><omgdc:Bounds height="55.0" width="105.0" x="530.0" y="260.0"></omgdc:Bounds></bpmndi:BPMNShape><bpmndi:BPMNShape bpmnElement="usertask12" id="BPMNShape_usertask12"><omgdc:Bounds height="55.0" width="105.0" x="1090.0" y="304.0"></omgdc:Bounds></bpmndi:BPMNShape><bpmndi:BPMNShape bpmnElement="usertask13" id="BPMNShape_usertask13"><omgdc:Bounds height="55.0" width="105.0" x="830.0" y="414.0"></omgdc:Bounds></bpmndi:BPMNShape><bpmndi:BPMNShape bpmnElement="usertask14" id="BPMNShape_usertask14"><omgdc:Bounds height="55.0" width="105.0" x="830.0" y="533.0"></omgdc:Bounds></bpmndi:BPMNShape><bpmndi:BPMNShape bpmnElement="usertask15" id="BPMNShape_usertask15"><omgdc:Bounds height="55.0" width="105.0" x="532.0" y="414.0"></omgdc:Bounds></bpmndi:BPMNShape><bpmndi:BPMNShape bpmnElement="usertask16" id="BPMNShape_usertask16"><omgdc:Bounds height="55.0" width="105.0" x="105.0" y="533.0"></omgdc:Bounds></bpmndi:BPMNShape><bpmndi:BPMNShape bpmnElement="usertask17" id="BPMNShape_usertask17"><omgdc:Bounds height="55.0" width="105.0" x="105.0" y="720.0"></omgdc:Bounds></bpmndi:BPMNShape><bpmndi:BPMNShape bpmnElement="usertask18" id="BPMNShape_usertask18"><omgdc:Bounds height="55.0" width="105.0" x="634.0" y="720.0"></omgdc:Bounds></bpmndi:BPMNShape><bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1"><omgdc:Bounds height="35.0" width="35.0" x="1126.0" y="730.0"></omgdc:Bounds></bpmndi:BPMNShape><bpmndi:BPMNShape bpmnElement="parallelgateway1" id="BPMNShape_parallelgateway1"><omgdc:Bounds height="40.0" width="40.0" x="322.0" y="187.0"></omgdc:Bounds></bpmndi:BPMNShape><bpmndi:BPMNShape bpmnElement="parallelgateway2" id="BPMNShape_parallelgateway2"><omgdc:Bounds height="40.0" width="40.0" x="880.0" y="314.0"></omgdc:Bounds></bpmndi:BPMNShape><bpmndi:BPMNShape bpmnElement="parallelgateway3" id="BPMNShape_parallelgateway3"><omgdc:Bounds height="40.0" width="40.0" x="1130.0" y="480.0"></omgdc:Bounds></bpmndi:BPMNShape><bpmndi:BPMNShape bpmnElement="parallelgateway4" id="BPMNShape_parallelgateway4"><omgdc:Bounds height="40.0" width="40.0" x="564.0" y="540.0"></omgdc:Bounds></bpmndi:BPMNShape><bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1"><omgdi:waypoint x="175.0" y="77.0"></omgdi:waypoint><omgdi:waypoint x="290.0" y="77.0"></omgdi:waypoint></bpmndi:BPMNEdge><bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2"><omgdi:waypoint x="395.0" y="77.0"></omgdi:waypoint><omgdi:waypoint x="530.0" y="77.0"></omgdi:waypoint></bpmndi:BPMNEdge><bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3"><omgdi:waypoint x="635.0" y="77.0"></omgdi:waypoint><omgdi:waypoint x="830.0" y="77.0"></omgdi:waypoint></bpmndi:BPMNEdge><bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4"><omgdi:waypoint x="935.0" y="77.0"></omgdi:waypoint><omgdi:waypoint x="1090.0" y="77.0"></omgdi:waypoint></bpmndi:BPMNEdge><bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5"><omgdi:waypoint x="1142.0" y="105.0"></omgdi:waypoint><omgdi:waypoint x="1142.0" y="180.0"></omgdi:waypoint></bpmndi:BPMNEdge><bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6"><omgdi:waypoint x="1090.0" y="207.0"></omgdi:waypoint><omgdi:waypoint x="935.0" y="207.0"></omgdi:waypoint></bpmndi:BPMNEdge><bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7"><omgdi:waypoint x="830.0" y="207.0"></omgdi:waypoint><omgdi:waypoint x="635.0" y="207.0"></omgdi:waypoint></bpmndi:BPMNEdge><bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11"><omgdi:waypoint x="157.0" y="235.0"></omgdi:waypoint><omgdi:waypoint x="157.0" y="360.0"></omgdi:waypoint></bpmndi:BPMNEdge><bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12"><omgdi:waypoint x="395.0" y="287.0"></omgdi:waypoint><omgdi:waypoint x="530.0" y="287.0"></omgdi:waypoint></bpmndi:BPMNEdge><bpmndi:BPMNEdge bpmnElement="flow19" id="BPMNEdge_flow19"><omgdi:waypoint x="830.0" y="441.0"></omgdi:waypoint><omgdi:waypoint x="637.0" y="441.0"></omgdi:waypoint></bpmndi:BPMNEdge><bpmndi:BPMNEdge bpmnElement="flow23" id="BPMNEdge_flow23"><omgdi:waypoint x="157.0" y="588.0"></omgdi:waypoint><omgdi:waypoint x="157.0" y="720.0"></omgdi:waypoint></bpmndi:BPMNEdge><bpmndi:BPMNEdge bpmnElement="flow24" id="BPMNEdge_flow24"><omgdi:waypoint x="210.0" y="747.0"></omgdi:waypoint><omgdi:waypoint x="634.0" y="747.0"></omgdi:waypoint></bpmndi:BPMNEdge><bpmndi:BPMNEdge bpmnElement="flow25" id="BPMNEdge_flow25"><omgdi:waypoint x="739.0" y="747.0"></omgdi:waypoint><omgdi:waypoint x="1126.0" y="747.0"></omgdi:waypoint></bpmndi:BPMNEdge><bpmndi:BPMNEdge bpmnElement="flow26" id="BPMNEdge_flow26"><omgdi:waypoint x="530.0" y="207.0"></omgdi:waypoint><omgdi:waypoint x="362.0" y="207.0"></omgdi:waypoint></bpmndi:BPMNEdge><bpmndi:BPMNEdge bpmnElement="flow27" id="BPMNEdge_flow27"><omgdi:waypoint x="342.0" y="227.0"></omgdi:waypoint><omgdi:waypoint x="342.0" y="260.0"></omgdi:waypoint></bpmndi:BPMNEdge><bpmndi:BPMNEdge bpmnElement="flow28" id="BPMNEdge_flow28"><omgdi:waypoint x="322.0" y="207.0"></omgdi:waypoint><omgdi:waypoint x="210.0" y="207.0"></omgdi:waypoint></bpmndi:BPMNEdge><bpmndi:BPMNEdge bpmnElement="flow29" id="BPMNEdge_flow29"><omgdi:waypoint x="635.0" y="287.0"></omgdi:waypoint><omgdi:waypoint x="900.0" y="287.0"></omgdi:waypoint><omgdi:waypoint x="900.0" y="314.0"></omgdi:waypoint></bpmndi:BPMNEdge><bpmndi:BPMNEdge bpmnElement="flow30" id="BPMNEdge_flow30"><omgdi:waypoint x="210.0" y="387.0"></omgdi:waypoint><omgdi:waypoint x="900.0" y="387.0"></omgdi:waypoint><omgdi:waypoint x="900.0" y="354.0"></omgdi:waypoint></bpmndi:BPMNEdge><bpmndi:BPMNEdge bpmnElement="flow31" id="BPMNEdge_flow31"><omgdi:waypoint x="920.0" y="334.0"></omgdi:waypoint><omgdi:waypoint x="1090.0" y="331.0"></omgdi:waypoint></bpmndi:BPMNEdge><bpmndi:BPMNEdge bpmnElement="flow32" id="BPMNEdge_flow32"><omgdi:waypoint x="1142.0" y="359.0"></omgdi:waypoint><omgdi:waypoint x="1150.0" y="480.0"></omgdi:waypoint></bpmndi:BPMNEdge><bpmndi:BPMNEdge bpmnElement="flow33" id="BPMNEdge_flow33"><omgdi:waypoint x="1130.0" y="500.0"></omgdi:waypoint><omgdi:waypoint x="882.0" y="469.0"></omgdi:waypoint></bpmndi:BPMNEdge><bpmndi:BPMNEdge bpmnElement="flow34" id="BPMNEdge_flow34"><omgdi:waypoint x="1150.0" y="520.0"></omgdi:waypoint><omgdi:waypoint x="882.0" y="533.0"></omgdi:waypoint></bpmndi:BPMNEdge><bpmndi:BPMNEdge bpmnElement="flow35" id="BPMNEdge_flow35"><omgdi:waypoint x="584.0" y="469.0"></omgdi:waypoint><omgdi:waypoint x="584.0" y="540.0"></omgdi:waypoint></bpmndi:BPMNEdge><bpmndi:BPMNEdge bpmnElement="flow36" id="BPMNEdge_flow36"><omgdi:waypoint x="830.0" y="560.0"></omgdi:waypoint><omgdi:waypoint x="604.0" y="560.0"></omgdi:waypoint></bpmndi:BPMNEdge><bpmndi:BPMNEdge bpmnElement="flow37" id="BPMNEdge_flow37"><omgdi:waypoint x="564.0" y="560.0"></omgdi:waypoint><omgdi:waypoint x="210.0" y="560.0"></omgdi:waypoint></bpmndi:BPMNEdge></bpmndi:BPMNPlane></bpmndi:BPMNDiagram>
</definitions>
这里放一下目前最全的yml文件 防止有的新手搞错
# 配置端口
server:port: 8080
spring:# 配置数据源datasource:driver-class-name: com.mysql.cj.jdbc.Driverurl: jdbc:mysql://localhost:3306/user?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&nullCatalogMeansCurrent=true&serverTimezone=GMT%2B8username: rootpassword: 123456# activiti default configurationactiviti:# true activiti会对数据库中所有表进行更新操作。如果表不存在,则自动创建。(开发时常用)database-schema-update: true#自动部署验证设置:true-开启(默认)、false-关闭check-process-definitions: true#设置默认扫码文件路径process-definition-location-prefix: classpath:/processes/
# process-definition-location-suffixes:
# - **.bpmn
# - **.bpmn20.xml#保存历史数据级别设置为full最高级别,便于历史数据的追溯history-level: full# asyncExecutorActivate是指activiti在流程引擎启动就激活AsyncExecutor,异步:true-开启(默认)、false-关闭async-executor-activate: false# mybatis-plus相关配置
mybatis-plus:# xml扫描,多个目录用逗号或者分号分隔(告诉 Mapper 所对应的 XML 文件位置)mapper-locations: classpath:mapper/*.xml# 以下配置均有默认值,可以不设置global-config:db-config:#主键类型 AUTO:"数据库ID自增" INPUT:"用户输入ID",ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID";id-type: auto#字段策略 IGNORED:"忽略判断" NOT_NULL:"非 NULL 判断") NOT_EMPTY:"非空判断"#field-strategy: NOT_EMPTY#数据库类型db-type: MYSQLconfiguration:# 是否开启自动驼峰命名规则映射:从数据库列名到Java属性驼峰命名的类似映射map-underscore-to-camel-case: true# 如果查询结果中包含空值的列,则 MyBatis 在映射的时候,不会映射这个字段call-setters-on-nulls: true# 这个配置会将执行的sql打印出来,在开发或测试的时候可以用log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
写的比较长了可能会有疏漏,如果有错误的话在线扣我!