|
@@ -6,6 +6,7 @@
|
|
|
<resultMap type="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail"
|
|
|
id="MusicGroupPaymentCalenderDetail">
|
|
|
<result column="id_" property="id" />
|
|
|
+ <result column="tenant_id_" property="tenantId"/>
|
|
|
<result column="music_group_payment_calender_id_" property="musicGroupPaymentCalenderId" />
|
|
|
<result column="user_id_" property="userId" />
|
|
|
<result column="expect_amount_" property="expectAmount" />
|
|
@@ -46,7 +47,7 @@
|
|
|
|
|
|
<!-- 全查询 -->
|
|
|
<select id="findAll" resultMap="MusicGroupPaymentCalenderDetail">
|
|
|
- SELECT * FROM music_group_payment_calender_detail ORDER BY id_
|
|
|
+ SELECT * FROM music_group_payment_calender_detail where tenant_id_ = #{tenantId} ORDER BY id_
|
|
|
</select>
|
|
|
|
|
|
<!-- 向数据库增加一条记录 -->
|
|
@@ -56,11 +57,11 @@
|
|
|
INSERT INTO music_group_payment_calender_detail
|
|
|
(music_group_payment_calender_id_,user_id_,expect_amount_,actual_amount_,payment_status_,
|
|
|
user_status_,pay_time_,update_time_,create_time_,start_payment_date_,deadline_payment_date_,
|
|
|
- payment_order_id_,use_in_course_,responsible_user_id_,responsible_record_,expect_member_amount_)
|
|
|
+ payment_order_id_,use_in_course_,responsible_user_id_,responsible_record_,expect_member_amount_,tenant_id_)
|
|
|
VALUES(#{musicGroupPaymentCalenderId},#{userId},#{expectAmount},#{actualAmount},
|
|
|
#{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
#{userStatus},#{payTime},NOW(),NOW(),#{startPaymentDate},#{deadlinePaymentDate},
|
|
|
- #{paymentOrderId},#{useInCourse},#{responsibleUserId},#{responsibleRecord},#{expectMemberAmount})
|
|
|
+ #{paymentOrderId},#{useInCourse},#{responsibleUserId},#{responsibleRecord},#{expectMemberAmount},#{tenantId})
|
|
|
</insert>
|
|
|
|
|
|
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyColumn="id"
|
|
@@ -68,13 +69,13 @@
|
|
|
INSERT INTO music_group_payment_calender_detail
|
|
|
(music_group_payment_calender_id_,user_id_,expect_amount_,actual_amount_,
|
|
|
payment_status_,user_status_,pay_time_,update_time_,create_time_,start_payment_date_,
|
|
|
- deadline_payment_date_,payment_order_id_,use_in_course_,responsible_user_id_,responsible_record_,expect_member_amount_)
|
|
|
+ deadline_payment_date_,payment_order_id_,use_in_course_,responsible_user_id_,responsible_record_,expect_member_amount_,tenant_id_)
|
|
|
VALUES
|
|
|
<foreach collection="list" item="item" separator=",">
|
|
|
(#{item.musicGroupPaymentCalenderId},#{item.userId},#{item.expectAmount},
|
|
|
#{item.actualAmount},#{item.paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.userStatus},#{item.payTime},
|
|
|
#{item.updateTime},#{item.createTime},#{item.startPaymentDate},#{item.deadlinePaymentDate},
|
|
|
- #{item.paymentOrderId},#{item.useInCourse},#{item.responsibleUserId},#{item.responsibleRecord},#{item.expectMemberAmount})
|
|
|
+ #{item.paymentOrderId},#{item.useInCourse},#{item.responsibleUserId},#{item.responsibleRecord},#{item.expectMemberAmount},#{item.tenantid})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
|
|
@@ -132,7 +133,7 @@
|
|
|
responsible_record_ = #{responsibleRecord},
|
|
|
</if>
|
|
|
</set>
|
|
|
- WHERE id_ = #{id}
|
|
|
+ WHERE id_ = #{id} and tenant_id_ = #{tenantId}
|
|
|
</update>
|
|
|
<update id="batchUpdate">
|
|
|
<foreach collection="calenderDetails" item="item" index="index" open="" close="" separator=";">
|
|
@@ -187,7 +188,7 @@
|
|
|
responsible_record_ = #{item.responsibleRecord},
|
|
|
</if>
|
|
|
</set>
|
|
|
- WHERE id_ = #{item.id}
|
|
|
+ WHERE id_ = #{item.id} and tenant_id_ = #{item.tenantId}
|
|
|
</foreach>
|
|
|
</update>
|
|
|
<update id="refreshUserMusicGroupPaymentStatusTask">
|
|
@@ -232,7 +233,7 @@
|
|
|
</select>
|
|
|
<sql id="queryPageSql">
|
|
|
<where>
|
|
|
- mgpc.music_group_id_ = sr.music_group_id_
|
|
|
+ mgpc.music_group_id_ = sr.music_group_id_ and mgpcd.tenant_id_ = #{tenantId}
|
|
|
<if test="search != null and search != ''">
|
|
|
AND (mgpcd.user_id_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))
|
|
|
</if>
|
|
@@ -438,7 +439,7 @@
|
|
|
|
|
|
<sql id="queryArrearageStudentsCondition">
|
|
|
<where>
|
|
|
- mg.status_ = 'PROGRESS'
|
|
|
+ mg.status_ = 'PROGRESS' and mg.tenant_id_ = #{tenantId}
|
|
|
AND ((mgpc.member_rank_setting_id_ IS NOT NULL AND (sr.membership_end_time_ < NOW() OR sr.membership_end_time_ IS NULL)) OR mgpc.member_rank_setting_id_ IS NULL)
|
|
|
<if test="noPaymentType==null or noPaymentType==0">
|
|
|
AND DATE_FORMAT(NOW(),'%Y-%m-%d') > DATE_FORMAT(mgpc.deadline_payment_date_,'%Y-%m-%d')
|
|
@@ -524,7 +525,7 @@
|
|
|
music_group_payment_calender_detail mgpcd
|
|
|
LEFT JOIN music_group_payment_calender mgpc ON mgpcd.music_group_payment_calender_id_ = mgpc.id_
|
|
|
LEFT JOIN music_group mg ON mgpc.music_group_id_ = mg.id_
|
|
|
- WHERE mg.status_ = 'PROGRESS'
|
|
|
+ WHERE mg.status_ = 'PROGRESS' and mg.tenant_id_ = #{tenantId}
|
|
|
AND DATE_FORMAT( NOW(), '%Y-%m-%d' ) >= DATE_FORMAT( mgpc.payment_valid_start_date_, '%Y-%m-%d' )
|
|
|
AND mgpcd.payment_status_ = 'NON_PAYMENT'
|
|
|
AND (mgpcd.expect_amount_ + mgpcd.expect_member_amount_) > 0 AND mgpc.pay_user_type_ = 'STUDENT'
|