myBatis 一对多 一对一 查询

<result column="goods_id" property="goodsId" jdbcType="INTEGER" />

<id column="id" property="id" jdbcType="INTEGER" />

<association property="goodsModel" column="goods_id" javaType="com.model.GoodsModel"

select="com.web.dao.GoodsModelMapper.selectByPrimaryKey" />

<collection property="goodsPictureList" column="goods_id" ofType="com.web.model.EGoodsPictureModel"

select="com.web.dao.EGoodsPictureModelMapper.selectByGoodsId" />

猜你喜欢

转载自chenhn2008-sohu-com.iteye.com/blog/2294574