我们在做权限的设置,主要通过传用户id的参数,筛选出公司 a为主表:含用户id,公司名称,b为权限对应表:含字段用户id,公司名称, 实现逻辑是sql写 select xxxx from a where 公司名称 in (select 公司名称 from b where 用户id={传参}) 问题:由于提供的权限表中用户有查看全部公司的权限,但公司名称value值为全部,,sql 无法处理
select x from a where 1=1 ${if(sql("数据连接名","select 公司名称 from b where 用户id='"+传参+"'",1,1)='全部',""," and 公司名称 in (select 公司名称 from b where 用户id='"+传参+"')")}