Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Eladmin
Commits
73eb3501
Commit
73eb3501
authored
Jun 21, 2020
by
ZhengJie
Browse files
[代码优化](v2.5): @Query 加入 INNER 查询
close
https://github.com/elunez/eladmin/issues/415
parent
a24d4f77
Changes
2
Hide whitespace changes
Inline
Side-by-side
eladmin-common/src/main/java/me/zhengjie/annotation/Query.java
View file @
73eb3501
...
@@ -80,8 +80,8 @@ public @interface Query {
...
@@ -80,8 +80,8 @@ public @interface Query {
* 适用于简单连接查询,复杂的请自定义该注解,或者使用sql查询
* 适用于简单连接查询,复杂的请自定义该注解,或者使用sql查询
*/
*/
enum
Join
{
enum
Join
{
/** jie 2019-6-4 13:18:30
左右连接
*/
/** jie 2019-6-4 13:18:30 */
LEFT
,
RIGHT
LEFT
,
RIGHT
,
INNER
}
}
}
}
...
...
eladmin-common/src/main/java/me/zhengjie/utils/QueryHelp.java
View file @
73eb3501
...
@@ -100,6 +100,13 @@ public class QueryHelp {
...
@@ -100,6 +100,13 @@ public class QueryHelp {
join
=
root
.
join
(
name
,
JoinType
.
RIGHT
);
join
=
root
.
join
(
name
,
JoinType
.
RIGHT
);
}
}
break
;
break
;
case
INNER:
if
(
ObjectUtil
.
isNotNull
(
join
)
&&
ObjectUtil
.
isNotNull
(
val
)){
join
=
join
.
join
(
name
,
JoinType
.
INNER
);
}
else
{
join
=
root
.
join
(
name
,
JoinType
.
INNER
);
}
break
;
default
:
break
;
default
:
break
;
}
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment