|
@@ -105,6 +105,7 @@
|
|
</resultMap>
|
|
</resultMap>
|
|
<sql id="queryCoopRefundSql">
|
|
<sql id="queryCoopRefundSql">
|
|
<where>
|
|
<where>
|
|
|
|
+ mgpc.status_ IN ('OPEN','OVER','PAID')
|
|
<if test="errorType != null and errorType != ''">
|
|
<if test="errorType != null and errorType != ''">
|
|
<if test="errorType == 'COOPERATION_PAYMENT_ERROR'">
|
|
<if test="errorType == 'COOPERATION_PAYMENT_ERROR'">
|
|
AND TIMESTAMPDIFF(DAY,crp.refund_date_,DATE_FORMAT(NOW(),'%Y-%m-%d')) >= 1
|
|
AND TIMESTAMPDIFF(DAY,crp.refund_date_,DATE_FORMAT(NOW(),'%Y-%m-%d')) >= 1
|
|
@@ -125,6 +126,7 @@
|
|
select COUNT(DISTINCT crp.cooperation_organ_id_)
|
|
select COUNT(DISTINCT crp.cooperation_organ_id_)
|
|
from music_group_calender_refund_period crp
|
|
from music_group_calender_refund_period crp
|
|
left join cooperation_organ co ON co.id_ = crp.cooperation_organ_id_
|
|
left join cooperation_organ co ON co.id_ = crp.cooperation_organ_id_
|
|
|
|
+ left join music_group_payment_calender mgpc ON mgpc.id_ = crp.calender_id_
|
|
<include refid="queryCoopRefundSql"/>
|
|
<include refid="queryCoopRefundSql"/>
|
|
</select>
|
|
</select>
|
|
<select id="queryCoopRefund" resultMap="CooperationRefundDto">
|
|
<select id="queryCoopRefund" resultMap="CooperationRefundDto">
|
|
@@ -132,6 +134,7 @@
|
|
SUM(refund_amount_) receivable_,SUM(sub_refund_amount_) prepaidFee,co.education_user_id_
|
|
SUM(refund_amount_) receivable_,SUM(sub_refund_amount_) prepaidFee,co.education_user_id_
|
|
from music_group_calender_refund_period crp
|
|
from music_group_calender_refund_period crp
|
|
left join cooperation_organ co ON co.id_ = crp.cooperation_organ_id_
|
|
left join cooperation_organ co ON co.id_ = crp.cooperation_organ_id_
|
|
|
|
+ left join music_group_payment_calender mgpc ON mgpc.id_ = crp.calender_id_
|
|
<include refid="queryCoopRefundSql"/>
|
|
<include refid="queryCoopRefundSql"/>
|
|
group by crp.cooperation_organ_id_
|
|
group by crp.cooperation_organ_id_
|
|
order by crp.id_ DESC
|
|
order by crp.id_ DESC
|
|
@@ -167,10 +170,10 @@
|
|
</sql>
|
|
</sql>
|
|
<sql id="queryCoopCalenderHavingSql">
|
|
<sql id="queryCoopCalenderHavingSql">
|
|
<if test="refundStatus != null and refundStatus != ''">
|
|
<if test="refundStatus != null and refundStatus != ''">
|
|
- <if test="refundStatus = 'ING'">
|
|
|
|
|
|
+ <if test="refundStatus == 'ING'">
|
|
HAVING SUM(crp.sub_refund_amount_) > 0
|
|
HAVING SUM(crp.sub_refund_amount_) > 0
|
|
</if>
|
|
</if>
|
|
- <if test="refundStatus = 'END'">
|
|
|
|
|
|
+ <if test="refundStatus == 'END'">
|
|
HAVING SUM(crp.sub_refund_amount_) = 0
|
|
HAVING SUM(crp.sub_refund_amount_) = 0
|
|
</if>
|
|
</if>
|
|
</if>
|
|
</if>
|