数据集参数问题

select attribute3,sum(amount) from dwd_yuntu_kcjkfx 

where 1=1 

${if(p_received_date_begin = "","","and received_date >= '" + p_received_date_begin + "'")}

  ${if(p_received_date_end = "","","and received_date <= '" + p_received_date_end + "'")}

  ${if(p_received_year="","","and received_year in('"+replace(p_received_year,",","','")+"')")}

      ${if(p_received_month="","","and received_month in('"+replace(p_received_month,",","','")+"')")}

      ${if(p_received_quarter="","","and received_quarter in('"+replace(p_received_quarter,",","','")+"')")}

      ${if(p_description="","","and description in('"+replace(p_description,",","','")+"')")}

      ${if(p_responsible_department="","","and responsible_department in('"+replace(p_responsible_department,",","','")+"')")}

      ${if(p_product_name="","","and product_name in('"+replace(p_product_name",","','")+"')")}

      ${if(p_attribute3="","","and attribute3 in('"+replace(p_attribute3,",","','")+"')")}

      ${if(p_product_xl="","","and product_xl in('"+replace(p_product_xl,",","','")+"')")}

 

      ${if(p_last_name="","","and last_name in('"+replace(p_last_name,",","','")+"')")}

group by attribute3image.png

这段sql   刷新不出来参数。我把sql拿出去 这个条件一个个复制进来 一个个刷新 参数就出来了,这是什么情况???

FineReport 重庆一棵草 发布于 2023-3-24 11:41
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共2回答
最佳回答
0
Z4u3z1Lv6专家互助
发布于2023-3-24 11:44(编辑于 2023-3-24 11:46)

select attribute3,sum(amount) from dwd_yuntu_kcjkfx 

where 1=1 

${if(p_received_date_begin = "","","and received_date >= '" + p_received_date_begin + "'")}

  ${if(p_received_date_end = "","","and received_date <= '" + p_received_date_end + "'")}

  ${if(p_received_year="","","and received_year in('"+replace(p_received_year,",","','")+"')")}

      ${if(p_received_month="","","and received_month in('"+replace(p_received_month,",","','")+"')")}

      ${if(p_received_quarter="","","and received_quarter in('"+replace(p_received_quarter,",","','")+"')")}

      ${if(p_description="","","and description in('"+replace(p_description,",","','")+"')")}

--

${if(p_responsible_department="","","and responsible_department in('"+replace(p_responsible_department,",","','")+"')")}

      ${if(p_product_name="","","and product_name in('"+replace(p_product_name,",","','")+"')")}

      ${if(p_attribute3="","","and attribute3 in('"+replace(p_attribute3,",","','")+"')")}

${if(p_product_xl="","","and product_xl in('"+replace(p_product_xl,",","','")+"')")}

 

      ${if(p_last_name="","","and last_name in('"+replace(p_last_name,",","','")+"')")}

            

group by attribute3

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

问题定位:

image.png

最佳回答
0
用户k6280494Lv6资深互助
发布于2023-3-24 11:42(编辑于 2023-3-24 11:46)

好多,建议注释掉一些条件,一个一个测试

改一下这个 in ('"+SUBSTITUTE(p_last_name,",","','")+"')

  • 重庆一棵草 重庆一棵草(提问者) 我前面一个把有问题的这个漏了 我以为测试完了·~~
    2023-03-24 11:53 
  • 用户k6280494 用户k6280494 回复 重庆一棵草(提问者) 嗯,这种一般都是格式错误,就是难得找
    2023-03-24 11:55 
  • 2关注人数
  • 236浏览人数
  • 最后回答于:2023-3-24 11:46
    请选择关闭问题的原因
    确定 取消
    返回顶部