//在orderMapper里:
@Results({
@Result(property = "id", column = "id"),
@Result(property = "orderTime", column = "orderTime"),
@Result(property = "total", column = "total"),
@Result(property = "user", column = "uid", javaType = User.class,
one = @One(select = "UserMapper.findUserById"))
})
@Select("select * from Order")
public List<Order> findOrderAndUser();
//在userMapper里:
@Select("select * from user where id = #{id}")
public User findUserById(Integer id);
网友评论