多个下拉复选框实现数据筛选

image.png

我现在是但选存货编码可以实现筛选效果,后续三个复选框就没作用了,必须四个全选上之后才会再次筛选数据,而且如果名称、分类、ID三个复选框独自作为筛选条件会没有作用

image.png

FineReport 人已经晕了 发布于 2023-3-20 11:56
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共4回答
最佳回答
0
人已经晕了Lv3见习互助
发布于2023-3-20 16:30

image.png

最佳回答
0
Z4u3z1Lv6专家互助
发布于2023-3-20 11:57

你是SQL咋写的?控件名和参数名对应上 了吗

最佳回答
0
1592Lv6高级互助
发布于2023-3-20 12:19(编辑于 2023-3-20 13:51)

分开写呢

SELECT * FROM TABLE

WHERE 1=1  

${if(len(存货编码) == 0,"","and 字段 in ('" + 存货编码+ "')")}

${if(len(产品名称) == 0,"","and 字段1 in ('" + 产品名称 + "')")}

${if(len(存货分类) == 0,"","and 字段2 in ('" + 存货分类 + "')")}

${if(len(lot_ID) == 0,"","and 字段3 in ('" + lot_ID + "')")}

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

MySQL数据库中文乱码-https://help.fanruan.com/finereport10.0/doc-view-1127.html

image.png

  • 人已经晕了 人已经晕了(提问者) 我用的就是这个
    2023-03-20 13:02 
  • 人已经晕了 人已经晕了(提问者) where 1=1 ${if(len(product_code) == 0,\"\",\"and asps.product_code in (\'\" + product_code + \"\')\")} ${if(len(product_name) == 0,\"\",\"and asps.product_model in (\'\" + product_name + \"\')\"} ${if(len(cunhuo_fenlei) == 0,\"\",\"and asps.product_type in (\'\" + cunhuo_fenlei+ \"\')\"} ${if(len(lot_ID) == 0,\"\",\"and asps.lot_id in (\'\" + lot_ID+ \"\')\")}
    2023-03-20 13:05 
  • 1592 1592 回复 人已经晕了(提问者) mysql?
    2023-03-20 13:28 
  • 人已经晕了 人已经晕了(提问者) 回复 1592 对,就是mysql
    2023-03-20 13:46 
  • 1592 1592 回复 人已经晕了(提问者) 语句应该没问题,按文档设置下看看
    2023-03-20 13:51 
最佳回答
0
入海Lv6见习互助
发布于2023-3-20 14:16

在数据集填写参数,预览下执行的SQL

1679292934182.jpg

  • 2关注人数
  • 508浏览人数
  • 最后回答于:2023-3-20 16:30
    请选择关闭问题的原因
    确定 取消
    返回顶部