概述
SELECT * FROM goods_info i,user_order o WHERE i.goods_id = o.goods_id
<resultMap id="getAllOrder" type="com.xjw.bean.UserOrder">
<id column="order_id" property="orderId" jdbcType="INTEGER" />
<result column="goods_id" property="goodsId" jdbcType="INTEGER" />
<result column="order_count" property="orderCount" jdbcType="INTEGER" />
<result column="order_price" property="orderPrice" jdbcType="REAL" />
<result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
<association property="goodsInfo" javaType="com.xjw.bean.GoodsInfo">
<id column="goods_id" property="goodsId" jdbcType="INTEGER" />
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" />
<result column="goods_desc" property="goodsDesc" jdbcType="VARCHAR" />
<result column="goods_price" property="goodsPrice" jdbcType="REAL" />
<result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
</association>
</resultMap>
转载于:https://www.cnblogs.com/wangchao422/p/9608771.html
最后
以上就是飘逸冬日为你收集整理的Mybatis两表联合查询的全部内容,希望文章能够帮你解决Mybatis两表联合查询所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复