Home > Back-end >  Mybatis select, twice on the same table join query different records, but the return to the same rec
Mybatis select, twice on the same table join query different records, but the return to the same rec

Time:12-11

Question is like this, I need to check the record contains "starting point (origin)" and "the end" (destination) information, the two fields are mapped to the same table (location), so I'm writing the SQL with two INNER JOIN, but mybatis after running, I found the query of Java example, the two fields corresponding to the same location, rather than expected two, could you tell me how to solve this problem?

Mybatis mapper resultMap:


The select statement:
  • Related