<?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.liquidnet.service.sweet.mapper.SweetIntegralActivityPrizeMapper">

    <select id="sureTotalPrizeNum" resultType="java.lang.Integer">
        select ifnull(SUM(prize_num), 0)
        from sweet_integral_activity_prize
        <where>
            <if test="integralActivityId != null  and integralActivityId != ''">
                and integral_activity_id = #{integralActivityId}
            </if>
            and prize_type in (3, 4, 5)
        </where>
    </select>
    <select id="otherTotalPrizeNum" resultType="java.lang.Integer">
        select ifnull(SUM(prize_num), 0)
        from sweet_integral_activity_prize
        <where>
            <if test="integralActivityId != null  and integralActivityId != ''">
                and integral_activity_id = #{integralActivityId}
            </if>
            and prize_type in (1, 2)
        </where>
    </select>
</mapper>
