if判断如何实现如下对应逻辑

需求是如果登录者为21981和14433,那么proplist多选下拉框就算没选中点击查询也是默认查询电商客户,如果不是者两个账号,那么proplist多选下拉框就算没选中点击查询也是查询所有,现在这样有问题该如何解决 如下Sql

"+if(len(propList)=0 &&$fr_username ="21981" && $fr_username ="14433",""," and cusattribute in ('"+replace(propList,",","','")+"')")+"

"+if(len(propList)=0 &&($fr_username ="21981" || $fr_username ="14433")," and cusattribute='电商客户'"," and cusattribute in ('"+replace(propList,",","','")+"')")+"

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

if(and(or($fr_username ="21981",$fr_username ="14433"),len(propList)=0)," and cusattribute='电商客户'",if(len(propList)=0,""," and cusattribute in ('"+replace(propList,",","','")+"')"))

最佳回答
1
RiveryLv5中级互助
发布于2022-9-1 13:42

if(or($fine_username="21981",$fine_username="14433"),

if(len(proplist)==0,"and cusattribute='电商客户'","and cusattribute in ('"+replace(propList,",","','")+"')"),

"and cusattribute in ('"+replace(propList,",","','")+"')")

最佳回答
0
snrtuemcLv8专家互助
发布于2022-9-1 13:36

如果外面已经有${}了

fr_username 全面的$去掉

然后需要决策系统才可以生效,确保你的登录用户,登录名是21981这个数字

==========

然后可以直接输入参数,查看sql运行效果

image.png

  • 3关注人数
  • 345浏览人数
  • 最后回答于:2022-9-1 13:42
    请选择关闭问题的原因
    确定 取消
    返回顶部