From 30e886be6f0ab3275b8244b82a83537694e4ba6f Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 30 Apr 2022 22:52:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=20PostgreSQL=20=E9=9B=86?= =?UTF-8?q?=E6=88=90=20Quartz=20=E6=97=B6=E7=9A=84=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/ruoyi-vue-pro.sql | 2 +- .../yudao-spring-boot-starter-job/pom.xml | 1 - .../IdTypeEnvironmentPostProcessor.java | 38 ++++++++++++++++--- .../mybatis/core/enums/SqlConstants.java | 1 - .../bpm/dal/dataobject/oa/BpmOALeaveDO.java | 2 +- .../dal/mysql/definition/BpmFormMapper.java | 12 +++--- .../BpmProcessDefinitionExtMapper.java | 7 ++-- .../task/BpmProcessInstanceExtMapper.java | 31 ++++++++------- .../bpm/dal/mysql/task/BpmTaskExtMapper.java | 4 +- .../infra/dal/dataobject/file/FileDO.java | 2 +- .../mysql/codegen/CodegenColumnMapper.java | 10 +++-- .../dal/mysql/codegen/CodegenTableMapper.java | 10 ++--- .../infra/dal/mysql/file/FileMapper.java | 12 +++--- .../service/DefaultDatabaseQueryTest.java | 8 +++- .../dal/mysql/merchant/PayChannelMapper.java | 2 - .../dal/mysql/sms/SmsChannelMapper.java | 12 +++--- yudao-server/pom.xml | 10 ++--- .../src/main/resources/application.yaml | 2 +- 18 files changed, 98 insertions(+), 68 deletions(-) diff --git a/sql/ruoyi-vue-pro.sql b/sql/ruoyi-vue-pro.sql index d06f73cb66..f0b19d4c04 100644 --- a/sql/ruoyi-vue-pro.sql +++ b/sql/ruoyi-vue-pro.sql @@ -1672,7 +1672,7 @@ CREATE TABLE `infra_codegen_column` ( `column_comment` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '字段描述', `nullable` bit(1) NOT NULL COMMENT '是否允许为空', `primary_key` bit(1) NOT NULL COMMENT '是否主键', - `auto_Increment` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '是否自增', + `auto_increment` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '是否自增', `ordinal_position` int NOT NULL COMMENT '排序', `java_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Java 属性类型', `java_field` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Java 属性名', diff --git a/yudao-framework/yudao-spring-boot-starter-job/pom.xml b/yudao-framework/yudao-spring-boot-starter-job/pom.xml index be83c7a3dd..c17baf4f28 100644 --- a/yudao-framework/yudao-spring-boot-starter-job/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-job/pom.xml @@ -36,7 +36,6 @@ jakarta.validation-api - diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/config/IdTypeEnvironmentPostProcessor.java b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/config/IdTypeEnvironmentPostProcessor.java index 532c020305..8bb10aea41 100644 --- a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/config/IdTypeEnvironmentPostProcessor.java +++ b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/config/IdTypeEnvironmentPostProcessor.java @@ -24,22 +24,28 @@ public class IdTypeEnvironmentPostProcessor implements EnvironmentPostProcessor private static final String DATASOURCE_DYNAMIC_KEY = "spring.datasource.dynamic"; + private static final String QUARTZ_JOB_STORE_DRIVER_KEY = "spring.quartz.properties.org.quartz.jobStore.driverDelegateClass"; + private static final Set INPUT_ID_TYPES = SetUtils.asSet(DbType.ORACLE, DbType.ORACLE_12C, DbType.POSTGRE_SQL, DbType.KINGBASE_ES, DbType.DB2, DbType.H2); @Override public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) { - // 如果非 NONE,则不进行处理 - IdType idType = getIdType(environment); - if (idType != IdType.NONE) { - return; - } // 如果获取不到 DbType,则不进行处理 DbType dbType = getDbType(environment); if (dbType == null) { return; } + // 设置 Quartz JobStore 对应的 Driver + // TODO 芋艿:暂时没有找到特别合适的地方,先放在这里 + setJobStoreDriverIfPresent(environment, dbType); + + // 如果非 NONE,则不进行处理 + IdType idType = getIdType(environment); + if (idType != IdType.NONE) { + return; + } // 情况一,用户输入 ID,适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库 if (INPUT_ID_TYPES.contains(dbType)) { setIdType(environment, IdType.INPUT); @@ -58,6 +64,28 @@ public class IdTypeEnvironmentPostProcessor implements EnvironmentPostProcessor log.info("[setIdType][修改 MyBatis Plus 的 idType 为({})]", idType); } + public void setJobStoreDriverIfPresent(ConfigurableEnvironment environment, DbType dbType) { + String driverClass = environment.getProperty(QUARTZ_JOB_STORE_DRIVER_KEY); + if (StrUtil.isNotEmpty(driverClass)) { + return; + } + // 根据 dbType 类型,获取对应的 driverClass + switch (dbType) { + case POSTGRE_SQL: + driverClass = "org.quartz.impl.jdbcjobstore.PostgreSQLDelegate"; + break; + case ORACLE: + case ORACLE_12C: + driverClass = "org.quartz.impl.jdbcjobstore.oracle.OracleDelegate"; + break; + } + // 设置 driverClass 变量 + if (StrUtil.isNotEmpty(driverClass)) { + environment.getSystemProperties().put(QUARTZ_JOB_STORE_DRIVER_KEY, driverClass); + + } + } + public static DbType getDbType(ConfigurableEnvironment environment) { String primary = environment.getProperty(DATASOURCE_DYNAMIC_KEY + "." + "primary"); if (StrUtil.isEmpty(primary)) { diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/enums/SqlConstants.java b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/enums/SqlConstants.java index cad1d6c966..1454eed662 100644 --- a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/enums/SqlConstants.java +++ b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/enums/SqlConstants.java @@ -5,7 +5,6 @@ package cn.iocoder.yudao.framework.mybatis.core.enums; */ public interface SqlConstants { - String LIMIT1 = "LIMIT 1"; } diff --git a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/BpmOALeaveDO.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/BpmOALeaveDO.java index f984fcd409..d068d6556e 100644 --- a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/BpmOALeaveDO.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/BpmOALeaveDO.java @@ -43,7 +43,7 @@ public class BpmOALeaveDO extends BaseDO { * 请假类型 */ @TableField("\"type\"") - private String type; + private Integer type; /** * 原因 */ diff --git a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/definition/BpmFormMapper.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/definition/BpmFormMapper.java index 53c01d92e5..1f15719cdb 100644 --- a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/definition/BpmFormMapper.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/definition/BpmFormMapper.java @@ -1,11 +1,11 @@ package cn.iocoder.yudao.module.bpm.dal.mysql.definition; -import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormPageReqVO; -import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmFormDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; -import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormPageReqVO; +import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmFormDO; import org.apache.ibatis.annotations.Mapper; /** @@ -17,9 +17,9 @@ import org.apache.ibatis.annotations.Mapper; public interface BpmFormMapper extends BaseMapperX { default PageResult selectPage(BpmFormPageReqVO reqVO) { - return selectPage(reqVO, new QueryWrapperX() - .likeIfPresent("name", reqVO.getName()) - .orderByDesc("id")); + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(BpmFormDO::getName, reqVO.getName()) + .orderByDesc(BpmFormDO::getId)); } } diff --git a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/definition/BpmProcessDefinitionExtMapper.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/definition/BpmProcessDefinitionExtMapper.java index 3ff53f2d9c..689a562bce 100644 --- a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/definition/BpmProcessDefinitionExtMapper.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/definition/BpmProcessDefinitionExtMapper.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.bpm.dal.mysql.definition; -import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; -import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionExtDO; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionExtDO; import org.apache.ibatis.annotations.Mapper; import java.util.Collection; @@ -12,11 +11,11 @@ import java.util.List; public interface BpmProcessDefinitionExtMapper extends BaseMapperX { default List selectListByProcessDefinitionIds(Collection processDefinitionIds) { - return selectList("process_definition_id", processDefinitionIds); + return selectList(BpmProcessDefinitionExtDO::getProcessDefinitionId, processDefinitionIds); } default BpmProcessDefinitionExtDO selectByProcessDefinitionId(String processDefinitionId) { - return selectOne("process_definition_id", processDefinitionId); + return selectOne(BpmProcessDefinitionExtDO::getProcessDefinitionId, processDefinitionId); } } diff --git a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/task/BpmProcessInstanceExtMapper.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/task/BpmProcessInstanceExtMapper.java index ee31b08ca3..159cdc267e 100644 --- a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/task/BpmProcessInstanceExtMapper.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/task/BpmProcessInstanceExtMapper.java @@ -1,35 +1,34 @@ package cn.iocoder.yudao.module.bpm.dal.mysql.task; -import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceMyPageReqVO; -import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmProcessInstanceExtDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; -import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceMyPageReqVO; +import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmProcessInstanceExtDO; import org.apache.ibatis.annotations.Mapper; @Mapper public interface BpmProcessInstanceExtMapper extends BaseMapperX { default PageResult selectPage(Long userId, BpmProcessInstanceMyPageReqVO reqVO) { - return selectPage(reqVO, new QueryWrapperX() - .eqIfPresent("start_user_id", userId) - .likeIfPresent("name", reqVO.getName()) - .eqIfPresent("process_definition_id", reqVO.getProcessDefinitionId()) - .eqIfPresent("category", reqVO.getCategory()) - .eqIfPresent("status", reqVO.getStatus()) - .eqIfPresent("result", reqVO.getResult()) - .betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) - .orderByDesc("id")); + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(BpmProcessInstanceExtDO::getStartUserId, userId) + .likeIfPresent(BpmProcessInstanceExtDO::getName, reqVO.getName()) + .eqIfPresent(BpmProcessInstanceExtDO::getProcessDefinitionId, reqVO.getProcessDefinitionId()) + .eqIfPresent(BpmProcessInstanceExtDO::getCategory, reqVO.getCategory()) + .eqIfPresent(BpmProcessInstanceExtDO::getStatus, reqVO.getStatus()) + .eqIfPresent(BpmProcessInstanceExtDO::getResult, reqVO.getResult()) + .betweenIfPresent(BpmProcessInstanceExtDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) + .orderByDesc(BpmProcessInstanceExtDO::getId)); } default BpmProcessInstanceExtDO selectByProcessInstanceId(String processDefinitionId) { - return selectOne("process_instance_id", processDefinitionId); + return selectOne(BpmProcessInstanceExtDO::getProcessInstanceId, processDefinitionId); } default void updateByProcessInstanceId(BpmProcessInstanceExtDO updateObj) { - update(updateObj, new QueryWrapper() - .eq("process_instance_id", updateObj.getProcessInstanceId())); + update(updateObj, new LambdaQueryWrapperX() + .eq(BpmProcessInstanceExtDO::getProcessInstanceId, updateObj.getProcessInstanceId())); } } diff --git a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/task/BpmTaskExtMapper.java b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/task/BpmTaskExtMapper.java index b2927a65e0..300174c440 100644 --- a/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/task/BpmTaskExtMapper.java +++ b/yudao-module-bpm/yudao-module-bpm-base/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/task/BpmTaskExtMapper.java @@ -1,7 +1,7 @@ package cn.iocoder.yudao.module.bpm.dal.mysql.task; -import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmTaskExtDO; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmTaskExtDO; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.apache.ibatis.annotations.Mapper; @@ -20,6 +20,6 @@ public interface BpmTaskExtMapper extends BaseMapperX { } default List selectListByProcessInstanceId(String processInstanceId) { - return selectList("process_instance_id", processInstanceId); + return selectList(BpmTaskExtDO::getProcessInstanceId, processInstanceId); } } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileDO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileDO.java index 93fc109de9..d1fa54c269 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileDO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileDO.java @@ -47,7 +47,7 @@ public class FileDO extends BaseDO { * * 通过 {@link cn.hutool.core.io.FileTypeUtil#getType(InputStream)} 获取 */ - @TableField(value = "`type`") + @TableField("\"type\"") private String type; /** * 文件大小 diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/codegen/CodegenColumnMapper.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/codegen/CodegenColumnMapper.java index 95f78db66a..3f1aedb972 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/codegen/CodegenColumnMapper.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/codegen/CodegenColumnMapper.java @@ -1,8 +1,8 @@ package cn.iocoder.yudao.module.infra.dal.mysql.codegen; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.module.infra.dal.dataobject.codegen.CodegenColumnDO; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -11,12 +11,14 @@ import java.util.List; public interface CodegenColumnMapper extends BaseMapperX { default List selectListByTableId(Long tableId) { - return selectList(new QueryWrapper().eq("table_id", tableId) - .orderByAsc("ordinal_position")); + return selectList(new LambdaQueryWrapperX() + .eq(CodegenColumnDO::getTableId, tableId) + .orderByAsc(CodegenColumnDO::getId)); } default void deleteListByTableId(Long tableId) { - delete(new QueryWrapper().eq("table_id", tableId)); + delete(new LambdaQueryWrapperX() + .eq(CodegenColumnDO::getTableId, tableId)); } } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/codegen/CodegenTableMapper.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/codegen/CodegenTableMapper.java index 9a16e6e5a2..6e8ad3de96 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/codegen/CodegenTableMapper.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/codegen/CodegenTableMapper.java @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.infra.dal.mysql.codegen; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; -import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table.CodegenTablePageReqVO; import cn.iocoder.yudao.module.infra.dal.dataobject.codegen.CodegenTableDO; import org.apache.ibatis.annotations.Mapper; @@ -18,10 +18,10 @@ public interface CodegenTableMapper extends BaseMapperX { } default PageResult selectPage(CodegenTablePageReqVO pageReqVO) { - return selectPage(pageReqVO, new QueryWrapperX() - .likeIfPresent("table_name", pageReqVO.getTableName()) - .likeIfPresent("table_comment", pageReqVO.getTableComment()) - .betweenIfPresent("create_time", pageReqVO.getBeginCreateTime(), pageReqVO.getEndCreateTime())); + return selectPage(pageReqVO, new LambdaQueryWrapperX() + .likeIfPresent(CodegenTableDO::getTableName, pageReqVO.getTableName()) + .likeIfPresent(CodegenTableDO::getTableComment, pageReqVO.getTableComment()) + .betweenIfPresent(CodegenTableDO::getCreateTime, pageReqVO.getBeginCreateTime(), pageReqVO.getEndCreateTime())); } default List selectListByDataSourceConfigId(Long dataSourceConfigId) { diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileMapper.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileMapper.java index 1938ee285e..845addc14c 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileMapper.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileMapper.java @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.infra.dal.mysql.file; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; -import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.module.infra.controller.admin.file.vo.file.FilePageReqVO; import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO; import org.apache.ibatis.annotations.Mapper; @@ -16,11 +16,11 @@ import org.apache.ibatis.annotations.Mapper; public interface FileMapper extends BaseMapperX { default PageResult selectPage(FilePageReqVO reqVO) { - return selectPage(reqVO, new QueryWrapperX() - .likeIfPresent("path", reqVO.getPath()) - .likeIfPresent("type", reqVO.getType()) - .betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) - .orderByDesc("create_time")); + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(FileDO::getPath, reqVO.getPath()) + .likeIfPresent(FileDO::getType, reqVO.getType()) + .betweenIfPresent(FileDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) + .orderByDesc(FileDO::getId)); } } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/DefaultDatabaseQueryTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/DefaultDatabaseQueryTest.java index e868ac09bc..56acb4dd3d 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/DefaultDatabaseQueryTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/DefaultDatabaseQueryTest.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.infra.service; +import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.generator.IDatabaseQuery.DefaultDatabaseQuery; import com.baomidou.mybatisplus.generator.config.DataSourceConfig; import com.baomidou.mybatisplus.generator.config.builder.ConfigBuilder; @@ -10,7 +11,9 @@ import java.util.List; public class DefaultDatabaseQueryTest { public static void main(String[] args) { - DataSourceConfig dataSourceConfig = new DataSourceConfig.Builder("jdbc:oracle:thin:@127.0.0.1:1521:xe", +// DataSourceConfig dataSourceConfig = new DataSourceConfig.Builder("jdbc:oracle:thin:@127.0.0.1:1521:xe", +// "root", "123456").build(); + DataSourceConfig dataSourceConfig = new DataSourceConfig.Builder("jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro", "root", "123456").build(); // StrategyConfig strategyConfig = new StrategyConfig.Builder().build(); @@ -21,6 +24,9 @@ public class DefaultDatabaseQueryTest { long time = System.currentTimeMillis(); List tableInfos = query.queryTables(); for (TableInfo tableInfo : tableInfos) { + if (StrUtil.startWithAny(tableInfo.getName().toLowerCase(), "act_", "flw_", "qrtz_")) { + continue; + } System.out.println(String.format("CREATE SEQUENCE %s_seq MINVALUE 0;", tableInfo.getName())); } System.out.println(tableInfos.size()); diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/merchant/PayChannelMapper.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/merchant/PayChannelMapper.java index 61cb35e6b5..65530e9d49 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/merchant/PayChannelMapper.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/merchant/PayChannelMapper.java @@ -32,7 +32,6 @@ public interface PayChannelMapper extends BaseMapperX { .eqIfPresent("fee_rate", reqVO.getFeeRate()) .eqIfPresent("merchant_id", reqVO.getMerchantId()) .eqIfPresent("app_id", reqVO.getAppId()) - // .eqIfPresent("config", reqVO.getConfig()) .betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) .orderByDesc("id") ); } @@ -45,7 +44,6 @@ public interface PayChannelMapper extends BaseMapperX { .eqIfPresent("fee_rate", reqVO.getFeeRate()) .eqIfPresent("merchant_id", reqVO.getMerchantId()) .eqIfPresent("app_id", reqVO.getAppId()) - // .eqIfPresent("config", reqVO.getConfig()) .betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) .orderByDesc("id") ); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/sms/SmsChannelMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/sms/SmsChannelMapper.java index 335f7ab437..878e644378 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/sms/SmsChannelMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/sms/SmsChannelMapper.java @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.system.dal.mysql.sms; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; -import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelPageReqVO; import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; import org.apache.ibatis.annotations.Mapper; @@ -14,11 +14,11 @@ import java.util.Date; public interface SmsChannelMapper extends BaseMapperX { default PageResult selectPage(SmsChannelPageReqVO reqVO) { - return selectPage(reqVO, new QueryWrapperX() - .likeIfPresent("signature", reqVO.getSignature()) - .eqIfPresent("status", reqVO.getStatus()) - .betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) - .orderByDesc("id")); + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(SmsChannelDO::getSignature, reqVO.getSignature()) + .eqIfPresent(SmsChannelDO::getStatus, reqVO.getStatus()) + .betweenIfPresent(SmsChannelDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) + .orderByDesc(SmsChannelDO::getId)); } @Select("SELECT id FROM system_sms_channel WHERE update_time > #{maxUpdateTime} LIMIT 1") diff --git a/yudao-server/pom.xml b/yudao-server/pom.xml index 4225619ec7..06c5750cfe 100644 --- a/yudao-server/pom.xml +++ b/yudao-server/pom.xml @@ -43,11 +43,11 @@ ${revision} - - - - - + + cn.iocoder.boot + yudao-module-bpm-biz-flowable + ${revision} + diff --git a/yudao-server/src/main/resources/application.yaml b/yudao-server/src/main/resources/application.yaml index 6e28775eeb..dd19826bae 100644 --- a/yudao-server/src/main/resources/application.yaml +++ b/yudao-server/src/main/resources/application.yaml @@ -39,7 +39,7 @@ spring: # 工作流 Flowable 配置 flowable: - # 1. false: 默认值,activiti启动时,对比数据库表中保存的版本,如果不匹配。将抛出异常 + # 1. false: 默认值,Flowable 启动时,对比数据库表中保存的版本,如果不匹配。将抛出异常 # 2. true: 启动时会对数据库中所有表进行更新操作,如果表存在,不做处理,反之,自动创建表 # 3. create_drop: 启动时自动创建表,关闭时自动删除表 # 4. drop_create: 启动时,删除旧表,再创建新表