fix: 优化代码

pull/32/head
Parker 1 year ago
parent 9ca9dea72a
commit 535a5da781

@ -166,11 +166,9 @@ public class SysOrgRestController extends BaseRestController<SysOrg, SysOrgModel
wrapper.eq(FieldUtil.humpToUnderline(MyBatisConstants.FIELD_PARENT_ID), parentId);
// 如果传入ID 则不包含自身
if(StringUtils.isNotEmpty(id)){
wrapper.notIn(
wrapper.notIn(StringUtils.isNotEmpty(id),
FieldUtil.humpToUnderline(MyBatisConstants.FIELD_ID), id);
}
// 获得组织
List<SysOrg> dataList = IService.findList(wrapper);
@ -188,12 +186,11 @@ public class SysOrgRestController extends BaseRestController<SysOrg, SysOrgModel
QueryWrapper<SysOrg> wrapperByEmpty = queryBuilder.build();
wrapperByEmpty.in(!genOrgIdSet.isEmpty(), FieldUtil.humpToUnderline(MyBatisConstants.FIELD_ID), genOrgIdSet);
wrapperByEmpty.in(!genOrgIdSet.isEmpty(),
FieldUtil.humpToUnderline(MyBatisConstants.FIELD_ID), genOrgIdSet);
// 如果传入ID 则不包含自身
if(StringUtils.isNotEmpty(id)){
wrapperByEmpty.notIn(FieldUtil.humpToUnderline(MyBatisConstants.FIELD_ID), id);
}
wrapperByEmpty.notIn(StringUtils.isNotEmpty(id),
FieldUtil.humpToUnderline(MyBatisConstants.FIELD_ID), id);
// 获得组织
dataList = IService.findList(wrapperByEmpty);
}

Loading…
Cancel
Save