SELECT distinct b.name,a.c_id FROM "TM_TREE" a left join tm_inventory b on a.c_id = b.code where a.p_id ='C00001' and a.C_TYPE ='自主经营体' and a.AMB= '自主经营体' and a.c_id in ( if(${loginuser}=admin,"SELECT distinct a.c_id FROM TM_TREE a left join tm_inventory b on a.c_id = b.code where a.p_id ='C00001' and a.C_TYPE ='自主经营体' and a.AMB= '自主经营体'", "select a.inventory_id from tm_priv_inventory a left join tm_user b on a.user_id = b.uuid where b.account ='"+${loginuser}+"'" )) order by a.c_id 这里的if判断,运行时老显示缺失有括号。可以看起来不知道哪里错了 |