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


    <select id="selectRenewOrderData" resultType="java.util.Map">
        select COUNT(if(is_follow = 1, 1, NULL)) as renewFollowOrders, COUNT(*) as renewOrders
        from groups_relation_expiry_record
        where is_re_buy = 1
        and re_buy_time between #{startTime} and #{endTime}
        <if test="followId != null">
            and follow_id = #{followId}
        </if>
    </select>
</mapper>