Skip to content

Commit

Permalink
1.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
yulichang committed Oct 8, 2024
1 parent 6a5983a commit 7e3ee68
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 94 deletions.
4 changes: 2 additions & 2 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ QQ群:680016987 或者
<dependency>
<groupId>com.github.yulichang</groupId>
<artifactId>mybatis-plus-join-boot-starter</artifactId>
<version>1.5.0</version>
<version>1.5.1</version>
</dependency>
```
- Gradle
```
implementation 'com.github.yulichang:mybatis-plus-join-boot-starter:1.5.0'
implementation 'com.github.yulichang:mybatis-plus-join-boot-starter:1.5.1'
```
或者clone代码到本地执行 mvn install, 再引入以上依赖
<br>
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ QQ群:680016987 或者
<dependency>
<groupId>com.github.yulichang</groupId>
<artifactId>mybatis-plus-join-boot-starter</artifactId>
<version>1.5.0</version>
<version>1.5.1</version>
</dependency>
```
- Gradle
```
implementation 'com.github.yulichang:mybatis-plus-join-boot-starter:1.5.0'
implementation 'com.github.yulichang:mybatis-plus-join-boot-starter:1.5.1'
```
或者clone代码到本地执行 mvn install, 再引入以上依赖
<br>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public MPJInterceptorConfig(List<SqlSessionFactory> sqlSessionFactoryList, Boole
System.out.println(" _ _ |_ _ _|_. ___ _ | _ . _ . _ \n" +
"| | |\\/|_)(_| | |_\\ |_)||_|_\\ | (_) | | | \n" +
" / | /\n" +
" 1.5.0");
" 1.5.1");
}
}

Expand Down
2 changes: 1 addition & 1 deletion mybatis-plus-join-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</scm>

<properties>
<revision>1.5.0</revision>
<revision>1.5.1</revision>
<mybatis.plus.version>3.5.8</mybatis.plus.version>

<jdkVersion>17</jdkVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,99 +1,14 @@
package com.github.yulichang.mybatisplusjoin.solon.plugin.base;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.solon.service.IService;
import com.baomidou.mybatisplus.solon.toolkit.SqlHelper;
import com.github.yulichang.base.MPJBaseMapper;
import com.github.yulichang.interfaces.MPJBaseJoin;

import java.util.List;
import java.util.Map;
import com.github.yulichang.base.JoinService;

/**
* 基础service
* 目前包含两个模块 连表查询 和 关系映射
*
* @author yulichang
*/
@SuppressWarnings({"unused"})
public interface MPJBaseService<T> extends IService<T> {


/**
* 根据 Wrapper 条件,连表删除
*
* @param wrapper joinWrapper
*/
default boolean deleteJoin(MPJBaseJoin<T> wrapper) {
return SqlHelper.retBool(((MPJBaseMapper<T>) getBaseMapper()).deleteJoin(wrapper));
}

/**
* 根据 whereEntity 条件,更新记录
*
* @param entity 实体对象 (set 条件值,可以为 null)
* @param wrapper 实体对象封装操作类(可以为 null,里面的 entity 用于生成 where 语句)
*/
default boolean updateJoin(T entity, MPJBaseJoin<T> wrapper) {
return SqlHelper.retBool(((MPJBaseMapper<T>) getBaseMapper()).updateJoin(entity, wrapper));
}

/**
* 根据 whereEntity 条件,更新记录 (null字段也会更新 !!!)
*
* @param entity 实体对象 (set 条件值,可以为 null)
* @param wrapper 实体对象封装操作类(可以为 null,里面的 entity 用于生成 where 语句)
*/
default boolean updateJoinAndNull(T entity, MPJBaseJoin<T> wrapper) {
return SqlHelper.retBool(((MPJBaseMapper<T>) getBaseMapper()).updateJoinAndNull(entity, wrapper));
}

/**
* 根据 Wrapper 条件,查询总记录数
*/
default Long selectJoinCount(MPJBaseJoin<T> wrapper) {
return ((MPJBaseMapper<T>) getBaseMapper()).selectJoinCount(wrapper);
}

/**
* 连接查询返回一条记录
*/
default <DTO> DTO selectJoinOne(Class<DTO> clazz, MPJBaseJoin<T> wrapper) {
return ((MPJBaseMapper<T>) getBaseMapper()).selectJoinOne(clazz, wrapper);
}

/**
* 连接查询返回集合
*/
default <DTO> List<DTO> selectJoinList(Class<DTO> clazz, MPJBaseJoin<T> wrapper) {
return ((MPJBaseMapper<T>) getBaseMapper()).selectJoinList(clazz, wrapper);
}

/**
* 连接查询返回集合并分页
*/
default <DTO, P extends IPage<DTO>> P selectJoinListPage(P page, Class<DTO> clazz, MPJBaseJoin<T> wrapper) {
return ((MPJBaseMapper<T>) getBaseMapper()).selectJoinPage(page, clazz, wrapper);
}

/**
* 连接查询返回Map
*/
default Map<String, Object> selectJoinMap(MPJBaseJoin<T> wrapper) {
return ((MPJBaseMapper<T>) getBaseMapper()).selectJoinMap(wrapper);
}

/**
* 连接查询返回Map集合
*/
default List<Map<String, Object>> selectJoinMaps(MPJBaseJoin<T> wrapper) {
return ((MPJBaseMapper<T>) getBaseMapper()).selectJoinMaps(wrapper);
}
public interface MPJBaseService<T> extends IService<T>, JoinService<T> {

/**
* 连接查询返回Map集合并分页
*/
default <P extends IPage<Map<String, Object>>> P selectJoinMapsPage(P page, MPJBaseJoin<T> wrapper) {
return ((MPJBaseMapper<T>) getBaseMapper()).selectJoinMapsPage(page, wrapper);
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</modules>

<properties>
<revision>1.5.0</revision>
<revision>1.5.1</revision>
<mybatis.plus.version>3.5.8</mybatis.plus.version>

<jdkVersion>17</jdkVersion>
Expand Down

0 comments on commit 7e3ee68

Please sign in to comment.