<?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="com.yami.shop.delivery.comment.dao.DeliveryOrderItemMapper">

  <resultMap id="deliveryOrderItemMap" type="com.yami.shop.delivery.comment.model.DeliveryOrderItem">
    <id column="id" property="id" />
    <result column="order_delivery_id" property="orderDeliveryId"/>
    <result column="order_item_id" property="orderItemId"/>
    <result column="prod_count" property="prodCount"/>
  </resultMap>
  <select id="listItemNums" resultType="com.yami.shop.delivery.comment.model.DeliveryOrderItem">
    SELECT order_item_id,SUM(prod_count) as prod_count FROM `tz_delivery_order_item`
    WHERE order_item_id IN
    <foreach collection="orderItems" item="orderItem" open="(" close=")" separator=",">
      #{orderItem.orderItemId}
    </foreach>
    GROUP BY order_item_id
  </select>
</mapper>
