You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.5 KiB
34 lines
1.5 KiB
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="cc.hiver.mall.dao.mapper.MallOrderGoodsMapper">
|
|
|
|
<resultMap id="goodsMap" type="cc.hiver.mall.entity.MallOrderGoods">
|
|
<id column="id" property="id"/>
|
|
<result column="order_id" property="orderId"/>
|
|
<result column="product_id" property="productId"/>
|
|
<result column="product_name" property="productName"/>
|
|
<result column="product_picture" property="productPicture"/>
|
|
<result column="specs" property="specs"/>
|
|
<result column="price" property="price"/>
|
|
<result column="quantity" property="quantity"/>
|
|
</resultMap>
|
|
|
|
<!-- 按单条订单ID查询商品明细 -->
|
|
<select id="selectByOrderId" resultMap="goodsMap">
|
|
SELECT id, order_id, product_id, product_name, product_picture, specs, price, quantity
|
|
FROM mall_order_goods
|
|
WHERE order_id = #{orderId}
|
|
</select>
|
|
|
|
<!-- 按多个订单ID批量查询 -->
|
|
<select id="selectByOrderIds" resultMap="goodsMap">
|
|
SELECT id, order_id, product_id, product_name, product_picture, specs, price, quantity
|
|
FROM mall_order_goods
|
|
WHERE order_id IN
|
|
<foreach collection="orderIds" item="id" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</select>
|
|
|
|
</mapper>
|
|
|