增加多数据源演示(学生信息表的服务selectPage方法),默认关闭
This commit is contained in:
parent
ea1411246e
commit
f546a47c61
@ -7,7 +7,7 @@
|
||||
|
||||
## 1、平台简介
|
||||
|
||||
Ruoyi-Flex是一套全部开源的快速开发平台,使用MIT开源许可协议,毫无保留给个人及企业免费使用。基于RuoYi-Vue、RuoYi-Vue-Plus,集成MyBatis-Flex、JDK21、SpringBootV3.2.X+、Lombok、Sa-Token、SpringDoc、Hutool、SpringBoot Admin、PowerJob、Vue3、Element-Plus、MinIO等优秀开源软件,
|
||||
Ruoyi-Flex是一套全部开源的快速开发平台,使用MIT开源许可协议,毫无保留给个人及企业免费使用。基于RuoYi-Vue、RuoYi-Vue-Plus,集成MyBatis-Flex、JDK21、SpringBootV3.2.X+、Lombok、Sa-Token、SpringDoc、Hutool、SpringBoot Admin、PowerJob、Vue3、Element-Plus、MinIO等优秀开源软件。
|
||||
|
||||
## 2、系统特色
|
||||
Ruoyi-Flex秉承“写的更少、性能更好、出错更低、交流通畅、快速入门” 的理念,为您带来全方位的赋能与提升:
|
||||
|
@ -38,15 +38,15 @@ mybatis-flex:
|
||||
# 指定为HikariDataSource
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
# mysql数据库
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/ruoyi-flex?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: Root@369
|
||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# url: jdbc:mysql://localhost:3306/ruoyi-flex?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true
|
||||
# username: root
|
||||
# password: Root@369
|
||||
#postgresql数据库
|
||||
# driver-class-name: org.postgresql.Driver
|
||||
# url: jdbc:postgresql://localhost:5432/ruoyi-flex?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
|
||||
# username: postgres
|
||||
# password: postgres@369
|
||||
driver-class-name: org.postgresql.Driver
|
||||
url: jdbc:postgresql://localhost:5432/ruoyi-flex?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
|
||||
username: postgres
|
||||
password: postgres@369
|
||||
|
||||
hikari:
|
||||
#连接池名
|
||||
@ -69,6 +69,42 @@ mybatis-flex:
|
||||
keepaliveTime: 30000
|
||||
# 连接测试query
|
||||
connection-test-query: SELECT 1
|
||||
# 数据源-2
|
||||
# ds2:
|
||||
# # 指定为HikariDataSource
|
||||
# type: com.zaxxer.hikari.HikariDataSource
|
||||
# # mysql数据库
|
||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# url: jdbc:mysql://localhost:3306/ruoyi-flex?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true
|
||||
# username: root
|
||||
# password: Root@369
|
||||
# #postgresql数据库
|
||||
## driver-class-name: org.postgresql.Driver
|
||||
## url: jdbc:postgresql://localhost:5432/ruoyi-flex?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
|
||||
## username: postgres
|
||||
## password: postgres@369
|
||||
#
|
||||
# hikari:
|
||||
# #连接池名
|
||||
# pool-name: HikariCP-ds1
|
||||
# #最小空闲连接数
|
||||
# minimum-idle: 5
|
||||
# # 空闲连接存活最大时间,默认10分钟
|
||||
# idle-timeout: 600000
|
||||
# # 连接池最大连接数,默认是10
|
||||
# maximum-pool-size: 10
|
||||
# # 此属性控制从池返回的连接的默认自动提交行为,默认值:true
|
||||
# auto-commit: true
|
||||
# # 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟
|
||||
# max-lifetime: 1800000
|
||||
# # 数据库连接超时时间,默认30秒
|
||||
# connection-timeout: 30000
|
||||
# # 校验超时时间
|
||||
# validationTimeout: 5000
|
||||
# # 多久检查一次连接的活性
|
||||
# keepaliveTime: 30000
|
||||
# # 连接测试query
|
||||
# connection-test-query: SELECT 1
|
||||
|
||||
# redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
|
||||
spring.data:
|
||||
@ -123,7 +159,7 @@ management:
|
||||
--- # 监控中心客户端配置
|
||||
spring.boot.admin.client:
|
||||
# 增加客户端开关
|
||||
enabled: true
|
||||
enabled: false
|
||||
url: http://localhost:9090/admin
|
||||
instance:
|
||||
service-host-type: IP
|
||||
@ -134,7 +170,7 @@ spring.boot.admin.client:
|
||||
powerjob:
|
||||
worker:
|
||||
# 如何开启调度中心请查看文档教程
|
||||
enabled: true
|
||||
enabled: false
|
||||
# 需要先在 powerjob 登录页执行应用注册后才能使用
|
||||
app-name: ruoyi-worker
|
||||
# 28080 端口 随着主应用端口飘逸 避免集群冲突
|
||||
|
@ -2,8 +2,7 @@ package com.ruoyi.mf.service.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.mybatisflex.annotation.UseDataSource;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.ruoyi.common.core.utils.MapstructUtils;
|
||||
@ -11,7 +10,6 @@ import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.orm.core.page.PageQuery;
|
||||
import com.ruoyi.common.orm.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.orm.core.service.impl.BaseServiceImpl;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -85,6 +83,7 @@ public class MfStudentServiceImpl extends BaseServiceImpl<MfStudentMapper, MfStu
|
||||
* @return 分页学生信息表集合
|
||||
*/
|
||||
@Override
|
||||
//@UseDataSource("ds2")
|
||||
public TableDataInfo<MfStudentVo> selectPage(MfStudentBo mfStudentBo)
|
||||
{
|
||||
QueryWrapper queryWrapper = buildQueryWrapper(mfStudentBo);
|
||||
|
Loading…
Reference in New Issue
Block a user