|
@@ -402,7 +402,7 @@
|
|
|
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_
|
|
|
LEFT JOIN vip_group_activity vga ON vga.id_ = aum.activity_id_
|
|
|
- WHERE spo.type_ = 'DOUBLE_ELEVEN2021' AND spo.status_ = 'SUCCESS'
|
|
|
+ WHERE spo.type_ = 'SMALL_CLASS_TO_BUY' AND spo.group_type_ = 'ACTIVITY' AND spo.status_ = 'SUCCESS' AND spo.memo_ = '2021双十一活动购买'
|
|
|
AND spo.organ_id_ IN (10,11,12,13,14,19,21,23,26,28,34,1,7,9,17,20,37,40,6,3,57,58,8,15,16,4)
|
|
|
GROUP BY aum.activity_id_,aum.user_id_) c GROUP BY c.type_
|
|
|
</select>
|
|
@@ -424,7 +424,7 @@
|
|
|
</resultMap>
|
|
|
<select id="countDoubleEleven2021Statis" resultMap="DoubleEleven2021Dto">
|
|
|
SELECT SUM(expect_amount_) total_buy_amount_,COUNT(DISTINCT user_id_) total_buy_num_ FROM student_payment_order
|
|
|
- WHERE type_ = 'DOUBLE_ELEVEN2021' AND status_ = 'SUCCESS'
|
|
|
+ WHERE type_ = 'SMALL_CLASS_TO_BUY' AND group_type_ = 'ACTIVITY' AND status_ = 'SUCCESS' AND memo_ = '2021双十一活动购买'
|
|
|
AND organ_id_ IN (10,11,12,13,14,19,21,23,26,28,34,1,7,9,17,20,37,40,6,3,57,58,8,15,16,4)
|
|
|
</select>
|
|
|
<select id="countDoubleEleven2022Statis" resultMap="DoubleEleven2021Dto">
|
|
@@ -451,7 +451,7 @@
|
|
|
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_
|
|
|
LEFT JOIN vip_group_activity vga ON vga.id_ = aum.activity_id_
|
|
|
- WHERE spo.type_ = 'DOUBLE_ELEVEN2021' AND spo.status_ = 'SUCCESS'
|
|
|
+ WHERE spo.type_ = 'SMALL_CLASS_TO_BUY' AND spo.group_type_ = 'ACTIVITY' AND spo.status_ = 'SUCCESS' AND spo.memo_ = '2021双十一活动购买'
|
|
|
AND spo.organ_id_ IN
|
|
|
<foreach collection="organIdList" open="(" close=")" item="organId" separator=",">
|
|
|
#{organId}
|
|
@@ -474,7 +474,8 @@
|
|
|
<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_,o.id_ organ_id_
|
|
|
FROM organization o
|
|
|
- LEFT JOIN student_payment_order spo ON o.id_ = spo.organ_id_ AND spo.type_ = 'DOUBLE_ELEVEN2021' AND spo.status_ = 'SUCCESS'
|
|
|
+ LEFT JOIN student_payment_order spo ON o.id_ = spo.organ_id_
|
|
|
+ AND spo.type_ = 'SMALL_CLASS_TO_BUY' AND spo.group_type_ = 'ACTIVITY' AND spo.status_ = 'SUCCESS' AND spo.memo_ = '2021双十一活动购买'
|
|
|
WHERE FIND_IN_SET(o.id_,#{organId})
|
|
|
GROUP BY o.id_
|
|
|
</select>
|
|
@@ -495,14 +496,15 @@
|
|
|
<result property="orderNo" column="order_no_"/>
|
|
|
<result property="payTime" column="pay_time_"/>
|
|
|
<result property="type" column="type_"/>
|
|
|
+ <result property="organName" column="organ_name_"/>
|
|
|
</resultMap>
|
|
|
<sql id="queryDoubleEleven2021OrderDetailSql">
|
|
|
- WHERE
|
|
|
+ WHERE spo.type_ = 'SMALL_CLASS_TO_BUY' AND spo.group_type_ = 'ACTIVITY' AND spo.status_ = 'SUCCESS'
|
|
|
<if test="year == '2021'">
|
|
|
- spo.status_ = 'SUCCESS' AND spo.type_ = 'DOUBLE_ELEVEN2021' and spo.tenant_id_ = #{tenantId}
|
|
|
+ AND spo.memo_ = '2021双十一活动购买'
|
|
|
</if>
|
|
|
<if test="year == '2022'">
|
|
|
- spo.group_type_ = 'ACTIVITY' AND spo.type_ = 'SMALL_CLASS_TO_BUY' AND spo.status_ = 'SUCCESS' AND spo.memo_ = '2022双十一活动购买'
|
|
|
+ AND spo.memo_ = '2022双十一活动购买'
|
|
|
</if>
|
|
|
<if test="search != null and search != ''">
|
|
|
AND su.id_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%') OR spo.order_no_ LIKE CONCAT('%',#{search},'%')
|
|
@@ -527,13 +529,14 @@
|
|
|
</if>
|
|
|
</sql>
|
|
|
<select id="queryDoubleEleven2021OrderDetail" resultMap="DoubleEleven2021OrderDetailDto">
|
|
|
- SELECT spo.user_id_,su.username_,spo.order_no_,SUM(aum.actual_price_) amount_,spo.create_time_,spo.pay_time_,GROUP_CONCAT(vga.attribute1_) type_,
|
|
|
- CASE WHEN cto.id_ IS NULL THEN 0 ELSE 1 END give_member_
|
|
|
+ SELECT spo.user_id_,su.username_,spo.order_no_,SUM(aum.actual_price_) amount_,
|
|
|
+ spo.create_time_,spo.pay_time_,GROUP_CONCAT(vga.attribute1_) type_,o.name_ organ_name_
|
|
|
FROM student_payment_order spo
|
|
|
- LEFT JOIN activity_user_mapper aum ON spo.id_ = aum.payment_order_id_
|
|
|
- LEFT JOIN vip_group_activity vga ON vga.id_ = aum.activity_id_
|
|
|
- LEFT JOIN sys_user su ON su.id_ = spo.user_id_
|
|
|
- LEFT JOIN cloud_teacher_order cto ON cto.order_id_ = spo.id_
|
|
|
+ LEFT JOIN activity_user_mapper aum ON spo.id_ = aum.payment_order_id_
|
|
|
+ LEFT JOIN vip_group_activity vga ON vga.id_ = aum.activity_id_
|
|
|
+ LEFT JOIN sys_user su ON su.id_ = spo.user_id_
|
|
|
+ LEFT JOIN cloud_teacher_order cto ON cto.order_id_ = spo.id_
|
|
|
+ LEFT JOIN organization o ON spo.organ_id_ = o.id_
|
|
|
<include refid="queryDoubleEleven2021OrderDetailSql"/>
|
|
|
GROUP BY spo.id_
|
|
|
ORDER BY spo.pay_time_ DESC
|