IN (${if(GETUSERDEPARTMENTS(2)="客服部","",if(fine_role="数据人员",GETUSERDEPARTMENTS(2),"部门错误")})
WHERE 1=1
${if(GETUSERDEPARTMENTS(2)="客服部","","and REPLACE(REPLACE( c.typ_name,'YC','' ),' ','') in('"+GETUSERDEPARTMENTS(2)+"')")}
写法没问题
但是肯定会报错
in里面可以空值,会报sql错误的
=======
然后多个部门获取,分隔符是, 你要转换成 ',' 这种分隔符
写的没问题,但是如果你GETUSERDEPARTMENTS(2)="客服部",成立的话 ,sql就变成 in() 这样会报错。