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


    <select id="selectUserPopularzieDiscountRecordByUidAndPid" resultType="java.lang.Integer">
        select count(1) from (select order_id from order_don_user_discount_popularize_record where user_id in
        <foreach collection="userIds" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
        and popularize_id = #{popularizeId}) opp inner join order_don o on o.id = opp.order_id where o.status not in
        ('close','noPayment')
    </select>
</mapper>