<?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.cyksj.mapper.GoodsWholesaleOrderDonMapper">


    <select id="getUserWholesaleNumByUserIds" resultType="java.lang.Integer">
        select ifnull(sum(num),0) from goods_wholesale_order_don where status not in ('close','noPayment','refund') and user_id in
        <foreach collection="list" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
        <if test="skuId != null">
            and sku_id = #{skuId}
        </if>
    </select>
</mapper>