修复分组搜索bug

pull/22/head
rays 2021-06-21 10:33:01 +08:00
parent 2717aa24c7
commit 93deb10413
2 changed files with 6 additions and 6 deletions

View File

@ -28,9 +28,15 @@
LEFT JOIN sys_resource sr ON ar.resource_code = sr.resource_code LEFT JOIN sys_resource sr ON ar.resource_code = sr.resource_code
WHERE WHERE
1 = 1 1 = 1
OR ag.group_pid = -1
<if test="paramCondition.groupName != null and paramCondition.groupName != ''"> <if test="paramCondition.groupName != null and paramCondition.groupName != ''">
AND ar.api_alias LIKE CONCAT('%', #{paramCondition.groupName}, '%') AND ar.api_alias LIKE CONCAT('%', #{paramCondition.groupName}, '%')
OR sr.url LIKE CONCAT('%', #{paramCondition.groupName}, '%') OR sr.url LIKE CONCAT('%', #{paramCondition.groupName}, '%')
</if> </if>
<if test="paramCondition.groupId != null">
AND ag.group_pids NOT LIKE CONCAT('%[', #{paramCondition.groupId}, ']%')
AND ag.group_id != #{paramCondition.groupId}
</if>
GROUP BY ag.group_id
</select> </select>
</mapper> </mapper>

View File

@ -183,12 +183,6 @@ public class ApiGroupServiceImpl extends ServiceImpl<ApiGroupMapper, ApiGroup> i
} }
// 查询所有分组 // 查询所有分组
LambdaQueryWrapper<ApiGroup> wrapper = new LambdaQueryWrapper<>();
if (ObjectUtil.isNotEmpty(apiGroupRequest.getGroupId())) {
wrapper.notLike(ApiGroup::getGroupPids, SymbolConstant.LEFT_SQUARE_BRACKETS + apiGroupRequest.getGroupId() + SymbolConstant.RIGHT_SQUARE_BRACKETS);
wrapper.ne(ApiGroup::getGroupId, apiGroupRequest.getGroupId());
}
List<ApiGroup> apiGroups = this.dataList(apiGroupRequest); List<ApiGroup> apiGroups = this.dataList(apiGroupRequest);
if (ObjectUtil.isNotEmpty(apiGroups)) { if (ObjectUtil.isNotEmpty(apiGroups)) {
for (ApiGroup apiGroup : apiGroups) { for (ApiGroup apiGroup : apiGroups) {