|
@@ -0,0 +1,46 @@
|
|
|
+package com.qmth.ops.biz.query;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.qmth.boot.mybatis.query.BaseQuery;
|
|
|
+import com.qmth.ops.biz.domain.Role;
|
|
|
+import com.qmth.ops.biz.domain.User;
|
|
|
+
|
|
|
+public class UserQuery extends BaseQuery<User> {
|
|
|
+
|
|
|
+ private static final long serialVersionUID = -8943542338584325944L;
|
|
|
+
|
|
|
+ private Long id;
|
|
|
+
|
|
|
+ private String loginNameStartWith;
|
|
|
+
|
|
|
+ private Role role;
|
|
|
+
|
|
|
+ public Long getId() {
|
|
|
+ return id;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setId(Long id) {
|
|
|
+ this.id = id;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getLoginNameStartWith() {
|
|
|
+ return loginNameStartWith;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setLoginNameStartWith(String loginNameStartWith) {
|
|
|
+ this.loginNameStartWith = loginNameStartWith;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Role getRole() {
|
|
|
+ return role;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setRole(Role role) {
|
|
|
+ this.role = role;
|
|
|
+ }
|
|
|
+
|
|
|
+ public LambdaQueryWrapper<User> build() {
|
|
|
+ return new LambdaQueryWrapper<User>().eq(id != null, User::getId, id).eq(role != null, User::getRole, role)
|
|
|
+ .likeRight(loginNameStartWith != null, User::getLoginName, loginNameStartWith);
|
|
|
+ }
|
|
|
+}
|