diff --git a/README.md b/README.md index df38d0d..50b73e9 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,16 @@ Ruoyi-Flex是一套全部开源的快速开发平台,使用MIT开源许可协 +## 开源协议 + +**为什么推荐使用本项目?** + +① 本项目采用比 Apache 2.0 更宽松的 [MIT License](https://gitee.com/dataprince/ruoyi-flex/blob/master/LICENSE) 开源协议,个人与企业可 100% 免费使用,不用保留类作者、Copyright 信息。 + +② 代码全部开源,不会像其它项目一样,只开源部分代码,让你无法了解整个项目的架构设计。 + +如果这个项目让您有所收获,记得 Star 关注哦,这对我是非常不错的鼓励与支持。 + ## 演示图 diff --git a/doc/Ruoyi-Flex-Guide.docx b/doc/Ruoyi-Flex-Guide.docx index a331cb7..1290bcc 100644 Binary files a/doc/Ruoyi-Flex-Guide.docx and b/doc/Ruoyi-Flex-Guide.docx differ diff --git a/ruoyi-common/ruoyi-common-orm/src/main/java/com/ruoyi/common/orm/core/service/impl/BaseCacheableServiceImpl.java b/ruoyi-common/ruoyi-common-orm/src/main/java/com/ruoyi/common/orm/core/service/impl/BaseCacheableServiceImpl.java deleted file mode 100644 index 727cdee..0000000 --- a/ruoyi-common/ruoyi-common-orm/src/main/java/com/ruoyi/common/orm/core/service/impl/BaseCacheableServiceImpl.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.ruoyi.common.orm.core.service.impl; - -import com.mybatisflex.core.BaseMapper; -import com.mybatisflex.spring.service.impl.CacheableServiceImpl; -import com.ruoyi.common.orm.core.domain.BaseEntity; -import com.ruoyi.common.orm.core.service.IBaseService; - -/** - * 自定义的缓存服务基类的实现类 - * - * @author dataprince数据小王子 - */ -public abstract class BaseCacheableServiceImpl, T extends BaseEntity> extends CacheableServiceImpl implements IBaseService { -} diff --git a/ruoyi-common/ruoyi-common-orm/src/main/java/com/ruoyi/common/orm/core/service/impl/BaseServiceImpl.java b/ruoyi-common/ruoyi-common-orm/src/main/java/com/ruoyi/common/orm/core/service/impl/BaseServiceImpl.java index bcee61f..c24b2c1 100644 --- a/ruoyi-common/ruoyi-common-orm/src/main/java/com/ruoyi/common/orm/core/service/impl/BaseServiceImpl.java +++ b/ruoyi-common/ruoyi-common-orm/src/main/java/com/ruoyi/common/orm/core/service/impl/BaseServiceImpl.java @@ -1,7 +1,12 @@ package com.ruoyi.common.orm.core.service.impl; import com.mybatisflex.core.BaseMapper; +import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.spring.service.impl.ServiceImpl; +import com.ruoyi.common.core.core.page.PageDomain; +import com.ruoyi.common.core.core.page.TableSupport; +import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.core.utils.sql.SqlUtil; import com.ruoyi.common.orm.core.domain.BaseEntity; import com.ruoyi.common.orm.core.service.IBaseService; @@ -10,5 +15,19 @@ import com.ruoyi.common.orm.core.service.IBaseService; * * @author dataprince数据小王子 */ -public abstract class BaseServiceImpl, T extends BaseEntity> extends ServiceImpl implements IBaseService { +public class BaseServiceImpl, T extends BaseEntity> extends ServiceImpl implements IBaseService { + + /** + * 构造基本查询条件 + * @return QueryWrapper + */ + protected QueryWrapper buildBaseQueryWrapper(){ + QueryWrapper queryWrapper = query(); + PageDomain pageDomain = TableSupport.buildPageRequest(); + if (StringUtils.isNotEmpty(pageDomain.getOrderBy())) { + String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); + queryWrapper.orderBy(orderBy); + } + return queryWrapper; + } }