我有如下的sql(MySQL):
select a.code as 'a.code', b.code as 'b.code', c.code as 'c.code' from a, b, c where a.code=b.code and a.code = c.code;
查询结果如下:
--------------------------------------------
a.code | b.code | c.code
------------------------------------------
N001 | N001 | N001
N002 | N002 | N002
N003 | N003 | N003
-------------------------------------------
目前有一个pojo:
class Pojo {
private A a;
private B b;
private C c;
// getter/setter
}
class A {private String code;}
class B {private String code;}
class C {private String code;}
如何查询结果为List<Pojo> list;
(mybatis能自动映射)
2 回复
添加回复
请先登陆