oracle里面用帆软的参数没用求大哥帮我改下

${if(time="","","and 检验日期>= to_date('"+time+"','YYYY-MM-DD')"} 

${if(timeE="","","and 检验日期< to_date('"+timeE+"','YYYY-MM-DD')+1"} 

${if(报检单="全部","","and 报检单号='"+报检单+"'")} 

${if(订单号="","","and PO_NUMBER='"+订单号+"'")} 

${if(供应商="","","and 供应商='"+供应商简称+"'")} 

FineReport callie 发布于 2022-12-1 20:00
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共4回答
最佳回答
0
weibwLv7高级互助
发布于2022-12-1 20:03(编辑于 2022-12-1 20:03)

前面两个参数的if语句缺了后面的括号

${if(time="","","and 检验日期>= to_date('"+time+"','YYYY-MM-DD')")} 

${if(timeE="","","and 检验日期< to_date('"+timeE+"','YYYY-MM-DD')+1")} 

${if(报检单="全部","","and 报检单号='"+报检单+"'")} 

${if(订单号="","","and PO_NUMBER='"+订单号+"'")} 

${if(供应商="","","and 供应商='"+供应商简称+"'")} 

最佳回答
1
CD20160914Lv8专家互助
发布于2022-12-1 20:03

where 1=1

${if(len(start_time)=0,"","and 检验日期>=to_date('"+start_time+"','yyyy-mm-dd')")}

${if(len(end_time)=0,"","and 检验日期<to_date('"+end_time+"','yyyy-mm-dd')+1")}

${if(报检单="全部","","and 报检单号='"+报检单+"'")} 

${if(订单号="","","and PO_NUMBER='"+订单号+"'")} 

${if(供应商="","","and 供应商='"+供应商简称+"'")} 

最佳回答
1
用户k6280494Lv6资深互助
发布于2022-12-2 08:53

where 1=1

${if(isnull(time),"","and 检验日期 >= to_date('"+time+"','YYYY-MM-DD')"} 

${if(isnull(timeE),"","and 检验日期< to_date('"+timeE+"','YYYY-MM-DD')+1"} 

${if(报检单="全部","","and 报检单号='"+报检单+"'")} 

${if(isnull(订单号),"","and PO_NUMBER='"+订单号+"'")} 

${if(isnull(供应商),"","and 供应商='"+供应商简称+"'")} 

最佳回答
0
开心做事Lv2见习互助
发布于2022-12-1 20:15

跟踪下SQL语句,你就知道错误在哪里

  • 4关注人数
  • 314浏览人数
  • 最后回答于:2022-12-2 08:53
    请选择关闭问题的原因
    确定 取消
    返回顶部