【问题标题】:Filter Condition in Business Object BO业务对象 BO 中的过滤条件
【发布时间】:2017-11-10 02:16:04
【问题描述】:

我对 BO 中的过滤条件有疑问。 想象一下我有这个数据库

ID | DESC

0 |无

1 |公司

2 |全部

在 BO 中,我有一个过滤器,询问您想在哪里找到对象和 2 个选项:

“公司”或“全部”。

如果我选择“全部”,那么我应该拥有“ID”为 0、1、2 的所有数据,如果我选择“公司”,则只有“ID”为 1 的数据。

所以我做了这样的事情:

TABLE_NAME.ID <= (CASE WHEN @Prompt('where do you want to find the objects','A',{'Company', 'All'},mono,constrained,not_persistent,{'Company'}) = 'Company' THEN 1 ELSE 2 END)

当我选择“全部”时,这个过滤器没问题,因为我的所有“ID”都小于 2,即 0,1,2。

但是当我的选项是公司时它不起作用,因为它还显示“ID”为0的数据。

我应该有一些与“=”结合“

【问题讨论】:

    标签: database filter business-objects


    【解决方案1】:

    如果真的就这么简单,下面的就行了:

    TABLE_NAME.ID = 
        (CASE @Prompt('where do you want to find the objects',
                'A',
                {'Company', 'All'},
                mono,
                constrained,
                not_persistent,{'Company'}
                ) 
              WHEN 'Company' 
              THEN 1  
              WHEN 'All' 
              THEN TABLE_NAME.ID
              END)
    

    【讨论】:

    • 非常感谢。我不知道我可以在 when 条件下这样称呼全名
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-05
    • 2019-09-15
    • 1970-01-01
    • 1970-01-01
    • 2022-11-30
    • 2021-10-04
    相关资源
    最近更新 更多