我有这个数据库结构:
- Announcement table
- Equipement table
两个表之间存在多对多关系,当我执行学说查询以搜索具有特定设备的一些公告时,我得到 0 条记录
这是我的 DQL:
SELECT a FROM Entity\Announcement a JOIN LEFT JOIN a.comfortEquipements aces
and aces.identifier = 1"
1:是所需设备的标识符,在这个阶段一切正常,但是当我添加一些其他标准时,它返回 0 条记录
例子:
SELECT a FROM Entity\Announcement a JOIN LEFT JOIN a.comfortEquipements aces
and aces.identifier = 1 and aces.identifier = 2"