|
@@ -4,10 +4,12 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
import com.xjrsoft.common.model.result.RT;
|
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
+import com.xjrsoft.module.organization.entity.Role;
|
|
|
import com.xjrsoft.module.system.dto.AddXjrMenuGroupDto;
|
|
|
import com.xjrsoft.module.system.dto.AddXjrMenuGroupSetDto;
|
|
|
import com.xjrsoft.module.system.dto.UpdateXjrMenuGroupSetDto;
|
|
@@ -53,11 +55,15 @@ public class XjrMenuGroupSetController {
|
|
|
@SaCheckPermission("xjrmenugroupset:detail")
|
|
|
public RT<PageOutput<XjrMenuGroupSetPageVo>> page(@Valid XjrMenuGroupSetPageDto dto){
|
|
|
|
|
|
- LambdaQueryWrapper<XjrMenuGroupSet> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ MPJLambdaWrapper<XjrMenuGroupSet> queryWrapper = new MPJLambdaWrapper<>();
|
|
|
queryWrapper
|
|
|
- .orderByDesc(XjrMenuGroupSet::getId)
|
|
|
- .select(XjrMenuGroupSet.class,x -> VoToColumnUtil.fieldsToColumns(XjrMenuGroupSetPageVo.class).contains(x.getProperty()));
|
|
|
- IPage<XjrMenuGroupSet> page = xjrMenuGroupSetService.page(ConventPage.getPage(dto), queryWrapper);
|
|
|
+ .leftJoin(Role.class, Role::getId, XjrMenuGroupSet::getRoleId)
|
|
|
+ .select(XjrMenuGroupSet::getId)
|
|
|
+ .selectAs(Role::getName, XjrMenuGroupSetPageVo::getRoleName)
|
|
|
+ .select(XjrMenuGroupSet.class,x -> VoToColumnUtil.fieldsToColumns(XjrMenuGroupSetPageVo.class).contains(x.getProperty()))
|
|
|
+ .orderByDesc(XjrMenuGroupSet::getCreateDate)
|
|
|
+ .disableSubLogicDel();
|
|
|
+ IPage<XjrMenuGroupSetPageVo> page = xjrMenuGroupSetService.selectJoinListPage(ConventPage.getPage(dto), XjrMenuGroupSetPageVo.class, queryWrapper);
|
|
|
PageOutput<XjrMenuGroupSetPageVo> pageOutput = ConventPage.getPageOutput(page, XjrMenuGroupSetPageVo.class);
|
|
|
return RT.ok(pageOutput);
|
|
|
}
|