Anylogic Java queryDSL错误的结果和()

发布于 2025-02-13 23:03:16 字数 800 浏览 0 评论 0 原文

我在任何logic模型中都有数据库 c2d_selfpickup

//i.sstatic.net/lczp5.png“ alt =”输入图像描述这里“>

我必须通过 scid pvzid 使用querydsl:

List <Double> c2dlmList = selectFrom(c2d_selfpickup)
                            .where(c2d_selfpickup.sc_id.goe(SCid)
                            .and( c2d_selfpickup.pvz_id.goe(PVZid) ))
                            .list(c2d_selfpickup.c2d_lm);

如果我选择下一个对:

int SCid = 256151;
int PVZid = 547307;

我希望查询返回 c2dlmlist 带有一个值 8.0 (行号8),但它返回7个值:

[2.0, 3.0, 4.0, 5.0, 6.0, 8.0, 10.0]

我做错了什么?

多谢。

I have the database c2d_selfpickup in the Anylogic model:

enter image description here

I have to find the c2d_lm value by SCid and PVZid using QueryDSL:

List <Double> c2dlmList = selectFrom(c2d_selfpickup)
                            .where(c2d_selfpickup.sc_id.goe(SCid)
                            .and( c2d_selfpickup.pvz_id.goe(PVZid) ))
                            .list(c2d_selfpickup.c2d_lm);

If I choose the next pair:

int SCid = 256151;
int PVZid = 547307;

I expect that the query returns c2dlmList with one value 8.0 (the row number 8), but it returns 7 values:

[2.0, 3.0, 4.0, 5.0, 6.0, 8.0, 10.0]

What I do wrong?

Thanks a lot.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

咽泪装欢 2025-02-20 23:03:16

结果实际上是正确的。查询考虑数据库中的所有条目,因此它将返回所有行,其中 sc_id&gt; = 256,151 and pvz_id&gt; = 547,307 (goe = goe =更大或相等)。

如果您只想获得与这两个条件完全匹配的行,则可能需要使用 eq()而不是 goe()

The result is actually correct. The query considers all entries in the database, so it will return all rows where sc_id >= 256,151 and pvz_id >= 547,307 (goe = greater or equal).

In case you only want to get the row that exactly matches both conditions, you may want to use eq() instead of goe().

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文