报错信息 SELECT * FROM( SELECT province , city , cus_code , cus_name , build_time , case when cus_type like '%销售商%' then '代理商' else cus_type end AS custype , REPLACE(case when position('/' in dept_info) > 3 then split_part(dept_info , '/',5) else dept_info end ,'T','') as dept_info FROM dw.tbl_dw_h3yun_sunrain_cus WHERE 1=1 AND cus_type in ('运营商' , '代理商' , '工程商') AND cus_status in ('正常' , '整改中') AND COALESCE(toc_display_flag ,'') != '否' AND length(cus_code) = 10 )A WHERE dept_info not like '%一线%' AND length(dept_info) > 0 and dept_info in ( SELECT distinct SUBSTRING(dpt_name,2)as dpt_name FROM dw.tbl_dw_dingtalk_user2 WHERE dpt_id in (select dpt_id FROM dw.tbl_dw_dingtalk_user2 where 1=1 ${if((fine_username)='101700075',"","AND dpt_id in (select dpt_id FROM dw.tbl_dw_dingtalk_user2 where user_id = '${fine_username}') or parent_dpt_id in (select dpt_id FROM dw.tbl_dw_dingtalk_user2 where user_jobnum = '${fine_username}') ")} 问题应该就在这里 用(fine_username)='100500470',(fine_username)='101700075'这两个工号没有问题,但用其他人的工号报错 |