This commit is contained in:
admin 2021-04-23 17:31:54 +08:00
parent e8f10b361f
commit 87fc43c945
3 changed files with 12 additions and 12 deletions

View File

@ -16,7 +16,7 @@ QQ群:1022221898
<dependency> <dependency>
<groupId>com.github.yulichang</groupId> <groupId>com.github.yulichang</groupId>
<artifactId>mybatis-plus-join</artifactId> <artifactId>mybatis-plus-join</artifactId>
<version>1.1.5</version> <version>1.1.6</version>
</dependency> </dependency>
``` ```
或者clone代码到本地,执行mvn install,再引入以上依赖 或者clone代码到本地,执行mvn install,再引入以上依赖
@ -42,11 +42,11 @@ QQ群:1022221898
3. MPJBaseServiceImpl 继承了ServiceImpl,同样添加了以上方法 3. MPJBaseServiceImpl 继承了ServiceImpl,同样添加了以上方法
## 核心类 MPJQueryWrapper和MPJJoinLambdaQueryWrapper ## 核心类 MPJLambdaWrapper和MPJQueryWrapper
### MPJJoinLambdaQueryWrapper用法 ### MPJLambdaWrapper用法
#### MPJJoinLambdaQueryWrapper示例 #### MPJLambdaWrapper示例
#### 简单的3表查询 #### 简单的3表查询
@ -57,7 +57,7 @@ class test {
void testJoin() { void testJoin() {
List<UserDTO> list = userMapper.selectJoinList(UserDTO.class, List<UserDTO> list = userMapper.selectJoinList(UserDTO.class,
new MPJJoinLambdaQueryWrapper<UserDO>() Wrappers.<UserDO>lambdaJoin()
.selectAll(UserDO.class) .selectAll(UserDO.class)
.select(UserAddressDO::getTel) .select(UserAddressDO::getTel)
.selectAs(UserAddressDO::getAddress, UserDTO::getUserAddress) .selectAs(UserAddressDO::getAddress, UserDTO::getUserAddress)
@ -116,7 +116,7 @@ class test {
void testJoin() { void testJoin() {
IPage<UserDTO> iPage = userMapper.selectJoinPage(new Page<>(2, 10), UserDTO.class, IPage<UserDTO> iPage = userMapper.selectJoinPage(new Page<>(2, 10), UserDTO.class,
new MPJJoinLambdaQueryWrapper<UserDO>() Wrappers.<UserDO>lambdaJoin()
.selectAll(UserDO.class) .selectAll(UserDO.class)
.select(UserAddressDO::getTel) .select(UserAddressDO::getTel)
.selectAs(UserAddressDO::getAddress, UserDTO::getUserAddress) .selectAs(UserAddressDO::getAddress, UserDTO::getUserAddress)
@ -157,7 +157,7 @@ class test {
void testJoin() { void testJoin() {
List<UserDTO> list = userMapper.selectJoinList(UserDTO.class, List<UserDTO> list = userMapper.selectJoinList(UserDTO.class,
new MPJQueryWrapper<UserDO>() Wrappers.<UserDO>queryJoin()
.selectAll(UserDO.class) .selectAll(UserDO.class)
.select("addr.tel", "addr.address", "a.province") .select("addr.tel", "addr.address", "a.province")
.leftJoin("user_address addr on t.id = addr.user_id") .leftJoin("user_address addr on t.id = addr.user_id")
@ -206,7 +206,7 @@ class test {
void testJoin() { void testJoin() {
IPage<UserDTO> page = userMapper.selectJoinPage(new Page<>(1, 10), UserDTO.class, IPage<UserDTO> page = userMapper.selectJoinPage(new Page<>(1, 10), UserDTO.class,
new MPJLambdaQueryWrapper<UserDO>() Wrappers.<UserDO>queryJoin()
.selectAll(UserDO.class) .selectAll(UserDO.class)
.select("addr.tel", "addr.address") .select("addr.tel", "addr.address")
.select("a.province") .select("a.province")
@ -243,7 +243,7 @@ class test {
void testJoin() { void testJoin() {
List<UserDTO> list = userMapper.selectJoinList(UserDTO.class, List<UserDTO> list = userMapper.selectJoinList(UserDTO.class,
new MPJLambdaQueryWrapper<UserDO>() Wrappers.<UserDO>queryJoin()
.selectAll(UserDO.class) .selectAll(UserDO.class)
.select("addr.tel", "addr.address") .select("addr.tel", "addr.address")
//行列转换 //行列转换

View File

@ -50,7 +50,7 @@
<configuration> <configuration>
<serverId>ossrh</serverId> <serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl> <nexusUrl>https://oss.sonatype.org/</nexusUrl>
<!-- <autoReleaseAfterClose>true</autoReleaseAfterClose>--> <autoReleaseAfterClose>true</autoReleaseAfterClose>
<stagingProgressTimeoutMinutes>30</stagingProgressTimeoutMinutes> <stagingProgressTimeoutMinutes>30</stagingProgressTimeoutMinutes>
</configuration> </configuration>
</plugin> </plugin>
@ -120,7 +120,7 @@
<configuration> <configuration>
<serverId>ossrh</serverId> <serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl> <nexusUrl>https://oss.sonatype.org/</nexusUrl>
<!-- <autoReleaseAfterClose>true</autoReleaseAfterClose>--> <autoReleaseAfterClose>true</autoReleaseAfterClose>
<stagingProgressTimeoutMinutes>30</stagingProgressTimeoutMinutes> <stagingProgressTimeoutMinutes>30</stagingProgressTimeoutMinutes>
</configuration> </configuration>
</plugin> </plugin>

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.github.yulichang</groupId> <groupId>com.github.yulichang</groupId>
<artifactId>mybatis-plus-join</artifactId> <artifactId>mybatis-plus-join</artifactId>
<version>1.1.5</version> <version>1.1.6</version>
<name>mybatis-plus-join</name> <name>mybatis-plus-join</name>
<description>An enhanced toolkit of Mybatis-Plus to simplify development.</description> <description>An enhanced toolkit of Mybatis-Plus to simplify development.</description>
<url>https://github.com/yulichang/mybatis-plus-join</url> <url>https://github.com/yulichang/mybatis-plus-join</url>