|
@@ -36,8 +36,8 @@
|
|
|
<!-- 向数据库增加一条记录 -->
|
|
|
<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupStudentFee" useGeneratedKeys="true"
|
|
|
keyColumn="id" keyProperty="id">
|
|
|
- INSERT INTO music_group_student_fee_ (id_,music_group_id_,user_id_,course_fee_,create_time_,update_time_,next_payment_date_,latest_paid_time_,continuous_absenteeism_times_,subject_id_,payment_status_,temporary_course_fee_,is_lock_,payment_period_list_)
|
|
|
- VALUES(#{id},#{musicGroupId},#{userId},#{courseFee},now(),now(),#{nextPaymentDate},#{latestPaidTime},#{continuousAbsenteeismTimes},#{subjectId},#{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{temporaryCourseFee},#{isLock},#{paymentPeriodList})
|
|
|
+ INSERT INTO music_group_student_fee_ (id_,music_group_id_,user_id_,course_fee_,create_time_,update_time_,next_payment_date_,latest_paid_time_,continuous_absenteeism_times_,subject_id_,payment_status_,temporary_course_fee_,payment_period_list_)
|
|
|
+ VALUES(#{id},#{musicGroupId},#{userId},#{courseFee},now(),now(),#{nextPaymentDate},#{latestPaidTime},#{continuousAbsenteeismTimes},#{subjectId},#{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{temporaryCourseFee},#{paymentPeriodList})
|
|
|
</insert>
|
|
|
|
|
|
<insert id="batchInsert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupStudentFee">
|
|
@@ -165,6 +165,7 @@
|
|
|
<select id="countStudentNoPayNum" resultType="java.lang.Integer">
|
|
|
SELECT COUNT(DISTINCT sr.id_) FROM student_registration sr LEFT JOIN music_group_student_fee_ sf ON sr.user_id_ = sf.user_id_
|
|
|
WHERE sr.music_group_id_ = #{musicGroupId} AND sr.music_group_status_ != 'QUIT' AND sf.payment_status_ != 'PAID_COMPLETED'
|
|
|
+ AND sr.music_group_id_ = sf.music_group_id_
|
|
|
</select>
|
|
|
|
|
|
<select id="findContinuousAbsenteeismTimesByUsersAndMusicGroup" resultType="map">
|
|
@@ -196,41 +197,12 @@
|
|
|
<update id="batchUpdate" parameterType="java.util.List">
|
|
|
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
|
|
|
UPDATE music_group_student_fee_
|
|
|
- <set>
|
|
|
- <if test="item.userId != null">
|
|
|
- user_id_ = #{item.userId},
|
|
|
- </if>
|
|
|
- <if test="item.subjectId != null">
|
|
|
- subject_id_ = #{item.subjectId},
|
|
|
- </if>
|
|
|
- <if test="item.updateTime != null">
|
|
|
- update_time_ = #{item.updateTime},
|
|
|
- </if>
|
|
|
- <if test="item.courseFee != null">
|
|
|
- course_fee_ = #{item.courseFee},
|
|
|
- </if>
|
|
|
- <if test="item.musicGroupId != null">
|
|
|
- music_group_id_ = #{item.musicGroupId},
|
|
|
- </if>
|
|
|
- <if test="item.nextPaymentDate != null">
|
|
|
- next_payment_date_ = #{item.nextPaymentDate},
|
|
|
- </if>
|
|
|
- <if test="item.latestPaidTime != null">
|
|
|
- latest_paid_time_ = #{item.latestPaidTime},
|
|
|
- </if>
|
|
|
- <if test="item.continuousAbsenteeismTimes != null">
|
|
|
- continuous_absenteeism_times_ = #{item.continuousAbsenteeismTimes},
|
|
|
- </if>
|
|
|
- <if test="item.paymentStatus != null">
|
|
|
- payment_status_ = #{item.paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
- </if>
|
|
|
- <if test="item.temporaryCourseFee != null">
|
|
|
- temporary_course_fee_ = #{item.temporaryCourseFee},
|
|
|
- </if>
|
|
|
- <if test="item.paymentPeriodList != null">
|
|
|
- payment_period_list_ = #{item.paymentPeriodList},
|
|
|
- </if>
|
|
|
- </set>
|
|
|
+ SET update_time_ = NOW(),payment_period_list_ = #{item.paymentPeriodList},
|
|
|
+ next_payment_date_ = #{item.nextPaymentDate},subject_id_ = #{item.subjectId},
|
|
|
+ course_fee_ = #{item.courseFee},latest_paid_time_ = #{item.latestPaidTime},
|
|
|
+ continuous_absenteeism_times_ = #{item.continuousAbsenteeismTimes},
|
|
|
+ payment_status_ = #{item.paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ temporary_course_fee_ = #{item.temporaryCourseFee}
|
|
|
WHERE id_ = #{item.id}
|
|
|
</foreach>
|
|
|
</update>
|
|
@@ -240,7 +212,27 @@
|
|
|
</update>
|
|
|
<update id="updateStudentFee">
|
|
|
UPDATE music_group_student_fee_
|
|
|
- SET course_fee_ = #{courseFee},is_lock_ = #{isLock},payment_period_list_ = #{paymentPeriodList}
|
|
|
- WHERE music_group_id_ = #{musicGroupId} AND user_id_ = #{userId}
|
|
|
+ SET course_fee_ = #{fee.amount},payment_period_list_ = #{fee.month},update_time_ = NOW()
|
|
|
+ WHERE music_group_id_ = #{fee.musicGroupId} AND user_id_ = #{fee.studentId}
|
|
|
+ </update>
|
|
|
+ <update id="updateStudentFeeIsLock">
|
|
|
+ UPDATE music_group_student_fee_
|
|
|
+ SET is_lock_ = #{fee.isLock},update_time_ = NOW()
|
|
|
+ WHERE music_group_id_ = #{fee.musicGroupId} AND user_id_ = #{fee.studentId}
|
|
|
+ </update>
|
|
|
+ <update id="batchUpdateCalender">
|
|
|
+ UPDATE music_group_student_fee_
|
|
|
+ SET payment_period_list_ = #{month},update_time_ = NOW()
|
|
|
+ WHERE music_group_id_ = #{musicGroupId} AND is_lock_ = 0
|
|
|
+ </update>
|
|
|
+ <update id="batchUpdateCalenders">
|
|
|
+ UPDATE music_group_student_fee_ mgsf SET mgsf.payment_period_list_ = (
|
|
|
+ SELECT GROUP_CONCAT(mgpc.payment_month_) FROM music_group_payment_calender mgpc WHERE mgpc.music_group_id_ = mgsf.music_group_id_)
|
|
|
+ WHERE mgsf.music_group_id_ = #{musicGroupId}
|
|
|
+ </update>
|
|
|
+ <update id="updateCalender">
|
|
|
+ UPDATE music_group_student_fee_ mgsf SET mgsf.payment_period_list_ = (
|
|
|
+ SELECT GROUP_CONCAT(mgpc.payment_month_) FROM music_group_payment_calender mgpc WHERE mgpc.music_group_id_ = mgsf.music_group_id_)
|
|
|
+ WHERE mgsf.music_group_id_ = #{musicGroupId} AND mgsf.user_id_ = #{userId}
|
|
|
</update>
|
|
|
</mapper>
|