zouxuan 2 роки тому
батько
коміт
e5015df770

+ 3 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/page/CooperationRefundQueryInfo.java

@@ -12,7 +12,7 @@ public class CooperationRefundQueryInfo extends QueryInfo {
     private String organId;
 
     @ApiModelProperty(value = "回访状态",required = false)
-    private Integer refundStatus;
+    private String refundStatus;
 
     @ApiModelProperty(value = "缴费开始时间",required = false)
     private String refundStartDate;
@@ -39,11 +39,11 @@ public class CooperationRefundQueryInfo extends QueryInfo {
         this.cooperationId = cooperationId;
     }
 
-    public Integer getRefundStatus() {
+    public String getRefundStatus() {
         return refundStatus;
     }
 
-    public void setRefundStatus(Integer refundStatus) {
+    public void setRefundStatus(String refundStatus) {
         this.refundStatus = refundStatus;
     }
 

+ 8 - 8
mec-biz/src/main/resources/config/mybatis/CooperationShareProfitMapper.xml

@@ -84,18 +84,18 @@
 	</select>
 	<select id="initShareProfit" resultMap="CooperationShareProfit">
 		select spo.organ_id_,mg.cooperation_organ_id_ cooperation_id_,sr.music_group_id_,spod.price_,COUNT(distinct spod.id_) musical_num_,
-		SUM(CASE WHEN spod.price_ IS NULL THEN 0 ELSE spod.price_ END) total_amount_
-		from (select sr.music_group_id_,max(sr.music_group_payment_calender_id_) music_group_payment_calender_id_ from student_registration sr
+		SUM(CASE WHEN spod.price_ IS NULL THEN 0 ELSE spod.price_ END) total_amount_ from student_registration sr
+		left join music_group mg ON mg.id_ = sr.music_group_id_
+		left join music_group_payment_calender mgpc ON mgpc.id_ = sr.music_group_payment_calender_id_
+		left join student_payment_order spo ON spo.calender_id_ = sr.music_group_payment_calender_id_ and sr.user_id_ = spo.user_id_
+		left join student_payment_order_detail spod ON spod.payment_order_id_ = spo.id_
 		where sr.music_group_id_ IN
 		<foreach collection="musicGroupIds" item="id" open="(" close=")">
 			#{id}
 		</foreach>
-		AND sr.music_group_status_ = 'NORMAL' group by sr.music_group_id_) sr
-		left join music_group mg ON mg.id_ = sr.music_group_id_
-		left join music_group_payment_calender mgpc ON mgpc.id_ = sr.music_group_payment_calender_id_
-		left join student_payment_order spo ON spo.calender_id_ = sr.music_group_payment_calender_id_
-		left join student_payment_order_detail spod ON spod.payment_order_id_ = spo.id_
-		where mgpc.payment_type_ = 'MUSIC_APPLY' AND spo.type_ = 'APPLY' AND spo.status_ = 'SUCCESS' AND spod.type_ = 'ORGAN_SHARE_PROFIT'
+		AND sr.music_group_status_ = 'NORMAL'
+		AND mgpc.payment_type_ = 'MUSIC_APPLY' AND spo.type_ = 'APPLY' AND spo.status_ = 'SUCCESS' AND spod.type_ = 'ORGAN_SHARE_PROFIT'
+		group by sr.music_group_id_
 	</select>
 	<resultMap id="CooperationShareProfitDto" type="com.ym.mec.biz.dal.entity.CooperationShareProfitDto" extends="CooperationShareProfit">
 		<result property="educationUserId" column="education_user_id_"/>