你可以按你这个来建立角色。然后把对应的人放进这些角色进去。再结合帆软自带的参数$fine_role就可以把每人登陆的角色获取到。然后传入就可以了。。。
假如你建立了一个角色名称叫:河北公司 然后你放里面加了 人员 张三丰,李明明 。。这两人登陆时$fine_role参数会自动获取角色名称河北公司,,,你直接在数据库中把这个获取的角色名称传入就行了
select * from 你的表
where 1=1
and 部门名称='${$fine_role}'
假如有多个角色:

用函数结合一样可以只取到这人的角色对应的公司,然后把它设置成模板参数。。。你在sql里面直接让它等于这个模板参数就行了


权限的qx参数写如下公式
SUBSTITUTE(SUBSTITUTE(GREPARRAY(SPLIT($fine_role,","), FIND("财务",item)>0),"财务_",""),",","','")
sql中改成这样:
${if(len(qx) = 0,"and 1=2","and g.name in('" + qx + "')")}