|
水星人 发表于 2015-1-20 17:54
我大概看了下,因为Contact这个字段比较特殊,其实是一个外键,再加上OQL的限制比较多,所以如果你需要无 ...
我写了一个sql语句,通过这个sql语句可以查找此工单号中contact里面人员和团队里面人员,如下:
select * from person as p left join lnkpersontoteam as pt on pt.person_id = p.id right join lnkcontacttoticket as ct on (ct.contact_id = pt.team_id or ct.contact_id = p.id) where ct.ticket_id = 67;
可是我根据此sql语句转换成oql语句,结果查询的时候就一直有问题,不知道我转换的oql语句对不对,或者是否支持这么转换,还麻烦水星人帮忙指点一下,oql语句如下:
SELECT Person AS p LEFT JOIN lnkPersonToTeam AS pt ON pt.person_id = p.id RIGHT JOIN lnkContactToTicket AS ct ON (ct.contact_id = pt.team_id OR ct.contact_id = p.id) WHERE ct.ticket_it = :this->id |
|