select * from yy_power where 1=1 and xm_fczt='0'${if(user("defaultGroupName")=="深圳总部",if(len(gsmc)==0,""," and c_gsmc in ("+CONCATENATE("'",replace(gsmc,",","','"),"'")+")"),if(js=='1'," and c_gsmc in ("+CONCATENATE("'",replace(gsmc,",","','"),"'")+"),if(js=='2'," and c_gsmc in ("+CONCATENATE("'",replace(gsmc,",","','"),"'")+") and xm_gs in("+CONCATENATE("'",replace(city,",","','"),"'")+"),if(js=='3'," and c_gsmc in ("+CONCATENATE("'",replace(gsmc,",","','"),"'")+") and c_fzr='"+user()+"'"))))}order by c_gsmc,xh1我想要是实现的逻辑:当user("defaultGroupName")==“深圳总部”,就查询出来所有的数据,如果控件(gsmc)==0,查询出所有的数据,否则c_gsmc=控件(gsmc),当js=1的时候,控件c_gsmc=gsmc,当JS=2,c_gsmc=控件gsmc且xm_gs=city,如果js=3,c_gsmc=控件gsmc且c_user=系统user