数据集参数不好使

select org_cd,org_name,org_level,parent_org_cd,parent_org_nm from fin_import.import_financial_budget_org 

where 1=1 

${if(len(sql("中台导数专用MYSQL8"," select  org_code from fin_import.dim_fin_fdp_data_permissions  where  1=1 and lower(user_id)='"+$fine_username+"'",1,1))==0,"and org_cd='0'",

" and (org_lv1_cd in (select org_code from fin_import.dim_fin_fdp_data_permissions  where 1=1 and lower(user_id)='"+$fine_username+"' ) or org_lv2_cd in (select org_code from fin_import.dim_fin_fdp_data_permissions  where 1=1 and lower(user_id)='"+$fine_username+"' ) or org_lv3_cd in (select org_code from fin_import.dim_fin_fdp_data_permissions  where 1=1 and lower(user_id)='"+$fine_username+"' ) or org_lv4_cd in (select org_code from fin_import.dim_fin_fdp_data_permissions  where 1=1 and lower(user_id)='"+$fine_username+"' ) or org_lv5_cd in (select org_code from fin_import.dim_fin_fdp_data_permissions  where 1=1 and lower(user_id)='"+$fine_username+"' ) or org_lv6_cd in (select org_code from fin_import.dim_fin_fdp_data_permissions  where 1=1 and lower(user_id)='"+$fine_username+"' ))")}

"+$fine_username+"换成lihong是正确的,但是换成参数就不对了,请问咋回事呢

FineReport 小鱼儿05 发布于 2024-9-18 14:13
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共2回答
最佳回答
0
用户k6280494Lv6资深互助
发布于2024-9-18 14:16

${if()}里面不能再使用$

select org_cd,org_name,org_level,parent_org_cd,parent_org_nm from fin_import.import_financial_budget_org 

where 1=1 

${if(len(sql("中台导数专用MYSQL8"," select  org_code from fin_import.dim_fin_fdp_data_permissions  where  1=1 and lower(user_id)='"+fine_username+"'",1,1))==0,"and org_cd='0'",

" and (org_lv1_cd in (select org_code from fin_import.dim_fin_fdp_data_permissions  where 1=1 and lower(user_id)='"+fine_username+"' ) or org_lv2_cd in (select org_code from fin_import.dim_fin_fdp_data_permissions  where 1=1 and lower(user_id)='"+fine_username+"' ) or org_lv3_cd in (select org_code from fin_import.dim_fin_fdp_data_permissions  where 1=1 and lower(user_id)='"+fine_username+"' ) or org_lv4_cd in (select org_code from fin_import.dim_fin_fdp_data_permissions  where 1=1 and lower(user_id)='"+fine_username+"' ) or org_lv5_cd in (select org_code from fin_import.dim_fin_fdp_data_permissions  where 1=1 and lower(user_id)='"+fine_username+"' ) or org_lv6_cd in (select org_code from fin_import.dim_fin_fdp_data_permissions  where 1=1 and lower(user_id)='"+fine_username+"' ))")}

最佳回答
0
华莉星宸Lv7资深互助
发布于2024-9-18 14:14(编辑于 2024-9-18 14:16)

$fine_username

这个参数需要登录决策系统才能获取到值

---------------

select org_cd,org_name,org_level,parent_org_cd,parent_org_nm from fin_import.import_financial_budget_org 

where 1=1 

${if(len(sql("中台导数专用MYSQL8"," select  org_code from fin_import.dim_fin_fdp_data_permissions  where  1=1 and lower(user_id)='"+fine_username+"'",1,1))==0,"and org_cd='0'",

" and (org_lv1_cd in (select org_code from fin_import.dim_fin_fdp_data_permissions  where 1=1 and lower(user_id)='"+fine_username+"' ) or org_lv2_cd in (select org_code from fin_import.dim_fin_fdp_data_permissions  where 1=1 and lower(user_id)='"+fine_username+"' ) or org_lv3_cd in (select org_code from fin_import.dim_fin_fdp_data_permissions  where 1=1 and lower(user_id)='"+fine_username+"' ) or org_lv4_cd in (select org_code from fin_import.dim_fin_fdp_data_permissions  where 1=1 and lower(user_id)='"+fine_username+"' ) or org_lv5_cd in (select org_code from fin_import.dim_fin_fdp_data_permissions  where 1=1 and lower(user_id)='"+fine_username+"' ) or org_lv6_cd in (select org_code from fin_import.dim_fin_fdp_data_permissions  where 1=1 and lower(user_id)='"+fine_username+"' ))")}

  • 3关注人数
  • 107浏览人数
  • 最后回答于:2024-9-18 14:16
    请选择关闭问题的原因
    确定 取消
    返回顶部