解决 PostgreSQL 集成 Quartz 时的报错
parent
e24c8c3425
commit
30e886be6f
|
@ -1672,7 +1672,7 @@ CREATE TABLE `infra_codegen_column` (
|
||||||
`column_comment` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '字段描述',
|
`column_comment` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '字段描述',
|
||||||
`nullable` bit(1) NOT NULL COMMENT '是否允许为空',
|
`nullable` bit(1) NOT NULL COMMENT '是否允许为空',
|
||||||
`primary_key` 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 '排序',
|
`ordinal_position` int NOT NULL COMMENT '排序',
|
||||||
`java_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Java 属性类型',
|
`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 属性名',
|
`java_field` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Java 属性名',
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
<artifactId>jakarta.validation-api</artifactId>
|
<artifactId>jakarta.validation-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -24,22 +24,28 @@ public class IdTypeEnvironmentPostProcessor implements EnvironmentPostProcessor
|
||||||
|
|
||||||
private static final String DATASOURCE_DYNAMIC_KEY = "spring.datasource.dynamic";
|
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<DbType> INPUT_ID_TYPES = SetUtils.asSet(DbType.ORACLE, DbType.ORACLE_12C,
|
private static final Set<DbType> INPUT_ID_TYPES = SetUtils.asSet(DbType.ORACLE, DbType.ORACLE_12C,
|
||||||
DbType.POSTGRE_SQL, DbType.KINGBASE_ES, DbType.DB2, DbType.H2);
|
DbType.POSTGRE_SQL, DbType.KINGBASE_ES, DbType.DB2, DbType.H2);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
|
public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
|
||||||
// 如果非 NONE,则不进行处理
|
|
||||||
IdType idType = getIdType(environment);
|
|
||||||
if (idType != IdType.NONE) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 如果获取不到 DbType,则不进行处理
|
// 如果获取不到 DbType,则不进行处理
|
||||||
DbType dbType = getDbType(environment);
|
DbType dbType = getDbType(environment);
|
||||||
if (dbType == null) {
|
if (dbType == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 设置 Quartz JobStore 对应的 Driver
|
||||||
|
// TODO 芋艿:暂时没有找到特别合适的地方,先放在这里
|
||||||
|
setJobStoreDriverIfPresent(environment, dbType);
|
||||||
|
|
||||||
|
// 如果非 NONE,则不进行处理
|
||||||
|
IdType idType = getIdType(environment);
|
||||||
|
if (idType != IdType.NONE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// 情况一,用户输入 ID,适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库
|
// 情况一,用户输入 ID,适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库
|
||||||
if (INPUT_ID_TYPES.contains(dbType)) {
|
if (INPUT_ID_TYPES.contains(dbType)) {
|
||||||
setIdType(environment, IdType.INPUT);
|
setIdType(environment, IdType.INPUT);
|
||||||
|
@ -58,6 +64,28 @@ public class IdTypeEnvironmentPostProcessor implements EnvironmentPostProcessor
|
||||||
log.info("[setIdType][修改 MyBatis Plus 的 idType 为({})]", idType);
|
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) {
|
public static DbType getDbType(ConfigurableEnvironment environment) {
|
||||||
String primary = environment.getProperty(DATASOURCE_DYNAMIC_KEY + "." + "primary");
|
String primary = environment.getProperty(DATASOURCE_DYNAMIC_KEY + "." + "primary");
|
||||||
if (StrUtil.isEmpty(primary)) {
|
if (StrUtil.isEmpty(primary)) {
|
||||||
|
|
|
@ -5,7 +5,6 @@ package cn.iocoder.yudao.framework.mybatis.core.enums;
|
||||||
*/
|
*/
|
||||||
public interface SqlConstants {
|
public interface SqlConstants {
|
||||||
|
|
||||||
|
|
||||||
String LIMIT1 = "LIMIT 1";
|
String LIMIT1 = "LIMIT 1";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class BpmOALeaveDO extends BaseDO {
|
||||||
* 请假类型
|
* 请假类型
|
||||||
*/
|
*/
|
||||||
@TableField("\"type\"")
|
@TableField("\"type\"")
|
||||||
private String type;
|
private Integer type;
|
||||||
/**
|
/**
|
||||||
* 原因
|
* 原因
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package cn.iocoder.yudao.module.bpm.dal.mysql.definition;
|
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.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
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;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -17,9 +17,9 @@ import org.apache.ibatis.annotations.Mapper;
|
||||||
public interface BpmFormMapper extends BaseMapperX<BpmFormDO> {
|
public interface BpmFormMapper extends BaseMapperX<BpmFormDO> {
|
||||||
|
|
||||||
default PageResult<BpmFormDO> selectPage(BpmFormPageReqVO reqVO) {
|
default PageResult<BpmFormDO> selectPage(BpmFormPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new QueryWrapperX<BpmFormDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<BpmFormDO>()
|
||||||
.likeIfPresent("name", reqVO.getName())
|
.likeIfPresent(BpmFormDO::getName, reqVO.getName())
|
||||||
.orderByDesc("id"));
|
.orderByDesc(BpmFormDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
package cn.iocoder.yudao.module.bpm.dal.mysql.definition;
|
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.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionExtDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
@ -12,11 +11,11 @@ import java.util.List;
|
||||||
public interface BpmProcessDefinitionExtMapper extends BaseMapperX<BpmProcessDefinitionExtDO> {
|
public interface BpmProcessDefinitionExtMapper extends BaseMapperX<BpmProcessDefinitionExtDO> {
|
||||||
|
|
||||||
default List<BpmProcessDefinitionExtDO> selectListByProcessDefinitionIds(Collection<String> processDefinitionIds) {
|
default List<BpmProcessDefinitionExtDO> selectListByProcessDefinitionIds(Collection<String> processDefinitionIds) {
|
||||||
return selectList("process_definition_id", processDefinitionIds);
|
return selectList(BpmProcessDefinitionExtDO::getProcessDefinitionId, processDefinitionIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
default BpmProcessDefinitionExtDO selectByProcessDefinitionId(String processDefinitionId) {
|
default BpmProcessDefinitionExtDO selectByProcessDefinitionId(String processDefinitionId) {
|
||||||
return selectOne("process_definition_id", processDefinitionId);
|
return selectOne(BpmProcessDefinitionExtDO::getProcessDefinitionId, processDefinitionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,35 +1,34 @@
|
||||||
package cn.iocoder.yudao.module.bpm.dal.mysql.task;
|
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.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
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 com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
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;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface BpmProcessInstanceExtMapper extends BaseMapperX<BpmProcessInstanceExtDO> {
|
public interface BpmProcessInstanceExtMapper extends BaseMapperX<BpmProcessInstanceExtDO> {
|
||||||
|
|
||||||
default PageResult<BpmProcessInstanceExtDO> selectPage(Long userId, BpmProcessInstanceMyPageReqVO reqVO) {
|
default PageResult<BpmProcessInstanceExtDO> selectPage(Long userId, BpmProcessInstanceMyPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new QueryWrapperX<BpmProcessInstanceExtDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<BpmProcessInstanceExtDO>()
|
||||||
.eqIfPresent("start_user_id", userId)
|
.eqIfPresent(BpmProcessInstanceExtDO::getStartUserId, userId)
|
||||||
.likeIfPresent("name", reqVO.getName())
|
.likeIfPresent(BpmProcessInstanceExtDO::getName, reqVO.getName())
|
||||||
.eqIfPresent("process_definition_id", reqVO.getProcessDefinitionId())
|
.eqIfPresent(BpmProcessInstanceExtDO::getProcessDefinitionId, reqVO.getProcessDefinitionId())
|
||||||
.eqIfPresent("category", reqVO.getCategory())
|
.eqIfPresent(BpmProcessInstanceExtDO::getCategory, reqVO.getCategory())
|
||||||
.eqIfPresent("status", reqVO.getStatus())
|
.eqIfPresent(BpmProcessInstanceExtDO::getStatus, reqVO.getStatus())
|
||||||
.eqIfPresent("result", reqVO.getResult())
|
.eqIfPresent(BpmProcessInstanceExtDO::getResult, reqVO.getResult())
|
||||||
.betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
|
.betweenIfPresent(BpmProcessInstanceExtDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
|
||||||
.orderByDesc("id"));
|
.orderByDesc(BpmProcessInstanceExtDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
default BpmProcessInstanceExtDO selectByProcessInstanceId(String processDefinitionId) {
|
default BpmProcessInstanceExtDO selectByProcessInstanceId(String processDefinitionId) {
|
||||||
return selectOne("process_instance_id", processDefinitionId);
|
return selectOne(BpmProcessInstanceExtDO::getProcessInstanceId, processDefinitionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
default void updateByProcessInstanceId(BpmProcessInstanceExtDO updateObj) {
|
default void updateByProcessInstanceId(BpmProcessInstanceExtDO updateObj) {
|
||||||
update(updateObj, new QueryWrapper<BpmProcessInstanceExtDO>()
|
update(updateObj, new LambdaQueryWrapperX<BpmProcessInstanceExtDO>()
|
||||||
.eq("process_instance_id", updateObj.getProcessInstanceId()));
|
.eq(BpmProcessInstanceExtDO::getProcessInstanceId, updateObj.getProcessInstanceId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package cn.iocoder.yudao.module.bpm.dal.mysql.task;
|
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.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmTaskExtDO;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@ -20,6 +20,6 @@ public interface BpmTaskExtMapper extends BaseMapperX<BpmTaskExtDO> {
|
||||||
}
|
}
|
||||||
|
|
||||||
default List<BpmTaskExtDO> selectListByProcessInstanceId(String processInstanceId) {
|
default List<BpmTaskExtDO> selectListByProcessInstanceId(String processInstanceId) {
|
||||||
return selectList("process_instance_id", processInstanceId);
|
return selectList(BpmTaskExtDO::getProcessInstanceId, processInstanceId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ public class FileDO extends BaseDO {
|
||||||
*
|
*
|
||||||
* 通过 {@link cn.hutool.core.io.FileTypeUtil#getType(InputStream)} 获取
|
* 通过 {@link cn.hutool.core.io.FileTypeUtil#getType(InputStream)} 获取
|
||||||
*/
|
*/
|
||||||
@TableField(value = "`type`")
|
@TableField("\"type\"")
|
||||||
private String type;
|
private String type;
|
||||||
/**
|
/**
|
||||||
* 文件大小
|
* 文件大小
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package cn.iocoder.yudao.module.infra.dal.mysql.codegen;
|
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.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import cn.iocoder.yudao.module.infra.dal.dataobject.codegen.CodegenColumnDO;
|
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 org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -11,12 +11,14 @@ import java.util.List;
|
||||||
public interface CodegenColumnMapper extends BaseMapperX<CodegenColumnDO> {
|
public interface CodegenColumnMapper extends BaseMapperX<CodegenColumnDO> {
|
||||||
|
|
||||||
default List<CodegenColumnDO> selectListByTableId(Long tableId) {
|
default List<CodegenColumnDO> selectListByTableId(Long tableId) {
|
||||||
return selectList(new QueryWrapper<CodegenColumnDO>().eq("table_id", tableId)
|
return selectList(new LambdaQueryWrapperX<CodegenColumnDO>()
|
||||||
.orderByAsc("ordinal_position"));
|
.eq(CodegenColumnDO::getTableId, tableId)
|
||||||
|
.orderByAsc(CodegenColumnDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
default void deleteListByTableId(Long tableId) {
|
default void deleteListByTableId(Long tableId) {
|
||||||
delete(new QueryWrapper<CodegenColumnDO>().eq("table_id", tableId));
|
delete(new LambdaQueryWrapperX<CodegenColumnDO>()
|
||||||
|
.eq(CodegenColumnDO::getTableId, tableId));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
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.controller.admin.codegen.vo.table.CodegenTablePageReqVO;
|
||||||
import cn.iocoder.yudao.module.infra.dal.dataobject.codegen.CodegenTableDO;
|
import cn.iocoder.yudao.module.infra.dal.dataobject.codegen.CodegenTableDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
@ -18,10 +18,10 @@ public interface CodegenTableMapper extends BaseMapperX<CodegenTableDO> {
|
||||||
}
|
}
|
||||||
|
|
||||||
default PageResult<CodegenTableDO> selectPage(CodegenTablePageReqVO pageReqVO) {
|
default PageResult<CodegenTableDO> selectPage(CodegenTablePageReqVO pageReqVO) {
|
||||||
return selectPage(pageReqVO, new QueryWrapperX<CodegenTableDO>()
|
return selectPage(pageReqVO, new LambdaQueryWrapperX<CodegenTableDO>()
|
||||||
.likeIfPresent("table_name", pageReqVO.getTableName())
|
.likeIfPresent(CodegenTableDO::getTableName, pageReqVO.getTableName())
|
||||||
.likeIfPresent("table_comment", pageReqVO.getTableComment())
|
.likeIfPresent(CodegenTableDO::getTableComment, pageReqVO.getTableComment())
|
||||||
.betweenIfPresent("create_time", pageReqVO.getBeginCreateTime(), pageReqVO.getEndCreateTime()));
|
.betweenIfPresent(CodegenTableDO::getCreateTime, pageReqVO.getBeginCreateTime(), pageReqVO.getEndCreateTime()));
|
||||||
}
|
}
|
||||||
|
|
||||||
default List<CodegenTableDO> selectListByDataSourceConfigId(Long dataSourceConfigId) {
|
default List<CodegenTableDO> selectListByDataSourceConfigId(Long dataSourceConfigId) {
|
||||||
|
|
|
@ -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.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
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.controller.admin.file.vo.file.FilePageReqVO;
|
||||||
import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO;
|
import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
@ -16,11 +16,11 @@ import org.apache.ibatis.annotations.Mapper;
|
||||||
public interface FileMapper extends BaseMapperX<FileDO> {
|
public interface FileMapper extends BaseMapperX<FileDO> {
|
||||||
|
|
||||||
default PageResult<FileDO> selectPage(FilePageReqVO reqVO) {
|
default PageResult<FileDO> selectPage(FilePageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new QueryWrapperX<FileDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<FileDO>()
|
||||||
.likeIfPresent("path", reqVO.getPath())
|
.likeIfPresent(FileDO::getPath, reqVO.getPath())
|
||||||
.likeIfPresent("type", reqVO.getType())
|
.likeIfPresent(FileDO::getType, reqVO.getType())
|
||||||
.betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
|
.betweenIfPresent(FileDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
|
||||||
.orderByDesc("create_time"));
|
.orderByDesc(FileDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package cn.iocoder.yudao.module.infra.service;
|
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.IDatabaseQuery.DefaultDatabaseQuery;
|
||||||
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
|
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
|
||||||
import com.baomidou.mybatisplus.generator.config.builder.ConfigBuilder;
|
import com.baomidou.mybatisplus.generator.config.builder.ConfigBuilder;
|
||||||
|
@ -10,7 +11,9 @@ import java.util.List;
|
||||||
public class DefaultDatabaseQueryTest {
|
public class DefaultDatabaseQueryTest {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
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();
|
"root", "123456").build();
|
||||||
// StrategyConfig strategyConfig = new StrategyConfig.Builder().build();
|
// StrategyConfig strategyConfig = new StrategyConfig.Builder().build();
|
||||||
|
|
||||||
|
@ -21,6 +24,9 @@ public class DefaultDatabaseQueryTest {
|
||||||
long time = System.currentTimeMillis();
|
long time = System.currentTimeMillis();
|
||||||
List<TableInfo> tableInfos = query.queryTables();
|
List<TableInfo> tableInfos = query.queryTables();
|
||||||
for (TableInfo tableInfo : tableInfos) {
|
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(String.format("CREATE SEQUENCE %s_seq MINVALUE 0;", tableInfo.getName()));
|
||||||
}
|
}
|
||||||
System.out.println(tableInfos.size());
|
System.out.println(tableInfos.size());
|
||||||
|
|
|
@ -32,7 +32,6 @@ public interface PayChannelMapper extends BaseMapperX<PayChannelDO> {
|
||||||
.eqIfPresent("fee_rate", reqVO.getFeeRate())
|
.eqIfPresent("fee_rate", reqVO.getFeeRate())
|
||||||
.eqIfPresent("merchant_id", reqVO.getMerchantId())
|
.eqIfPresent("merchant_id", reqVO.getMerchantId())
|
||||||
.eqIfPresent("app_id", reqVO.getAppId())
|
.eqIfPresent("app_id", reqVO.getAppId())
|
||||||
// .eqIfPresent("config", reqVO.getConfig())
|
|
||||||
.betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
|
.betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
|
||||||
.orderByDesc("id") );
|
.orderByDesc("id") );
|
||||||
}
|
}
|
||||||
|
@ -45,7 +44,6 @@ public interface PayChannelMapper extends BaseMapperX<PayChannelDO> {
|
||||||
.eqIfPresent("fee_rate", reqVO.getFeeRate())
|
.eqIfPresent("fee_rate", reqVO.getFeeRate())
|
||||||
.eqIfPresent("merchant_id", reqVO.getMerchantId())
|
.eqIfPresent("merchant_id", reqVO.getMerchantId())
|
||||||
.eqIfPresent("app_id", reqVO.getAppId())
|
.eqIfPresent("app_id", reqVO.getAppId())
|
||||||
// .eqIfPresent("config", reqVO.getConfig())
|
|
||||||
.betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
|
.betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
|
||||||
.orderByDesc("id") );
|
.orderByDesc("id") );
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
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.controller.admin.sms.vo.channel.SmsChannelPageReqVO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
@ -14,11 +14,11 @@ import java.util.Date;
|
||||||
public interface SmsChannelMapper extends BaseMapperX<SmsChannelDO> {
|
public interface SmsChannelMapper extends BaseMapperX<SmsChannelDO> {
|
||||||
|
|
||||||
default PageResult<SmsChannelDO> selectPage(SmsChannelPageReqVO reqVO) {
|
default PageResult<SmsChannelDO> selectPage(SmsChannelPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new QueryWrapperX<SmsChannelDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<SmsChannelDO>()
|
||||||
.likeIfPresent("signature", reqVO.getSignature())
|
.likeIfPresent(SmsChannelDO::getSignature, reqVO.getSignature())
|
||||||
.eqIfPresent("status", reqVO.getStatus())
|
.eqIfPresent(SmsChannelDO::getStatus, reqVO.getStatus())
|
||||||
.betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
|
.betweenIfPresent(SmsChannelDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
|
||||||
.orderByDesc("id"));
|
.orderByDesc(SmsChannelDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Select("SELECT id FROM system_sms_channel WHERE update_time > #{maxUpdateTime} LIMIT 1")
|
@Select("SELECT id FROM system_sms_channel WHERE update_time > #{maxUpdateTime} LIMIT 1")
|
||||||
|
|
|
@ -43,11 +43,11 @@
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- 默认引入 yudao-module-bpm-biz-flowable 实现,可以替换为 yudao-module-bpm-biz-activiti 实现-->
|
<!-- 默认引入 yudao-module-bpm-biz-flowable 实现,可以替换为 yudao-module-bpm-biz-activiti 实现-->
|
||||||
<!-- <dependency>-->
|
<dependency>
|
||||||
<!-- <groupId>cn.iocoder.boot</groupId>-->
|
<groupId>cn.iocoder.boot</groupId>
|
||||||
<!-- <artifactId>yudao-module-bpm-biz-flowable</artifactId>-->
|
<artifactId>yudao-module-bpm-biz-flowable</artifactId>
|
||||||
<!-- <version>${revision}</version>-->
|
<version>${revision}</version>
|
||||||
<!-- </dependency>-->
|
</dependency>
|
||||||
<!-- <dependency>-->
|
<!-- <dependency>-->
|
||||||
<!-- <groupId>cn.iocoder.boot</groupId>-->
|
<!-- <groupId>cn.iocoder.boot</groupId>-->
|
||||||
<!-- <artifactId>yudao-module-bpm-biz-activiti</artifactId>-->
|
<!-- <artifactId>yudao-module-bpm-biz-activiti</artifactId>-->
|
||||||
|
|
|
@ -39,7 +39,7 @@ spring:
|
||||||
|
|
||||||
# 工作流 Flowable 配置
|
# 工作流 Flowable 配置
|
||||||
flowable:
|
flowable:
|
||||||
# 1. false: 默认值,activiti启动时,对比数据库表中保存的版本,如果不匹配。将抛出异常
|
# 1. false: 默认值,Flowable 启动时,对比数据库表中保存的版本,如果不匹配。将抛出异常
|
||||||
# 2. true: 启动时会对数据库中所有表进行更新操作,如果表存在,不做处理,反之,自动创建表
|
# 2. true: 启动时会对数据库中所有表进行更新操作,如果表存在,不做处理,反之,自动创建表
|
||||||
# 3. create_drop: 启动时自动创建表,关闭时自动删除表
|
# 3. create_drop: 启动时自动创建表,关闭时自动删除表
|
||||||
# 4. drop_create: 启动时,删除旧表,再创建新表
|
# 4. drop_create: 启动时,删除旧表,再创建新表
|
||||||
|
|
Loading…
Reference in New Issue