|
@@ -1281,27 +1281,36 @@
|
|
|
|
|
|
<select id="saleStaticsByOrgId" resultType="com.ym.mec.biz.dal.wrapper.Double11StaticWrapper$SaleAmountAndUser">
|
|
|
SELECT
|
|
|
- organ_id_ AS organId
|
|
|
- , SUM(actual_amount_) AS 'actualAmount'
|
|
|
- , SUM(balance_payment_amount_) AS 'balancePaymentAmount'
|
|
|
- , COUNT(distinct user_id_) AS 'userPurchaseNumber'
|
|
|
- FROM student_payment_order
|
|
|
+ t.organ_id_ AS organId
|
|
|
+ , SUM(t.actual_amount_) AS 'actualAmount'
|
|
|
+ , SUM(t.balance_payment_amount_) AS 'balancePaymentAmount'
|
|
|
+ , COUNT(distinct t.user_id_) AS 'userPurchaseNumber'
|
|
|
+ FROM student_payment_order t
|
|
|
+ <if test="param.goodId != null">
|
|
|
+ LEFT JOIN sell_order so on t.order_no_ = so.order_no_
|
|
|
+ </if>
|
|
|
<where>
|
|
|
status_ = 'SUCCESS'
|
|
|
<if test="param.tenantId != null">
|
|
|
- AND tenant_id_ =#{param.tenantId}
|
|
|
+ AND t.tenant_id_ =#{param.tenantId}
|
|
|
</if>
|
|
|
<if test="param.groupType!= null">
|
|
|
- AND group_type_ =#{param.groupType}
|
|
|
+ AND t.group_type_ =#{param.groupType}
|
|
|
</if>
|
|
|
<if test="param.type!= null">
|
|
|
- AND type_ =#{param.type}
|
|
|
+ AND t.type_ =#{param.type}
|
|
|
</if>
|
|
|
<if test="param.activityId != null">
|
|
|
- AND find_in_set(activity_id_,#{param.activityId})
|
|
|
+ AND find_in_set(t.activity_id_,#{param.activityId})
|
|
|
</if>
|
|
|
<if test="param.musicGroupId != null">
|
|
|
- AND find_in_set(music_group_id_,#{param.musicGroupId})
|
|
|
+ AND find_in_set(t.music_group_id_,#{param.musicGroupId})
|
|
|
+ </if>
|
|
|
+ <if test="param.goodId != null">
|
|
|
+ AND find_in_set(so.goods_id_,#{param.goodId})
|
|
|
+ </if>
|
|
|
+ <if test="param.startPayTime != null and param.endPayTime != null">
|
|
|
+ AND t.pay_time_ between #{param.startPayTime} and #{param.endPayTime}
|
|
|
</if>
|
|
|
</where>
|
|
|
GROUP BY organ_id_
|
|
@@ -1316,6 +1325,9 @@
|
|
|
, (t.actual_amount_ + t.balance_payment_amount_) as payAmount
|
|
|
from student_payment_order t
|
|
|
left join sys_user su on t.user_id_ = su.id_
|
|
|
+ <if test="goodId != null">
|
|
|
+ LEFT JOIN sell_order so on t.order_no_ = so.order_no_
|
|
|
+ </if>
|
|
|
<where>
|
|
|
t.status_='SUCCESS'
|
|
|
<if test="tenantId != null">
|
|
@@ -1339,12 +1351,18 @@
|
|
|
<if test="musicGroupId != null">
|
|
|
AND find_in_set(music_group_id_,#{musicGroupId})
|
|
|
</if>
|
|
|
+ <if test="goodId != null">
|
|
|
+ AND find_in_set(so.goods_id_,#{goodId})
|
|
|
+ </if>
|
|
|
+ <if test="startPayTime != null and endPayTime != null">
|
|
|
+ AND t.pay_time_ between #{startPayTime} and #{endPayTime}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
<if test=" orderBy != null and asc == 0">
|
|
|
- order by #{orderBy} desc
|
|
|
+ order by ${orderBy} desc
|
|
|
</if>
|
|
|
<if test=" orderBy != null and asc == 1">
|
|
|
- order by #{orderBy} asc
|
|
|
+ order by ${orderBy} asc
|
|
|
</if>
|
|
|
<include refid="global.limit"/>
|
|
|
</select>
|
|
@@ -1352,25 +1370,37 @@
|
|
|
<select id="queryPaymentStudentCount" resultType="java.lang.Integer">
|
|
|
select count(1) from student_payment_order t
|
|
|
left join sys_user su on t.user_id_ = su.id_
|
|
|
+ <if test="goodId != null">
|
|
|
+ LEFT JOIN sell_order so on t.order_no_ = so.order_no_
|
|
|
+ </if>
|
|
|
<where>
|
|
|
- t.status_='SUCCESS' and t.tenant_id_ = #{param.tenantId}
|
|
|
- <if test="param.organId != null">
|
|
|
- t.organ_id_ = #{param.organId}
|
|
|
+ t.status_='SUCCESS'
|
|
|
+ <if test="tenantId != null">
|
|
|
+ AND t.tenant_id_ =#{tenantId}
|
|
|
+ </if>
|
|
|
+ <if test="organId != null">
|
|
|
+ AND t.organ_id_ = #{organId}
|
|
|
</if>
|
|
|
- <if test="param.userName != null and param.userName.trim() !=''">
|
|
|
- su.username_ like concat('%',#{param.userName},'%')
|
|
|
+ <if test="userName != null and userName.trim() !=''">
|
|
|
+ AND su.username_ like concat('%',#{userName},'%')
|
|
|
</if>
|
|
|
- <if test="param.groupType!= null">
|
|
|
- AND group_type_ =#{param.groupType}
|
|
|
+ <if test="groupType != null">
|
|
|
+ AND group_type_ =#{groupType}
|
|
|
</if>
|
|
|
- <if test="param.type!= null">
|
|
|
- AND type_ =#{param.type}
|
|
|
+ <if test="type != null">
|
|
|
+ AND type_ =#{type}
|
|
|
</if>
|
|
|
- <if test="param.activityId != null">
|
|
|
- AND find_in_set(activity_id_,#{param.activityId})
|
|
|
+ <if test="activityId != null">
|
|
|
+ AND find_in_set(activity_id_,#{activityId})
|
|
|
</if>
|
|
|
- <if test="param.musicGroupId != null">
|
|
|
- AND find_in_set(music_group_id_,#{param.musicGroupId})
|
|
|
+ <if test="musicGroupId != null">
|
|
|
+ AND find_in_set(music_group_id_,#{musicGroupId})
|
|
|
+ </if>
|
|
|
+ <if test="goodId != null">
|
|
|
+ AND find_in_set(so.goods_id_,#{goodId})
|
|
|
+ </if>
|
|
|
+ <if test="startPayTime != null and endPayTime != null">
|
|
|
+ AND t.pay_time_ between #{startPayTime} and #{endPayTime}
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|