|
@@ -7,6 +7,7 @@
|
|
|
type="com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail"
|
|
|
id="MusicGroupPaymentStudentCourseDetail">
|
|
|
<result column="id_" property="id"/>
|
|
|
+ <result column="music_group_id_" property="musicGroupId"/>
|
|
|
<result column="music_group_payment_calender_id_" property="musicGroupPaymentCalenderId"/>
|
|
|
<result column="music_group_payment_calender_detail_id_"
|
|
|
property="musicGroupPaymentCalenderDetailId"/>
|
|
@@ -42,10 +43,10 @@
|
|
|
parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail"
|
|
|
useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
INSERT INTO music_group_payment_student_course_detail
|
|
|
- (music_group_payment_calender_id_, music_group_payment_calender_detail_id_, user_id_, course_type_,
|
|
|
+ (music_group_id_,music_group_payment_calender_id_, music_group_payment_calender_detail_id_, user_id_, course_type_,
|
|
|
total_course_minutes_, used_course_minutes_, create_time_, update_time_, course_original_price_,
|
|
|
course_current_price_, tenant_id_,cloud_teacher_payment_flag_)
|
|
|
- VALUES (#{musicGroupPaymentCalenderId}, #{musicGroupPaymentCalenderDetailId}, #{userId},
|
|
|
+ VALUES (#{musicGroupId}, #{musicGroupPaymentCalenderId}, #{musicGroupPaymentCalenderDetailId}, #{userId},
|
|
|
#{courseType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{totalCourseMinutes},
|
|
|
#{usedCourseMinutes},
|
|
|
NOW(), NOW(), #{courseOriginalPrice}, #{courseCurrentPrice}, #{tenantId},#{cloudTeacherPaymentFlag})
|
|
@@ -54,12 +55,12 @@
|
|
|
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyColumn="id"
|
|
|
keyProperty="id">
|
|
|
INSERT INTO music_group_payment_student_course_detail
|
|
|
- (music_group_payment_calender_id_,music_group_payment_calender_detail_id_,user_id_,
|
|
|
+ (music_group_id_,music_group_payment_calender_id_,music_group_payment_calender_detail_id_,user_id_,
|
|
|
course_type_,total_course_minutes_,used_course_minutes_,create_time_,update_time_,course_original_price_,
|
|
|
course_current_price_,tenant_id_,cloud_teacher_payment_flag_)
|
|
|
VALUES
|
|
|
<foreach collection="list" item="item" separator=",">
|
|
|
- (#{item.musicGroupPaymentCalenderId},#{item.musicGroupPaymentCalenderDetailId},
|
|
|
+ (#{item.musicGroupId},#{item.musicGroupPaymentCalenderId},#{item.musicGroupPaymentCalenderDetailId},
|
|
|
#{item.userId},#{item.courseType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
#{item.totalCourseMinutes},#{item.usedCourseMinutes},NOW(),NOW(),#{item.courseOriginalPrice},
|
|
|
#{item.courseCurrentPrice},#{item.tenantId},#{item.cloudTeacherPaymentFlag})
|
|
@@ -196,12 +197,10 @@
|
|
|
<select id="getUnUseWithStudentAndCourseTypeAndCourseMinutes" resultMap="MusicGroupPaymentStudentCourseDetail">
|
|
|
SELECT mgpscd.*
|
|
|
FROM music_group_payment_student_course_detail mgpscd
|
|
|
- LEFT JOIN music_group_payment_calender mgpc ON mgpscd.music_group_payment_calender_id_ = mgpc.id_
|
|
|
- WHERE FIND_IN_SET(mgpc.batch_no_, #{batchNo})
|
|
|
- AND mgpscd.user_id_ = #{studentId}
|
|
|
- AND mgpscd.course_type_ = #{courseType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
- AND mgpscd.used_course_minutes_ <= 0
|
|
|
- ORDER BY mgpscd.id_;
|
|
|
+ WHERE mgpscd.user_id_ = #{studentId}
|
|
|
+ AND mgpscd.course_type_ = #{courseType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
+ AND mgpscd.total_course_minutes_ > mgpscd.used_course_minutes_ AND mgpscd.music_group_id_ = #{musicGroupId}
|
|
|
+ ORDER BY mgpscd.id_
|
|
|
</select>
|
|
|
|
|
|
<select id="getUnUseBatchNoWithStudentAndCourseTypeAndCourseMinutes" resultType="string">
|
|
@@ -209,8 +208,7 @@
|
|
|
mgpc.batch_no_
|
|
|
FROM music_group_payment_calender mgpc
|
|
|
LEFT JOIN music_group_payment_student_course_detail mgpscd ON mgpscd.music_group_payment_calender_id_ = mgpc.id_
|
|
|
- WHERE
|
|
|
- mgpc.music_group_id_ = #{musicGroupId}
|
|
|
+ WHERE mgpc.music_group_id_ = #{musicGroupId}
|
|
|
<if test="studentId != null">
|
|
|
AND mgpscd.user_id_ = #{studentId}
|
|
|
</if>
|