fix 修复 distinct 在 sqlserver 中的限制 补缺排序字段 确保语法正确

This commit is contained in:
疯狂的狮子Li
2026-03-30 15:21:37 +08:00
parent a57694bdff
commit 175a02f49c
2 changed files with 2 additions and 2 deletions

View File

@@ -104,7 +104,7 @@ public interface SysDeptMapper extends BaseMapperPlus<SysDept, SysDeptVo>, MPJBa
default List<Long> selectDeptListByRoleId(Long roleId, boolean deptCheckStrictly) {
List<SysDept> depts = this.selectJoinList(SysDept.class, JoinWrappers.lambda("d", SysDept.class)
.distinct()
.select(SysDept::getDeptId, SysDept::getParentId)
.select(SysDept::getDeptId, SysDept::getParentId, SysDept::getOrderNum)
.leftJoin(SysRoleDept.class, "srd", SysRoleDept::getDeptId, SysDept::getDeptId)
.leftJoin(SysRole.class, "sr", SysRole::getRoleId, SysRoleDept::getRoleId)
.eq("srd", SysRoleDept::getRoleId, roleId)

View File

@@ -115,7 +115,7 @@ public interface SysMenuMapper extends BaseMapperPlus<SysMenu, SysMenuVo>, MPJBa
default List<Long> selectMenuListByRoleId(Long roleId, boolean menuCheckStrictly) {
List<SysMenu> menus = this.selectJoinList(SysMenu.class, JoinWrappers.lambda("m", SysMenu.class)
.distinct()
.select(SysMenu::getMenuId, SysMenu::getParentId)
.select(SysMenu::getMenuId, SysMenu::getParentId, SysMenu::getOrderNum)
.leftJoin(SysRoleMenu.class, "srm", SysRoleMenu::getMenuId, SysMenu::getMenuId)
.leftJoin(SysRole.class, "sr", SysRole::getRoleId, SysRoleMenu::getRoleId)
.eq("srm", SysRoleMenu::getRoleId, roleId)