帆软sql查询能嵌套判断吗控件是否有值吗

${if(len(BUSI_DEPT_NAME) == 0 &&len(RETAIL_CENTER_NAME) == 0 , " AND BUSI_DEPT_NAME = '股份公司' ",${if(len(BUSI_DEPT_NAME) > 0 && len(RETAIL_CENTER_NAME) == 0 ,"AND BUSI_DEPT_NAME IN ('" + BUSI_DEPT_NAME + "')",${if(len(RETAIL_CENTER_NAME) == 0 , "","AND RETAIL_CENTER_NAME IN ('" + RETAIL_CENTER_NAME + "')")})}")} 

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

里面不需要再加 ${}

image.png

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

${

if(len(BUSI_DEPT_NAME) == 0 &&len(RETAIL_CENTER_NAME) == 0 , " AND BUSI_DEPT_NAME = '股份公司' ",

if(len(BUSI_DEPT_NAME) > 0 && len(RETAIL_CENTER_NAME) == 0 ,"AND BUSI_DEPT_NAME IN ('" + BUSI_DEPT_NAME + "')",

if(len(RETAIL_CENTER_NAME) == 0 , "","AND RETAIL_CENTER_NAME IN ('" + RETAIL_CENTER_NAME + "')")))

最佳回答
0
snrtuemcLv8专家互助
发布于2022-11-17 11:30(编辑于 2022-11-17 11:32)

${if(len(BUSI_DEPT_NAME) == 0 &&len(RETAIL_CENTER_NAME) == 0 , " AND BUSI_DEPT_NAME = '股份公司' ",if(len(BUSI_DEPT_NAME) > 0 && len(RETAIL_CENTER_NAME) == 0 ,"AND BUSI_DEPT_NAME IN ('" + BUSI_DEPT_NAME + "')",if(len(RETAIL_CENTER_NAME) == 0 , "","AND RETAIL_CENTER_NAME IN ('" + RETAIL_CENTER_NAME + "')")))} 

  • 2关注人数
  • 275浏览人数
  • 最后回答于:2022-11-17 11:32
    请选择关闭问题的原因
    确定 取消
    返回顶部