admin或获取所有部门,其他人员只能获取自己部门,作为数据字典
这个sql怎么判断
where dep_name in ('${joinarray(GETUSERDEPARTMENTS(),"','")}')
这个是获取人员自己部门的sql,外面怎么套一层$fine_username是admin判断的sql
where 1=1
${if(fine_username="admin",""," and dep_name in ('"+joinarray(GETUSERDEPARTMENTS(),"','")+"')")}
${if(fine_username='admin',"","and dep_name in ('${joinarray(GETUSERDEPARTMENTS(),"','")}'"))}
${if( or(a='admin',LEN(joinarray(GETUSERDEPARTMENTS(2),""))==0),""," and dep_name in ('"+b+"')")}
a公式:$fine_username
b公式 joinarray(GETUSERDEPARTMENTS(2),"','")
2 是第二级的意思