/**
* OrderMapper接口
* */
public interface OrderMapper {
/**
* 查询所有订单
* @return 订单对象集合
* */
@Select(" select Oid,Uname,Odate,Ostate from OrderInfoa,UserInfo where Ostate='未发货' and OrderInfoa.Uid=UserInfo.Uid group by Oid ")
List<PageData> findAll();
}
比如上面,我是想多表查询需要的字段然后想返回一个PageData,这个类是我写好的,有map属性的
黄舟2017-04-18 10:51:37
Use @Results annotation as type mapping on @Select annotation
@Results(value = {
@Result(id = true, property = "id", column = "id", javaType = Long.class, jdbcType = JdbcType.BIGINT),
@Result(property = "title", column = "title", javaType = String.class, jdbcType = JdbcType.VARCHAR)
...
})
This is using annotations, you can also use the xml resultMap tag to configure type mapping
For details, please see http://www.mybatis.org/mybati...