请问怎么通过是否配置角色来控制 sql查询条件, 请问我的语句该怎么调 -- 有配置角色 看对应团队数据 ${if(len(fine_role) == 0," and exists (select 1 from dw_crm.dws_crm_finereport_role t1 join (select distinct t.vc_fundcode, t.vc_cust_mngrid, t.vc_objeno, t.vc_effectivedate as vc_bgndate, t.vc_enddate, t1.vc_ori_dept_crm as c_nodecode from dw.dw_empl_cust_brok_rela t join dw.dw_empl_main_dept_crm t1 on (t.vc_cust_mngrid = t1.vc_emplno_crm and t.vc_effectivedate <= t1.vc_enddate and t.vc_enddate >= t1.vc_bgndate) where t.vc_audit_status = '0' -- 审核通过 and t.vc_obje_type = '1' -- 客户-- and t.vc_cust_mngrid = (select distinct vc_emplid_crm from dw.dw_empl_base_info_crm where vc_email = '${p_email}') ) t2 on (t1.fr_role_name in ('${REPLACE(fine_role,",","','")}') and t2.c_nodecode like t1.c_nodevalue||'%' ) where t2.vc_fundcode = a1.vc_fundcode and t2.vc_objeno = a1.vc_custno and a1.vc_cdate >= t2.vc_bgndate and a1.vc_cdate <= t2.vc_enddate ) "," -- 无配置角色-看自己的数据 and exists ( select 1 from (select distinct t.vc_fundcode, t.vc_cust_mngrid, t.vc_objeno, t.vc_effectivedate as vc_bgndate, t.vc_enddate, t1.vc_ori_dept_crm as c_nodecode from dw.dw_empl_cust_brok_rela t join dw.dw_empl_main_dept_crm t1 on (t.vc_cust_mngrid = t1.vc_emplno_crm and t.vc_effectivedate <= t1.vc_enddate and t.vc_enddate >= t1.vc_bgndate) where t.vc_audit_status = '0' -- 审核通过 and t.vc_obje_type = '1' -- 客户 and t.vc_cust_mngrid = (select distinct vc_emplid_crm from dw.dw_empl_base_info_crm where vc_email = '${p_email}') ) t2 where t2.vc_fundcode = a1.vc_fundcode and t2.vc_objeno = a1.vc_custno and a1.vc_cdate >= t2.vc_bgndate and a1.vc_cdate <= t2.vc_enddate ) " )}