hzero后台系统管理角色管理树形查询数据库报错

Error querying database. Cause: java.sql.SQLException: Operand should contain 1 column(s)

The error may exist in URL [jar:file:/choerodon/choerodon-iam.jar!/BOOT-INF/lib/hzero-iam-1.5.3.RELEASE.jar!/mapper/RoleMapper.xml]

The error may involve defaultParameterMap

The error occurred while setting parameters

SQL: select count(0) from (select ir.id, ir.code as code, irt.name as name, ir.description, ir.fd_level, ir.h_tenant_id, ir.h_parent_role_id, ir.h_inherit_role_id, ir.is_enabled, case when ir.is_built_in = 1 then ‘default’ else ‘custom’ end as role_source, ir.h_level_path, ir.object_version_number, ir.created_by, ht.tenant_num, httl.tenant_name, irit.name as inherited_role_name, htti.tenant_name as inherited_role_tenant_name, irpt.name as parent_role_name, http.tenant_name as parent_role_tenant_name, case when ( ir.code in (?, ?) or exists ( select 1 from iam_menu ps join iam_role_permission irp on (irp.permission_id = ps.id and irp.type = ‘PS’) where irp.role_id = ir.id and (irp.h_create_flag = ‘Y’ or irp.h_inherit_flag = ‘Y’) and ps.type = ‘ps’ and ps.h_enabled_flag = 1 and ps.code like ? ) ) then 1 else 0 end AS admin_flag, case when ( ir.code in (?, ?) or exists ( select 1 from iam_menu ps join iam_role_permission irp on (irp.permission_id = ps.id and irp.type = ‘PS’) where irp.role_id = ir.id and (irp.h_create_flag = ‘Y’ or irp.h_inherit_flag = ‘Y’) and ps.type = ‘ps’ and ps.h_enabled_flag = 1 and ps.code like ? ) ) then ( select count(*) from iam_role sub join iam_role_tl subt on sub.id = subt.id and subt.lang =? join hpfm_tenant ht on sub.h_tenant_id = ht.tenant_id where sub.fd_level = ir.fd_level and ( sub.h_level_path like concat(ir.h_level_path, ‘|%’) ) and sub.is_enabled = ? ) else 0 end AS children_num, opp.enable_role_inherit, opp.enable_role_allocate, case when opp.enable_role_permission = 1 then 1 when opp.enable_role_permission = 0 and ( ir.code in (?, ?) or exists ( select 1 from hiam_label_rel hlr join iam_label il on (hlr.label_id = il.id) where hlr.data_id = ir.id and hlr.data_type = ‘ROLE’ and hlr.assign_type = ‘A’ and il.name = ? ) ) then 1 else 0 end as enable_role_permission from iam_role ir join iam_role_tl irt on (ir.id = irt.id and irt.lang = ?) join hpfm_tenant ht on ht.tenant_id = ir.h_tenant_id left join hpfm_tenant_tl httl ON ht.tenant_id = httl.tenant_id AND httl.lang = ? left join iam_role iri on iri.id = ir.h_inherit_role_id left join iam_role_tl irit on (irit.id = iri.id and irit.lang = ?) left join hpfm_tenant_tl htti ON htti.tenant_id = iri.h_tenant_id AND htti.lang = ? left join iam_role irp on irp.id = ir.h_parent_role_id left join iam_role_tl irpt on (irpt.id = irp.id and irpt.lang = ?) left join hpfm_tenant_tl http ON http.tenant_id = irp.h_tenant_id AND http.lang = ? left join oauth_password_policy opp on (opp.organization_id = ir.h_tenant_id) where ir.is_enabled = 1 and ( ir.id in ( select imr.role_id from iam_member_role imr join iam_role ir2 on (imr.role_id = ir2.id) where imr.member_id = ? and imr.member_type = ‘user’ and (imr.start_date_active is null or imr.start_date_active <= ?) and (imr.end_date_active is null or imr.end_date_active >= ?) ) or ir.id in ( ( ? , ? ) ) ) having ( children_num > 0 or ( ir.is_enabled = ? and 1=1 ) ) order by ir.h_tenant_id, ir.h_level_path) tmp_count

Cause: java.sql.SQLException: Operand should contain 1 column(s)

; bad SQL grammar []; nested exception is java.sql.SQLException: Operand should contain 1 column(s)

这个已经修了,iam升级到最新版本

那个版本 0.24.4?

哦应该不是同一个问题,你这个已经是 hzero-iam-1.5.3.RELEASE;这个问题我们反馈下

这个确实是个Bug,只有用户为超级用户时才会有这个问题。后续iam会修复这个问题,然后猪齿鱼更新一下iam即可。