This commit is contained in:
lijiaqi 2024-05-16 16:49:01 +08:00
parent 2032c3201b
commit f973de4f6f
2 changed files with 10 additions and 5 deletions

View File

@ -7,6 +7,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.query.MPJQueryWrapper;
import com.ydool.common.base.BaseService;
import com.ydool.common.data.dto.AjaxResult;
import com.ydool.integrated.entity.Meeting;
@ -243,10 +244,13 @@ public class MeetingService extends BaseService<MeetingMapper, Meeting> {
}
public AjaxResult user() {
List<User> userList = userService.list(new QueryWrapper<User>()
MPJQueryWrapper<User> qw = new MPJQueryWrapper<User>();
qw.selectAll(User.class).leftJoin("t_sys_dept dept on dept.id = t.dept")
.leftJoin("t_sys_job job on job.id = t.job")
.lambda()
.in(User::getUserName, "沈佳峰", "屠勇", "王焕", "朱宗华", "王孟卓")
);
.in(User::getUserName, "沈佳峰", "屠勇", "王焕", "朱宗华", "王孟卓");
qw.orderByAsc("dept.sort_no","job.sort_no");
List<User> userList = userService.list(qw);
return AjaxResult.ok().data(UserWrapper.INSTANCE.toDto(userList));
}
}

View File

@ -155,7 +155,8 @@ public class UserServiceImpl extends BaseService<UserMapper, User> implements IU
public AjaxResult userList(Page page, String value, String column, String orderBy, Boolean status, String role,
String dept, String job) {
MPJQueryWrapper<User> qw = new MPJQueryWrapper<User>();
qw.selectAll(User.class).leftJoin("t_sys_dept dept on dept.id = t.dept");
qw.selectAll(User.class).leftJoin("t_sys_dept dept on dept.id = t.dept")
.leftJoin("t_sys_job job on job.id = t.job");
if (StrUtil.isNotBlank(value)) {
qw.and(query ->
query.like("AES_DECRYPT(from_base64 (t.phone),'" + CodecUtils.KEY + "')", value).lambda()
@ -177,7 +178,7 @@ public class UserServiceImpl extends BaseService<UserMapper, User> implements IU
qw.orderByAsc("t." + StrUtil.toUnderlineCase(column));
}
if (StrUtil.isBlank(column)) {
qw.orderByAsc("dept.sort_no");
qw.orderByAsc("dept.sort_no","job.sort_no");
}