<?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.GoodsWholesaleUserSkuPayRecordMapper">

    <select id="selectUserHasPaySkuDifferRecord"
            resultType="com.cyksj.model.entity.GoodsWholesaleUserSkuPayRecord">
        select gor.* from (select id from goods_wholesale_order_don where status not in ('close','noPayment','refund')
        and
        user_id in
        <foreach collection="userIds" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
        and sku_id = #{skuId}) o inner join goods_wholesale_user_sku_pay_record gor on gor.order_id = o.id
    </select>
</mapper>