Prechádzať zdrojové kódy

update 修改续费回调逻辑

周箭河 5 rokov pred
rodič
commit
10293c9f2f

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDetailDao.java

@@ -52,4 +52,13 @@ public interface MusicGroupPaymentCalenderDetailDao extends BaseDAO<Long, MusicG
 	 * @return
 	 */
 	BigDecimal sumActualAmount(@Param("id") Long id);
+
+	/**
+	 * 获取学生最后一期续费记录
+	 * @param musicGroupId
+	 * @param userId
+	 * @return
+	 */
+	MusicGroupPaymentCalenderDetail getUserLastCalenderDetail(@Param("musicGroupId") String musicGroupId, @Param("userId") Integer userId);
+
 }

+ 7 - 0
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml

@@ -211,4 +211,11 @@
 		SELECT SUM(mgpcd.actual_amount_) FROM music_group_payment_calender_detail mgpcd
 		WHERE mgpcd.music_group_payment_calender_id_ = #{id} AND mgpcd.payment_status_ = "PAID_COMPLETED"
 	</select>
+
+	<select id="getUserLastCalenderDetail" resultMap="MusicGroupPaymentCalenderDetail">
+		SELECT * FROM music_group_payment_calender_detail mgpcd
+		LEFT JOIN music_group_payment_calender mgpc ON mgpcd.music_group_payment_calender_id_ = mgpc.id_
+		WHERE mgpc.music_group_id_=#{musicGroupId} AND mgpcd.user_id_=#{userId} AND mgpcd.payment_status_ = 'PROCESSING'
+		ORDER BY mgpc.start_payment_date_ DESC
+	</select>
 </mapper>