|
@@ -336,6 +336,7 @@
|
|
|
<result property="buyNum" column="buy_num_"/>
|
|
|
<result property="buyAmount" column="buy_amount_"/>
|
|
|
<result property="type" column="type_"/>
|
|
|
+ <result property="organId" column="organ_id_"/>
|
|
|
</resultMap>
|
|
|
<select id="countActivityStatis" resultMap="DoubleEleven2021ActivityDto">
|
|
|
SELECT SUM(aum.actual_price_) buy_amount_,COUNT(DISTINCT aum.user_id_) buy_num_,
|
|
@@ -349,6 +350,8 @@
|
|
|
<resultMap id="DoubleEleven2021Dto" type="com.ym.mec.biz.dal.dto.DoubleEleven2021Dto">
|
|
|
<result property="totalBuyAmount" column="total_buy_amount_"/>
|
|
|
<result property="totalBuyNum" column="total_buy_num_"/>
|
|
|
+ <result property="organName" column="organ_name_"/>
|
|
|
+ <result property="organId" column="organ_id_"/>
|
|
|
</resultMap>
|
|
|
<select id="countDoubleEleven2021Statis" resultMap="DoubleEleven2021Dto">
|
|
|
SELECT SUM(expect_amount_) total_buy_amount_,COUNT(DISTINCT user_id_) total_buy_num_ FROM student_payment_order
|
|
@@ -359,4 +362,33 @@
|
|
|
SELECT COUNT(DISTINCT student_id_) FROM cloud_teacher_order WHERE remark_ = '双十一活动赠送会员'
|
|
|
AND organ_id_ NOT IN (36,38,39,41,42,43,44,45,46,47,48,49,50,52,54,55,56,2,27,22,24)
|
|
|
</select>
|
|
|
+ <select id="countOrganGiveMemberNum" resultType="java.lang.Integer">
|
|
|
+ SELECT organ_id_ 'key',COUNT(DISTINCT student_id_) 'value' FROM cloud_teacher_order WHERE remark_ = '双十一活动赠送会员'
|
|
|
+ AND organ_id_ IN
|
|
|
+ <foreach collection="organIdList" open="(" close=")" item="organId" separator=",">
|
|
|
+ #{organId}
|
|
|
+ </foreach>
|
|
|
+ GROUP BY organ_id_
|
|
|
+ </select>
|
|
|
+ <select id="countOrganActivityStatis" resultMap="DoubleEleven2021ActivityDto">
|
|
|
+ SELECT SUM(aum.actual_price_) buy_amount_,COUNT(DISTINCT aum.user_id_) buy_num_,
|
|
|
+ CASE WHEN aum.activity_id_ = 215 THEN 2 WHEN aum.activity_id_ = 216 THEN 1
|
|
|
+ WHEN aum.activity_id_ = 217 THEN 4 WHEN aum.activity_id_ = 218 THEN 3 ELSE 5 END type_,spo.organ_id_
|
|
|
+ FROM student_payment_order spo
|
|
|
+ LEFT JOIN activity_user_mapper aum ON spo.id_ = aum.payment_order_id_ AND spo.user_id_ = aum.user_id_
|
|
|
+ WHERE spo.type_ = 'DOUBLE_ELEVEN2021' AND spo.status_ = 'SUCCESS'
|
|
|
+ AND spo.organ_id_ IN
|
|
|
+ <foreach collection="organIdList" open="(" close=")" item="organId" separator=",">
|
|
|
+ #{organId}
|
|
|
+ </foreach>
|
|
|
+ GROUP BY spo.organ_id_,aum.activity_id_,aum.user_id_
|
|
|
+ </select>
|
|
|
+ <select id="countOrganDoubleEleven2021Statis" resultMap="DoubleEleven2021Dto">
|
|
|
+ SELECT SUM(spo.expect_amount_) total_buy_amount_,COUNT(DISTINCT spo.user_id_) total_buy_num_,o.name_ organ_name_,spo.organ_id_
|
|
|
+ FROM student_payment_order spo
|
|
|
+ LEFT JOIN organization o ON o.id_ = spo.organ_id_
|
|
|
+ WHERE spo.type_ = 'DOUBLE_ELEVEN2021' AND spo.status_ = 'SUCCESS'
|
|
|
+ AND spo.organ_id_ NOT IN (36,38,39,41,42,43,44,45,46,47,48,49,50,52,54,55,56,2,27,22,24)
|
|
|
+ GROUP BY spo.organ_id_
|
|
|
+ </select>
|
|
|
</mapper>
|